Update RPC docs

This commit is contained in:
Rene Vergara 2024-08-05 15:16:03 -05:00
parent a0b92ba468
commit 606c25c2c3
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2

View file

@ -91,10 +91,59 @@
{ "$ref": "#/components/errors/ZebraNotAvailable" }, { "$ref": "#/components/errors/ZebraNotAvailable" },
{ "$ref": "#/components/errors/NoWallets" } { "$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": { "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": { "schemas": {
"ZenithInfo": { "ZenithInfo": {
"type": "object", "type": "object",
@ -113,6 +162,14 @@
"birthday": { "type": "integer", "description": "Wallet's birthday height" }, "birthday": { "type": "integer", "description": "Wallet's birthday height" },
"lastSync": { "type": "integer", "description": "Last block the wallet is synced to" } "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": {}, "examples": {},
@ -128,6 +185,10 @@
"NoWallets": { "NoWallets": {
"code": -32001, "code": -32001,
"message": "No wallets available. Please create one first" "message": "No wallets available. Please create one first"
},
"NoAccounts": {
"code": -32002,
"message": "No accounts available. Please create one first"
} }
} }
} }