From 9917356b407b726040202d19622f0eb3cf3e0b36 Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Thu, 15 Aug 2024 14:41:10 -0500 Subject: [PATCH] Add result to OpenRPC --- zenith-openrpc.json | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/zenith-openrpc.json b/zenith-openrpc.json index 1d193ac..81f1987 100644 --- a/zenith-openrpc.json +++ b/zenith-openrpc.json @@ -194,7 +194,7 @@ { "name": "ListAddresses example", "summary": "Get list of addresses", - "description": "Get the list of addresses available in Zenith for the given wallet ID", + "description": "Get the list of addresses available in Zenith for the given account ID", "params": [ { "name": "accountId", @@ -248,12 +248,20 @@ "summary": "Get the balance of the given account", "description": "Get the balance of the given account, including any unconfirmed balance.", "tags": [{"$ref": "#/components/tags/draft"},{"$ref": "#/components/tags/wip"}], - "params": [], + "params": [{ "$ref": "#/components/contentDescriptors/AccountId"}], "result": { "name": "Balance", "schema": { + "type": "object", + "properties": { + "confirmed": {"$ref": "#/components/schemas/Balance" }, + "unconfirmed": {"$ref": "#/components/schemas/Balance" } + } } - } + }, + "errors": [ + { "$ref": "#/components/errors/InvalidAccount" } + ] }, { "name": "listreceived", @@ -456,6 +464,14 @@ "outindex": { "type": "integer", "description": "The Sapling output index, or the Orchard action index"}, "change": { "type": "boolean", "description": "True if this output was received by a change address"} } + }, + "Balance": { + "type": "object", + "properties": { + "transparent": { "type": "integer", "description": "Confirmed transparent balance in zats." }, + "sapling": { "type": "integer", "description": "Confirmed Sapling balance in zats." }, + "orchard": { "type": "integer", "description": "Confirmed Orchard balance in zats." } + } } }, "examples": {}, @@ -487,8 +503,11 @@ "InvalidAddress": { "code": -32005, "message": "Unable to parse address" + }, + "InvalidAccount": { + "code": -32006, + "message": "Account does not exist." } - } } }