What: convert an amount between two currencies using the reference rates. A second operation on the existing FX Rates capability (non-Stellar).
Route: GET /fx/convert?from=USD&to=EUR&amount=100
Sample response: { "from": "USD", "to": "EUR", "amount": "100", "rate": 0.92, "result": "92.00" }
Upstream: the same free no-key FX source the fx capability already uses. Add the op file under capabilities/fx/operations/.
How to build (one file)
Adding an operation to an existing capability is one new file. Copy an operation as your template:
cp apps/capabilities/src/capabilities/stellar/operations/status.ts \
apps/capabilities/src/capabilities/stellar/operations/<name>.ts
Then edit it: a single-word name (it becomes the op slug, e.g. Effects → /c/stellar/effects), the path, price: "0", a sampleRequest + sampleResponse, and the handler. Put any fetch logic in the capability's helper (stellar/horizon.ts).
Also add a word to the Stellar description in capabilities/stellar/capability.ts so search can find the new op (search matches name + description).
The registry auto-collects the file — nothing else to wire.
pnpm --filter capabilities typecheck
pnpm --filter capabilities dev # then curl the route on localhost:3004
Acceptance
- New file under
stellar/operations/, read-only, no secrets, clean JSON, price: "0".
- Manifest has
sampleRequest + sampleResponse; the Stellar description mentions it.
- typecheck passes and the route returns the documented shape locally.
See apps/capabilities/README.md. Open a PR with Closes #<this issue>. Because it's a new file, it won't conflict with anyone else's.
What: convert an amount between two currencies using the reference rates. A second operation on the existing FX Rates capability (non-Stellar).
Route:
GET /fx/convert?from=USD&to=EUR&amount=100Sample response:
{ "from": "USD", "to": "EUR", "amount": "100", "rate": 0.92, "result": "92.00" }Upstream: the same free no-key FX source the
fxcapability already uses. Add the op file undercapabilities/fx/operations/.How to build (one file)
Adding an operation to an existing capability is one new file. Copy an operation as your template:
Then edit it: a single-word
name(it becomes the op slug, e.g.Effects→/c/stellar/effects), thepath,price: "0", asampleRequest+sampleResponse, and thehandler. Put any fetch logic in the capability's helper (stellar/horizon.ts).Also add a word to the Stellar
descriptionincapabilities/stellar/capability.tsso search can find the new op (search matches name + description).The registry auto-collects the file — nothing else to wire.
pnpm --filter capabilities typecheck pnpm --filter capabilities dev # then curl the route on localhost:3004Acceptance
stellar/operations/, read-only, no secrets, clean JSON,price: "0".sampleRequest+sampleResponse; the Stellar description mentions it.See
apps/capabilities/README.md. Open a PR withCloses #<this issue>. Because it's a new file, it won't conflict with anyone else's.