2024-08-03 12:00:12 +00:00
|
|
|
{
|
|
|
|
"openrpc": "1.0.0-rc1",
|
|
|
|
"info": {
|
|
|
|
"version": "0.1.0",
|
|
|
|
"title": "Zenith RPC",
|
|
|
|
"description": "The RPC methods to interact with the Zenith Zcash wallet",
|
|
|
|
"license": {
|
|
|
|
"name": "MIT"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"servers": [
|
|
|
|
{
|
2024-08-05 17:54:02 +00:00
|
|
|
"name": "Zenith RPC",
|
|
|
|
"summary": "The Zenith wallet RPC server",
|
|
|
|
"description": "This is the server that allows programmatic interaction with the Zenith Zcash wallet via RPC",
|
2024-08-03 12:00:12 +00:00
|
|
|
"url": "http://localhost:8234"
|
|
|
|
}
|
|
|
|
],
|
2024-08-05 17:54:02 +00:00
|
|
|
"methods": [
|
|
|
|
{
|
|
|
|
"name": "getinfo",
|
|
|
|
"tags": [ { "$ref": "#/components/tags/information" }],
|
|
|
|
"result" : {
|
|
|
|
"name": "Zenith information",
|
|
|
|
"schema": { "$ref": "#/components/schemas/ZenithInfo" }
|
|
|
|
},
|
|
|
|
"params" : [],
|
|
|
|
"examples": [
|
|
|
|
{
|
|
|
|
"name": "GetInfo example",
|
|
|
|
"summary": "Get information from Zenith",
|
|
|
|
"description": "Gets the status of the Zenith wallet server",
|
|
|
|
"params": [],
|
|
|
|
"result": {
|
|
|
|
"name": "GetInfo result",
|
|
|
|
"value": {
|
|
|
|
"version": "0.7.0.0-beta",
|
|
|
|
"network": "TestNet",
|
|
|
|
"zebraVersion": "v1.8.0"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"errors": [
|
|
|
|
{ "$ref": "#/components/errors/ZebraNotAvailable" }
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "listwallets",
|
|
|
|
"tags": [ { "$ref": "#/components/tags/wallet" }],
|
|
|
|
"result": {
|
|
|
|
"name": "Wallets",
|
|
|
|
"schema": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/components/schemas/ZcashWallet"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-08-05 18:04:57 +00:00
|
|
|
"params": [],
|
|
|
|
"examples": [
|
|
|
|
{
|
|
|
|
"name": "ListWallets example",
|
|
|
|
"summary": "Get list of wallets",
|
|
|
|
"description": "Get the list of wallets available in Zenith for the current network (Mainnet/Testnet)",
|
|
|
|
"params": [],
|
|
|
|
"result": {
|
|
|
|
"name": "ListWallets result",
|
|
|
|
"value": [
|
|
|
|
{
|
|
|
|
"birthday": 2762066,
|
|
|
|
"index": 1,
|
|
|
|
"lastSync": 2919374,
|
|
|
|
"name": "Main",
|
|
|
|
"network": "TestNet"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"birthday": 2798877,
|
|
|
|
"index": 2,
|
|
|
|
"lastSync": 2894652,
|
|
|
|
"name": "zcashd",
|
|
|
|
"network": "TestNet"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"errors": [
|
|
|
|
{ "$ref": "#/components/errors/ZebraNotAvailable" },
|
|
|
|
{ "$ref": "#/components/errors/NoWallets" }
|
|
|
|
]
|
2024-08-05 20:16:03 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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" }
|
|
|
|
]
|
2024-08-05 17:54:02 +00:00
|
|
|
}
|
|
|
|
],
|
2024-08-03 12:00:12 +00:00
|
|
|
"components": {
|
2024-08-05 20:16:03 +00:00
|
|
|
"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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-08-05 17:54:02 +00:00
|
|
|
"schemas": {
|
|
|
|
"ZenithInfo": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"version": { "type": "string", "description": "Zenith's version"},
|
|
|
|
"network": { "type": "string", "description": "The network the wallet is connected to"},
|
|
|
|
"zebraVersion": { "type": "string", "description": "The version of the Zebra node used by Zenith"}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"ZcashWallet": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"index": { "type": "integer", "description": "Internal index of wallet"},
|
|
|
|
"name": { "type": "string", "description": "User-friendly name of the wallet" },
|
|
|
|
"network": { "type": "string", "description": "Network the wallet is for. Testnet or MainNet" },
|
|
|
|
"birthday": { "type": "integer", "description": "Wallet's birthday height" },
|
|
|
|
"lastSync": { "type": "integer", "description": "Last block the wallet is synced to" }
|
|
|
|
}
|
2024-08-05 20:16:03 +00:00
|
|
|
},
|
|
|
|
"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"}
|
|
|
|
}
|
2024-08-05 17:54:02 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"examples": {},
|
|
|
|
"tags": {
|
|
|
|
"information": {"name": "Information"},
|
|
|
|
"wallet": {"name": "Wallet"}
|
|
|
|
},
|
|
|
|
"errors": {
|
|
|
|
"ZebraNotAvailable": {
|
|
|
|
"code": -32000,
|
|
|
|
"message": "Zebra not available"
|
|
|
|
},
|
|
|
|
"NoWallets": {
|
|
|
|
"code": -32001,
|
|
|
|
"message": "No wallets available. Please create one first"
|
2024-08-05 20:16:03 +00:00
|
|
|
},
|
|
|
|
"NoAccounts": {
|
|
|
|
"code": -32002,
|
|
|
|
"message": "No accounts available. Please create one first"
|
2024-08-05 17:54:02 +00:00
|
|
|
}
|
|
|
|
}
|
2024-08-03 12:00:12 +00:00
|
|
|
}
|
|
|
|
}
|