diff --git a/doc/API.v0.md b/doc/API.v0.md index 03fa6de..51221c7 100644 --- a/doc/API.v0.md +++ b/doc/API.v0.md @@ -592,7 +592,25 @@ Proxy response: } ``` +### Get spending wallet's extended balances (called by application) +Calls getbalances RPC on the spending wallet. + +```http +GET http://cyphernode:8888/getbalances +``` + +Proxy response: + +```json +{ + "mine": { + "trusted": 1.29979716, + "untrusted_pending": 0.00000000, + "immature": 0.00000000 + } +} +``` ### Get a new Bitcoin address from spending wallet (called by application) diff --git a/doc/openapi/v0/cyphernode-api.yaml b/doc/openapi/v0/cyphernode-api.yaml index 63f1053..6e2ec88 100644 --- a/doc/openapi/v0/cyphernode-api.yaml +++ b/doc/openapi/v0/cyphernode-api.yaml @@ -958,6 +958,29 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiResponseTemporarilyUnavailable' + /getbalances: + get: + tags: + - "spending wallet" + - "core features" + summary: "Get the spending wallet extended balances" + description: "Returns the spending wallet extended balances, in BTC." + operationId: "getSpendingWalletBalances" + responses: + '200': + description: "successful operation" + content: + application/json: + schema: + $ref: '#/components/schemas/Balances' + '403': + $ref: '#/components/schemas/ApiResponseNotAllowed' + '503': + description: "Resource temporarily unavailable" + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponseTemporarilyUnavailable' /getbalancebyxpub/{xpub}: get: parameters: @@ -2026,6 +2049,13 @@ components: properties: balance: type: "number" + Balances: + type: "object" + required: + - "balances" + properties: + balances: + type: "object" Block: type: "object" required: