feat: GET /api/v1/capabilities (client feature discovery)

Public, unauthenticated description of what this deployment offers, so the
wallet can adapt to the instance it's pointed at — grey out disabled chains and
features, and pick the right network. This is the client-facing half of the
open-core/feature-flag design: every capability is a config switch, surfaced
here. No secrets — only on/off flags and public network names.

Response: { version, chains: { btc/ltc/xmr/wow/grin: { enabled, network } },
features: { grin_relay, prices, nostr_identity, tips } }. UTXO chains carry
their configured network; CryptoNote/Grin report null. On the normal rate-limit
tier. Registered in openapi (system tag); 1 L1 test (public, well-shaped).
This commit is contained in:
jwinterm
2026-06-25 16:27:13 -04:00
parent c558e9d7bd
commit 1e2bdf3f16
6 changed files with 254 additions and 0 deletions
+113
View File
@@ -348,6 +348,27 @@
}
}
},
"/capabilities": {
"get": {
"tags": [
"system"
],
"summary": "Describe this instance's enabled chains and features.",
"operationId": "capabilities",
"responses": {
"200": {
"description": "Enabled chains and features",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CapabilitiesResponse"
}
}
}
}
}
}
},
"/health": {
"get": {
"tags": [
@@ -1670,6 +1691,71 @@
}
}
},
"CapabilitiesResponse": {
"type": "object",
"required": [
"version",
"chains",
"features"
],
"properties": {
"chains": {
"$ref": "#/components/schemas/ChainCapabilities"
},
"features": {
"$ref": "#/components/schemas/FeatureCapabilities"
},
"version": {
"type": "string",
"description": "Backend version (Cargo package version)."
}
}
},
"ChainCapabilities": {
"type": "object",
"required": [
"btc",
"ltc",
"xmr",
"wow",
"grin"
],
"properties": {
"btc": {
"$ref": "#/components/schemas/ChainCapability"
},
"grin": {
"$ref": "#/components/schemas/ChainCapability"
},
"ltc": {
"$ref": "#/components/schemas/ChainCapability"
},
"wow": {
"$ref": "#/components/schemas/ChainCapability"
},
"xmr": {
"$ref": "#/components/schemas/ChainCapability"
}
}
},
"ChainCapability": {
"type": "object",
"description": "Per-chain availability. `network` is the configured network for UTXO chains\n(so the wallet derives addresses for the right one); `null` for chains whose\nnetwork isn't a backend setting.",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean"
},
"network": {
"type": [
"string",
"null"
]
}
}
},
"CheckRestoreRequest": {
"type": "object",
"description": "Ask whether a wallet (by seed fingerprint) was created on this backend, and\nwhether the submitted keys match.",
@@ -1868,6 +1954,33 @@
}
}
},
"FeatureCapabilities": {
"type": "object",
"required": [
"grin_relay",
"prices",
"nostr_identity",
"tips"
],
"properties": {
"grin_relay": {
"type": "boolean",
"description": "Grin async slatepack relay mailbox."
},
"nostr_identity": {
"type": "boolean",
"description": "Nostr-native identity (NIP-98 login/link, NIP-05 directory)."
},
"prices": {
"type": "boolean",
"description": "Fiat price feed."
},
"tips": {
"type": "boolean",
"description": "Tipping (parked)."
}
}
},
"FeeRequest": {
"type": "object",
"description": "A fee-estimate request.",