feat(wallet): unified GET /wallet/heights (tip per chain)

The wallet's ChainProvider seam fetches all chain tips in one call
(getBlockchainHeights) and selects per asset; the backend exposed per-chain
height endpoints but no aggregate, so the client's call 404'd. Add a
best-effort /wallet/heights returning {btc,ltc,xmr,wow,grin} concurrently — a
disabled or unreachable chain is null, never failing the others. JWT-gated,
OpenAPI-annotated (drift clean).
This commit is contained in:
jwinterm
2026-06-28 22:01:14 -04:00
parent 56c8dd463a
commit ff89ca6584
4 changed files with 173 additions and 0 deletions
+71
View File
@@ -1040,6 +1040,35 @@
]
}
},
"/wallet/heights": {
"get": {
"tags": [
"system"
],
"summary": "Current tip height for every enabled chain (one round-trip).",
"operationId": "heights",
"responses": {
"200": {
"description": "Tip height per chain (null if disabled/unreachable)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HeightsResponse"
}
}
}
},
"401": {
"description": "Missing or invalid token"
}
},
"security": [
{
"bearer_auth": []
}
]
}
},
"/wallet/lws/balance": {
"post": {
"tags": [
@@ -2366,6 +2395,48 @@
}
}
},
"HeightsResponse": {
"type": "object",
"description": "Current tip height per chain. `null` = the chain is disabled on this instance\nor its source was unreachable for this request.",
"properties": {
"btc": {
"type": [
"integer",
"null"
],
"format": "int64",
"example": 955860
},
"grin": {
"type": [
"integer",
"null"
],
"format": "int64"
},
"ltc": {
"type": [
"integer",
"null"
],
"format": "int64"
},
"wow": {
"type": [
"integer",
"null"
],
"format": "int64"
},
"xmr": {
"type": [
"integer",
"null"
],
"format": "int64"
}
}
},
"HistoryEntry": {
"type": "object",
"description": "A transaction-history entry.",