Read-only JSON. No keys, no state mutation — the same posture as the CypherFaucet / TestnetPool APIs. The wallet uses it to quote; the status page uses it for live data. Base URL: https://testnetswap.com/api.
Amounts appear both in display units (e.g. tBTC) and integer satoshis (*_sats) so clients can avoid floating-point drift.
Supported pairs with the current rate, limits, and free liquidity (total minus what's committed to in-flight swaps).
{
"ok": true,
"pairs": [
{ "from": "tLTC", "to": "tBTC", "rate": 0.01,
"min": 0.001, "max": 0.5,
"min_sats": 100000, "max_sats": 50000000,
"liquidity_free": 0.00994694, "liquidity_free_sats": 994694,
"liquidity_unit": "tBTC" },
{ "from": "tBTC", "to": "tLTC", ... }
]
}
Query: ?from=tLTC&to=tBTC&amount=0.5. Quotes against free liquidity, so a pending swap never over-commits the pool.
{
"ok": true,
"from": "tLTC", "to": "tBTC",
"send": 0.5, "receive": 0.005,
"send_sats": 50000000, "receive_sats": 500000,
"rate": 0.01, "fee": 0,
"min": 0.001, "max": 0.5
}
On failure: { "ok": false, "reason": "..." } — e.g. below min, above max, or over free liquidity.
Maker health and live liquidity. Drives uptime monitoring and the "maker online" indicator.
{
"ok": true,
"maker_online": true,
"pairs_up": ["tLTC-tBTC", "tBTC-tLTC"],
"liquidity": {
"tBTC": { "total": 1000000, "committed": 0, "free": 994694 },
"tLTC": { "total": 499714, "committed": 0, "free": 499714 }
},
"active_swaps": 0,
"uptime_secs": 76,
"version": "0.1.0"
}
All responses are read-only and CORS-enabled. The swap itself runs over a separate WSS relay (the wallet talks to the maker directly); this HTTP API is only for discovery and status. The discovery layer is shaped so additional makers could register later, but on testnet there is one maker — see the source.