From 606c25c2c313cfbe1fb1aa98104f8c9d833e27fb Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Mon, 5 Aug 2024 15:16:03 -0500 Subject: [PATCH] Update RPC docs --- zenith-openrpc.json | 63 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/zenith-openrpc.json b/zenith-openrpc.json index 768ba1b..5f3d8e9 100644 --- a/zenith-openrpc.json +++ b/zenith-openrpc.json @@ -91,10 +91,59 @@ { "$ref": "#/components/errors/ZebraNotAvailable" }, { "$ref": "#/components/errors/NoWallets" } ] + }, + { + "name": "listaccounts", + "tags": [ { "$ref": "#/components/tags/wallet" }], + "result": { + "name": "Accounts", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ZcashAccount" + } + } + }, + "params": [{ "$ref": "#/components/contentDescriptors/WalletId"}], + "paramStructure": "by-position", + "examples": [ + { + "name": "ListAccounts example", + "summary": "Get list of accounts", + "description": "Get the list of accounts available in Zenith for the given wallet ID", + "params": [ + { + "name": "walletId", + "summary": "The integer ID of the wallet to use", + "value": 1 + } + ], + "result": { + "name": "ListAccounts result", + "value": [ + ] + } + + } + ], + "errors": [ + { "$ref": "#/components/errors/ZebraNotAvailable" }, + { "$ref": "#/components/errors/NoAccounts" } + ] } ], "components": { - "contentDescriptors": {}, + "contentDescriptors": { + "WalletId": { + "name": "Wallet ID", + "summary": "The wallet's internal index used for unique identification", + "description": "An Integer value that uniquely identifies a wallet in Zenith", + "required": true, + "schema": { + "type": "integer" + } + } + }, "schemas": { "ZenithInfo": { "type": "object", @@ -113,6 +162,14 @@ "birthday": { "type": "integer", "description": "Wallet's birthday height" }, "lastSync": { "type": "integer", "description": "Last block the wallet is synced to" } } + }, + "ZcashAccount": { + "type": "object", + "properties": { + "index": { "type": "integer", "description": "Internal index for account"}, + "wallet": { "type": "integer", "description": "ID of the wallet this account belongs to"}, + "name": { "type": "string", "description": "User-friendly name of the account"} + } } }, "examples": {}, @@ -128,6 +185,10 @@ "NoWallets": { "code": -32001, "message": "No wallets available. Please create one first" + }, + "NoAccounts": { + "code": -32002, + "message": "No accounts available. Please create one first" } } }