Add result to OpenRPC

This commit is contained in:
Rene Vergara 2024-08-15 14:41:10 -05:00
parent e1dfb66fae
commit 9917356b40
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2

View file

@ -194,7 +194,7 @@
{ {
"name": "ListAddresses example", "name": "ListAddresses example",
"summary": "Get list of addresses", "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": [ "params": [
{ {
"name": "accountId", "name": "accountId",
@ -248,13 +248,21 @@
"summary": "Get the balance of the given account", "summary": "Get the balance of the given account",
"description": "Get the balance of the given account, including any unconfirmed balance.", "description": "Get the balance of the given account, including any unconfirmed balance.",
"tags": [{"$ref": "#/components/tags/draft"},{"$ref": "#/components/tags/wip"}], "tags": [{"$ref": "#/components/tags/draft"},{"$ref": "#/components/tags/wip"}],
"params": [], "params": [{ "$ref": "#/components/contentDescriptors/AccountId"}],
"result": { "result": {
"name": "Balance", "name": "Balance",
"schema": { "schema": {
"type": "object",
"properties": {
"confirmed": {"$ref": "#/components/schemas/Balance" },
"unconfirmed": {"$ref": "#/components/schemas/Balance" }
} }
} }
}, },
"errors": [
{ "$ref": "#/components/errors/InvalidAccount" }
]
},
{ {
"name": "listreceived", "name": "listreceived",
"summary": "List received transactions", "summary": "List received transactions",
@ -456,6 +464,14 @@
"outindex": { "type": "integer", "description": "The Sapling output index, or the Orchard action index"}, "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"} "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": {}, "examples": {},
@ -487,8 +503,11 @@
"InvalidAddress": { "InvalidAddress": {
"code": -32005, "code": -32005,
"message": "Unable to parse address" "message": "Unable to parse address"
},
"InvalidAccount": {
"code": -32006,
"message": "Account does not exist."
} }
} }
} }
} }