zenith/zenith-openrpc.json

386 lines
13 KiB
JSON
Raw Normal View History

2024-08-03 12:00:12 +00:00
{
"openrpc": "1.0.0-rc1",
"info": {
2024-08-06 21:08:26 +00:00
"version": "0.7.0.0-beta",
2024-08-03 12:00:12 +00:00
"title": "Zenith RPC",
"description": "The RPC methods to interact with the Zenith Zcash wallet",
"license": {
2024-08-06 21:08:26 +00:00
"name": "MIT",
"url": "https://choosealicense.com/licenses/mit/"
2024-08-03 12:00:12 +00:00
}
},
"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",
2024-08-05 20:44:11 +00:00
"summary": "Get basic Zenith information",
"description": "Get basic information about Zenith, such as the network it is running on and the version of Zebra it is connected to",
2024-08-06 18:38:00 +00:00
"tags": [],
2024-08-05 17:54:02 +00:00
"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",
2024-08-05 20:44:11 +00:00
"summary": "Get the list of available wallets",
"description": "Returns a list of available wallets per the network that the Zebra node is running on.",
2024-08-06 18:38:00 +00:00
"tags": [],
2024-08-05 17:54:02 +00:00
"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
},
2024-08-07 16:57:10 +00:00
{
"name": "getnewwallet",
2024-08-07 16:57:10 +00:00
"summary": "Create a new wallet",
"description": "Create a new wallet for Zenith.",
"tags": [{"$ref": "#/components/tags/draft"}],
"params": [],
"result": {}
},
2024-08-05 20:16:03 +00:00
{
"name": "listaccounts",
2024-08-06 18:38:00 +00:00
"summary": "List existing accounts for a wallet ID",
2024-08-05 20:44:11 +00:00
"description": "List existing accounts for the given wallet ID or provide an error if none",
2024-08-06 18:38:00 +00:00
"tags": [],
2024-08-05 20:16:03 +00:00
"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": [
2024-08-06 18:38:00 +00:00
{
"index": 3,
"name": "Business",
"wallet": 1
},
{
"index": 1,
"name": "Savings",
"wallet": 1
}
2024-08-05 20:16:03 +00:00
]
}
}
],
"errors": [
{ "$ref": "#/components/errors/ZebraNotAvailable" },
{ "$ref": "#/components/errors/NoAccounts" }
]
2024-08-06 21:08:26 +00:00
},
2024-08-07 16:57:10 +00:00
{
"name": "getnewaccount",
2024-08-07 16:57:10 +00:00
"summary": "Create a new account",
"description": "Create a new account in the given wallet.",
"tags": [{"$ref": "#/components/tags/draft"}],
"params": [],
"result": {}
},
2024-08-06 21:08:26 +00:00
{
"name": "listaddresses",
"summary": "List existing addresses for an account ID",
"description": "List existing addresses for the given account ID or provide an error if none",
2024-08-07 15:21:04 +00:00
"tags": [],
2024-08-06 21:08:26 +00:00
"result": {
"name": "Addresses",
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ZcashAddress"
}
}
},
"params": [{ "$ref": "#/components/contentDescriptors/AccountId"}],
"paramStructure": "by-position",
"examples": [
{
"name": "ListAddresses example",
"summary": "Get list of addresses",
"description": "Get the list of addresses available in Zenith for the given wallet ID",
"params": [
{
"name": "accountId",
"summary": "The integer ID of the account to use",
"value": 1
}
],
"result": {
"name": "ListAddresses result",
"value": [
2024-08-07 15:21:04 +00:00
{
"index": 3,
"account": 1,
"name": "Clothes",
"ua": "utest13dq4u4dnf3yddw8lq2n6zdclshra6xsp8zgkc5ydyu6k20zrsscmuex46qa4vh84rgd78sqnlleapznnz7mnzx9wv0unts8pv32paj8se5ca3kves2u4a89uy6e8cf4hnarxydxh7hq2e9uu39punfmm53k5h45xn9k3dx35la8j7munh9td7774m8gkqgc4mn40t69w20uu2gtks7a",
"legacy": "ztestsapling188csdsvhdny25am8ume03qr2026hdy03zpg5pq7jmmfxtxtct0e93p0rg80yfxvynqd4gwlwft5",
"transparent": "tmMouLwVfRYrF91fWjDJToivmsTWBhxfX4E"
},
{
"index": 2,
"account": 1,
"name": "Vacation",
"ua": "utest1hhggl4nxfdx63evps6r7qz50cgacgtdpt9k7dl0734w63zn5qmrp6c2xdv9rkqyfkj6kgau4kz48xtm80e67l534qp02teqq86zuzetxql6z5v32yglg9n2un5zsu0hwcvaunzdfg5qnry6syh2dh9x8eu27de03j9pjfvrqda6acgtc6f0emdfh6r5jvfanmjml4ms5wwj9wfqmamq",
"legacy": "ztestsapling1mpup3xv2k9clxaf9wjcr0dt5gnmkprz9s9qsn298mqs356pf39wmh30q3pgsp0w5vyrmj6mrzw2",
"transparent": "tmX8qCB96Dq49YZkww3bSty7eZDA4Fq6F4R"
}
2024-08-06 21:08:26 +00:00
]
}
}
],
"errors": [
{ "$ref": "#/components/errors/NoAddress" }
]
2024-08-07 16:57:10 +00:00
},
{
"name": "getnewaddress",
2024-08-07 16:57:10 +00:00
"summary": "Add a new address",
"description": "Derive a new address in the given account.",
"tags": [{"$ref": "#/components/tags/draft"}],
"params": [],
"result": {}
},
{
"name": "getbalance",
"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"}],
"params": [],
"result": {}
},
{
"name": "listreceived",
"summary": "List received transactions",
"description": "List transactions received by the given address.",
2024-08-08 14:20:35 +00:00
"tags": [{"$ref": "#/components/tags/draft"}, {"$ref": "#/components/tags/wip"}],
"params": [{ "$ref": "#/components/contentDescriptors/Address"}],
"paramStructure": "by-position",
"result": {
"name": "Transactions",
"schema": {
"type": "array",
"items": {
2024-08-08 14:22:37 +00:00
"$ref": "#/components/schemas/ZcashNote"
2024-08-08 14:20:35 +00:00
}
}
}
2024-08-07 16:57:10 +00:00
},
{
"name": "sendmany",
"summary": "Send transaction(s)",
"description": "Send one or more transactions ",
"tags": [{"$ref": "#/components/tags/draft"}],
"params": [],
"result": {}
},
{
"name": "getoperationstatus",
"summary": "Get the status of a Zenith operation",
"description": "Get the status of the given operation",
"tags": [{"$ref": "#/components/tags/draft"}],
"params": [],
"result": {}
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-06 21:08:26 +00:00
},
"AccountId": {
"name": "Account ID",
"summary": "The account's internal index used for unique identification",
"description": "An Integer value that uniquely identifies an account in Zenith",
"required": true,
"schema": {
"type": "integer"
}
2024-08-08 14:20:35 +00:00
},
"Address": {
"name": "Address identifier",
"summary": "The address identifier",
"description": "A string that identifies a specific address, either by its index or the address itself",
"required": true,
"schema": {
"type": "string"
}
2024-08-05 20:16:03 +00:00
}
},
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-06 21:08:26 +00:00
},
"ZcashAddress": {
"type": "object",
"properties": {
"index": { "type": "integer", "description": "Internal index for address"},
"account": { "type": "integer", "description": "ID of the account this address belongs to"},
"name": { "type": "string", "description": "User-friendly name of the address"},
"ua": { "type": "string", "description": "Unified address"},
"legacy": { "type": "string", "description": "Legacy Sapling address"},
"transparent": { "type": "string", "description": "Transparent address"}
}
2024-08-08 14:20:35 +00:00
},
"ZcashNote": {
"type": "object",
"properties": {
"txid": { "type": "string", "description": "Transaction ID"},
"pool": { "type": "string", "description": "Orchard, Sapling, or Transparent" },
"amount" : { "type": "number", "description": "The amount of the note in ZEC"},
"amountZats": { "type": "integer", "description": "The amount of the note in zats"},
"memo": { "type": "string", "description": "The memo corresponding to the note, if any"},
"confirmed": { "type": "boolean", "description": "If the note is confirmed per the thresholds in the configuration"},
"blockheight": { "type": "integer", "description": "The block height containing the transaction"},
"blocktime": { "type": "integer", "description": "The transaction time in seconds since epoch"},
"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"}
}
2024-08-05 17:54:02 +00:00
}
},
"examples": {},
"tags": {
2024-08-08 14:20:35 +00:00
"draft": {"name": "Draft"},
"wip": {"name": "WIP"}
2024-08-05 17:54:02 +00:00
},
"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-06 21:08:26 +00:00
},
"NoAddress": {
"code": -32003,
"message": "No addresses available for this account. Please create one first"
2024-08-08 14:20:35 +00:00
},
"UnknownAddress": {
"code": -32004,
"message": "Address does not belong to the wallet"
2024-08-05 17:54:02 +00:00
}
}
2024-08-03 12:00:12 +00:00
}
}