zebra/openapi.yaml

1122 lines
32 KiB
YAML
Raw Permalink Normal View History

openapi: 3.0.3
info:
title: Swagger Zebra API - OpenAPI 3.0
version: 0.0.1
description: |-
This is the Zebra API. It is a JSON-RPC 2.0 API that allows you to interact with the Zebra node.
Useful links:
- [The Zebra repository](https://github.com/ZcashFoundation/zebra)
- [The latests API spec](https://github.com/ZcashFoundation/zebra/blob/main/openapi.yaml)
servers:
- url: http://localhost:8232
paths:
2024-08-20 10:43:37 -07:00
/getinfo:
post:
tags:
- control
description: Returns software information from the RPC server, as a [`GetInfo`] JSON struct.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
method:
type: string
default: getinfo
2024-08-20 15:13:34 -07:00
id:
type: string
default: uf2E54tQkk
2024-08-20 10:43:37 -07:00
params:
type: array
items: {}
default: '[]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
default: '{"build":"some build version","subversion":"some subversion"}'
2024-08-20 15:13:34 -07:00
/getblockchaininfo:
post:
tags:
- blockchain
2024-08-20 15:13:34 -07:00
description: Returns blockchain state information, as a [`GetBlockChainInfo`] JSON struct.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
method:
type: string
2024-08-20 15:13:34 -07:00
default: getblockchaininfo
id:
type: string
default: Sbre3vivr8
params:
type: array
items: {}
default: '[]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '{"chain":"main","blocks":1,"bestblockhash":"0000000000000000000000000000000000000000000000000000000000000000","estimatedheight":1,"valuePools":[{"id":"transparent","chainValue":0.0,"chainValueZat":0},{"id":"sprout","chainValue":0.0,"chainValueZat":0},{"id":"sapling","chainValue":0.0,"chainValueZat":0},{"id":"orchard","chainValue":0.0,"chainValueZat":0},{"id":"deferred","chainValue":0.0,"chainValueZat":0}],"upgrades":{},"consensus":{"chaintip":"00000000","nextblock":"00000000"}}'
/getaddressbalance:
post:
tags:
- address
description: |-
2024-08-20 15:13:34 -07:00
Returns the total balance of a provided `addresses` in an [`AddressBalance`] instance.
**Request body `params` arguments:**
2024-08-20 15:13:34 -07:00
- `address_strings` - A JSON map with a single entry
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
method:
type: string
2024-08-20 15:13:34 -07:00
default: getaddressbalance
id:
type: string
default: f5qarOBgzK
params:
type: array
items: {}
2024-08-20 15:13:34 -07:00
default: '[{"addresses": ["tmYXBYJj1K7vhejSec5osXK2QsGa5MTisUQ"]}]'
responses:
2024-08-20 15:13:34 -07:00
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
2024-08-20 15:13:34 -07:00
result:
type: object
default: '{"balance":0}'
'400':
description: Bad request
content:
application/json:
schema:
type: object
properties:
2024-08-20 15:13:34 -07:00
error:
type: string
default: Invalid parameters
/sendrawtransaction:
post:
tags:
2024-08-20 15:13:34 -07:00
- transaction
description: |-
Sends the raw bytes of a signed transaction to the local node''s mempool, if the transaction is valid.
**Request body `params` arguments:**
- `raw_transaction_hex` - The hex-encoded raw transaction bytes.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
method:
type: string
2024-08-20 15:13:34 -07:00
default: sendrawtransaction
id:
type: string
default: IlNHvAcSMS
2024-08-20 15:13:34 -07:00
params:
type: array
items: {}
default: '["signedhex"]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '"0000000000000000000000000000000000000000000000000000000000000000"'
'400':
description: Bad request
content:
application/json:
schema:
type: object
properties:
error:
type: string
default: Invalid parameters
/getblock:
post:
tags:
2024-08-20 15:13:34 -07:00
- blockchain
description: |-
2024-08-20 15:13:34 -07:00
Returns the requested block by hash or height, as a [`GetBlock`] JSON string.
**Request body `params` arguments:**
2024-08-20 15:13:34 -07:00
- `hash_or_height` - The hash or height for the block to be returned.
- `verbosity` - 0 for hex encoded data, 1 for a json object, and 2 for json object with transaction data.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
method:
type: string
2024-08-20 15:13:34 -07:00
default: getblock
id:
type: string
default: s9678BM3Lc
2024-08-20 10:43:37 -07:00
params:
type: array
items: {}
2024-08-20 15:13:34 -07:00
default: '["1", 1]'
responses:
2024-08-20 10:43:37 -07:00
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
2024-08-20 10:43:37 -07:00
result:
type: object
2024-08-20 15:13:34 -07:00
default: '{"hash":"0000000000000000000000000000000000000000000000000000000000000000","confirmations":0,"tx":[],"trees":{}}'
2024-08-20 10:43:37 -07:00
'400':
description: Bad request
content:
application/json:
schema:
type: object
properties:
2024-08-20 10:43:37 -07:00
error:
type: string
default: Invalid parameters
2024-08-20 15:13:34 -07:00
/getbestblockhash:
post:
tags:
2024-08-20 10:43:37 -07:00
- blockchain
2024-08-20 15:13:34 -07:00
description: Returns the hash of the current best blockchain tip block, as a [`GetBlockHash`] JSON string.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
method:
type: string
2024-08-20 15:13:34 -07:00
default: getbestblockhash
id:
type: string
default: FGQPJY8Tp8
params:
type: array
items: {}
default: '[]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '"0000000000000000000000000000000000000000000000000000000000000000"'
/getbestblockheightandhash:
post:
tags:
- blockchain
2024-08-20 15:13:34 -07:00
description: Returns the height and hash of the current best blockchain tip block, as a [`GetBlockHeightAndHash`] JSON struct.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
method:
type: string
2024-08-20 15:13:34 -07:00
default: getbestblockheightandhash
2024-08-20 10:43:37 -07:00
id:
type: string
default: c2MfkL7xP9
2024-08-20 15:13:34 -07:00
params:
type: array
items: {}
default: '[]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '{}'
/getrawmempool:
post:
tags:
2024-08-20 15:13:34 -07:00
- blockchain
description: Returns all transaction ids in the memory pool, as a JSON array.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
method:
type: string
2024-08-20 15:13:34 -07:00
default: getrawmempool
id:
type: string
default: BugnNFhJpA
2024-08-20 15:13:34 -07:00
params:
type: array
items: {}
default: '[]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '[]'
/z_gettreestate:
post:
tags:
2024-08-20 15:13:34 -07:00
- blockchain
2024-08-20 10:43:37 -07:00
description: |-
2024-08-20 15:13:34 -07:00
Returns information about the given block''s Sapling & Orchard tree state.
2024-08-20 10:43:37 -07:00
**Request body `params` arguments:**
2024-08-20 15:13:34 -07:00
- `hash | height` - The block hash or height.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
2024-08-20 15:13:34 -07:00
method:
type: string
default: z_gettreestate
id:
type: string
default: fCUQvR1BVa
params:
type: array
items: {}
2024-08-20 15:13:34 -07:00
default: '["00000000febc373a1da2bd9f887b105ad79ddc26ac26c2b28652d64e5207c5b5"]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '{"hash":"0000000000000000000000000000000000000000000000000000000000000000","height":0,"time":0}'
'400':
description: Bad request
content:
application/json:
schema:
type: object
properties:
error:
type: string
default: Invalid parameters
/z_getsubtreesbyindex:
post:
tags:
2024-08-20 15:13:34 -07:00
- blockchain
description: |-
Returns information about a range of Sapling or Orchard subtrees.
**Request body `params` arguments:**
- `pool` - The pool from which subtrees should be returned. Either \"sapling\" or \"orchard\".
- `start_index` - The index of the first 2^16-leaf subtree to return.
- `limit` - The maximum number of subtree values to return.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
2024-08-20 15:13:34 -07:00
method:
type: string
default: z_getsubtreesbyindex
2024-08-20 10:43:37 -07:00
id:
type: string
default: TtPnptV6EU
params:
type: array
items: {}
default: '[]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '{"pool":"sapling | orchard","start_index":0,"subtrees":[]}'
/getrawtransaction:
post:
tags:
2024-08-20 15:13:34 -07:00
- transaction
description: |-
2024-08-20 15:13:34 -07:00
Returns the raw transaction data, as a [`GetRawTransaction`] JSON string or structure.
**Request body `params` arguments:**
2024-08-20 15:13:34 -07:00
- `txid` - The transaction ID of the transaction to be returned.
- `verbose` - If 0, return a string of hex-encoded data, otherwise return a JSON object.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
2024-08-20 10:43:37 -07:00
method:
type: string
2024-08-20 15:13:34 -07:00
default: getrawtransaction
2024-08-20 10:43:37 -07:00
id:
type: string
default: QqYeOGSzje
params:
type: array
items: {}
2024-08-20 15:13:34 -07:00
default: '["mytxid", 1]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '{"hex":"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","height":0,"confirmations":0}'
'400':
description: Bad request
content:
application/json:
schema:
type: object
properties:
error:
type: string
default: Invalid parameters
/getaddresstxids:
post:
tags:
- address
description: |-
Returns the transaction ids made by the provided transparent addresses.
2024-08-20 10:43:37 -07:00
**Request body `params` arguments:**
2024-08-20 15:13:34 -07:00
- `request` - A struct with the following named fields:
2024-08-20 10:43:37 -07:00
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
method:
type: string
2024-08-20 15:13:34 -07:00
default: getaddresstxids
2024-08-20 10:43:37 -07:00
id:
type: string
default: AsWWVyqp8x
2024-08-20 10:43:37 -07:00
params:
type: array
items: {}
2024-08-20 15:13:34 -07:00
default: '[{"addresses": ["tmYXBYJj1K7vhejSec5osXK2QsGa5MTisUQ"], "start": 1000, "end": 2000}]'
2024-08-20 10:43:37 -07:00
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
2024-08-20 10:43:37 -07:00
result:
type: object
2024-08-20 15:13:34 -07:00
default: '[]'
'400':
description: Bad request
content:
application/json:
schema:
type: object
properties:
error:
type: string
default: Invalid parameters
/getaddressutxos:
post:
tags:
2024-08-20 15:13:34 -07:00
- address
description: |-
Returns all unspent outputs for a list of addresses.
**Request body `params` arguments:**
- `addresses` - The addresses to get outputs from.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
2024-08-20 15:13:34 -07:00
method:
type: string
default: getaddressutxos
2024-08-20 10:43:37 -07:00
id:
type: string
default: Qscn5dUFgD
params:
type: array
items: {}
2024-08-20 15:13:34 -07:00
default: '[{"addresses": ["tmYXBYJj1K7vhejSec5osXK2QsGa5MTisUQ"]}]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '{"address":"t1Hsc1LR8yKnbbe3twRp88p6vFfC5t7DLbs","txid":"0000000000000000000000000000000000000000000000000000000000000000","outputIndex":0,"script":"00000000000000000000","satoshis":0,"height":0}'
'400':
description: Bad request
content:
application/json:
schema:
type: object
properties:
error:
type: string
default: Invalid parameters
/stop:
post:
tags:
- control
description: Stop the running zebrad process.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
method:
type: string
default: stop
id:
type: string
default: WuIaPXV5fO
params:
type: array
items: {}
default: '[]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
default: 'null'
2024-08-20 10:43:37 -07:00
/getblockcount:
post:
tags:
2024-08-20 10:43:37 -07:00
- blockchain
description: Returns the height of the most recent block in the best valid block chain (equivalently,
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
2024-08-20 10:43:37 -07:00
method:
type: string
default: getblockcount
2024-08-20 15:13:34 -07:00
id:
type: string
default: '5F9M7Wp0oI'
params:
type: array
items: {}
default: '[]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 10:43:37 -07:00
default: '0'
2024-08-20 15:13:34 -07:00
/getblockhash:
post:
tags:
2024-08-20 15:13:34 -07:00
- blockchain
description: |-
2024-08-20 15:13:34 -07:00
Returns the hash of the block of a given height iff the index argument correspond
**Request body `params` arguments:**
2024-08-20 15:13:34 -07:00
- `index` - The block index.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
2024-08-20 15:13:34 -07:00
method:
type: string
default: getblockhash
id:
type: string
default: f7hdgVjctr
params:
type: array
items: {}
2024-08-20 15:13:34 -07:00
default: '[1]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '"0000000000000000000000000000000000000000000000000000000000000000"'
'400':
description: Bad request
content:
application/json:
schema:
type: object
properties:
error:
type: string
default: Invalid parameters
/getblocktemplate:
post:
tags:
2024-08-20 10:43:37 -07:00
- mining
description: |-
2024-08-20 15:13:34 -07:00
Returns a block template for mining new Zcash blocks.
2024-08-20 10:43:37 -07:00
**Request body `params` arguments:**
2024-08-20 15:13:34 -07:00
- `jsonrequestobject` - A JSON object containing arguments.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
2024-08-20 15:13:34 -07:00
method:
type: string
default: getblocktemplate
2024-08-20 10:43:37 -07:00
id:
type: string
default: pq0uXn3YGs
params:
type: array
items: {}
default: '[]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '{}'
/submitblock:
post:
tags:
2024-08-20 15:13:34 -07:00
- mining
description: |-
2024-08-20 15:13:34 -07:00
Submits block to the node to be validated and committed.
**Request body `params` arguments:**
2024-08-20 15:13:34 -07:00
- `jsonparametersobject` - - currently ignored
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
2024-08-20 15:13:34 -07:00
method:
type: string
default: submitblock
id:
type: string
default: bs4v4JmVw3
2024-08-20 10:43:37 -07:00
params:
type: array
items: {}
default: '[]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '"rejected"'
/getmininginfo:
post:
tags:
2024-08-20 15:13:34 -07:00
- mining
description: Returns mining-related information.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
method:
type: string
2024-08-20 15:13:34 -07:00
default: getmininginfo
2024-08-20 10:43:37 -07:00
id:
type: string
default: pp5xV6v3pm
2024-08-20 15:13:34 -07:00
params:
type: array
items: {}
default: '[]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
default: '{"blocks":0,"networksolps":0,"networkhashps":0,"chain":"","testnet":false}'
2024-08-20 15:13:34 -07:00
/getnetworksolps:
post:
tags:
- mining
2024-08-20 15:13:34 -07:00
description: Returns the estimated network solutions per second based on the last `num_blocks` before
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
2024-08-20 15:13:34 -07:00
method:
type: string
default: getnetworksolps
2024-08-20 10:43:37 -07:00
id:
type: string
default: '7bU98TeCV6'
params:
type: array
items: {}
2024-08-20 15:13:34 -07:00
default: '[]'
responses:
2024-08-20 10:43:37 -07:00
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '0'
/getnetworkhashps:
post:
tags:
2024-08-20 15:13:34 -07:00
- mining
description: Returns the estimated network solutions per second based on the last `num_blocks` before
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
2024-08-20 10:43:37 -07:00
method:
type: string
2024-08-20 15:13:34 -07:00
default: getnetworkhashps
id:
type: string
default: fskOJeXqjo
params:
type: array
items: {}
default: '[]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '0'
/getpeerinfo:
post:
tags:
2024-08-20 15:13:34 -07:00
- network
description: Returns data about each connected network node.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
method:
type: string
2024-08-20 15:13:34 -07:00
default: getpeerinfo
id:
type: string
default: jPV8ufjDdt
params:
type: array
items: {}
2024-08-20 15:13:34 -07:00
default: '[]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '{"addr":"0.0.0.0:0"}'
/validateaddress:
post:
tags:
2024-08-20 15:13:34 -07:00
- util
description: |-
2024-08-20 15:13:34 -07:00
Checks if a zcash address is valid.
**Request body `params` arguments:**
2024-08-20 15:13:34 -07:00
- `address` - The zcash address to validate.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
2024-08-20 10:43:37 -07:00
method:
type: string
2024-08-20 15:13:34 -07:00
default: validateaddress
2024-08-20 10:43:37 -07:00
id:
type: string
default: xOyxICseV9
2024-08-20 15:13:34 -07:00
params:
type: array
items: {}
default: '[]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '{"isvalid":false}'
/z_validateaddress:
post:
tags:
2024-08-20 15:13:34 -07:00
- util
description: |-
Checks if a zcash address is valid.
**Request body `params` arguments:**
- `address` - The zcash address to validate.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
method:
type: string
2024-08-20 15:13:34 -07:00
default: z_validateaddress
id:
type: string
default: xa6PoC4uN6
params:
type: array
items: {}
default: '[]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '{"isvalid":false}'
/getblocksubsidy:
post:
tags:
2024-08-20 15:13:34 -07:00
- mining
2024-08-20 10:43:37 -07:00
description: |-
2024-08-20 15:13:34 -07:00
Returns the block subsidy reward of the block at `height`, taking into account the mining slow start.
2024-08-20 10:43:37 -07:00
**Request body `params` arguments:**
2024-08-20 15:13:34 -07:00
- `height` - Can be any valid current or future height.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
2024-08-20 10:43:37 -07:00
method:
type: string
2024-08-20 15:13:34 -07:00
default: getblocksubsidy
id:
type: string
default: vYEVtnVK9o
params:
type: array
items: {}
2024-08-20 15:13:34 -07:00
default: '[1]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '{"miner":0.0,"founders":0.0,"fundingstreamstotal":0.0,"lockboxtotal":0.0,"totalblocksubsidy":0.0}'
2024-08-20 10:43:37 -07:00
'400':
description: Bad request
content:
application/json:
schema:
type: object
properties:
error:
type: string
default: Invalid parameters
2024-08-20 15:13:34 -07:00
/getdifficulty:
post:
tags:
2024-08-20 15:13:34 -07:00
- blockchain
description: Returns the proof-of-work difficulty as a multiple of the minimum difficulty.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
method:
type: string
2024-08-20 15:13:34 -07:00
default: getdifficulty
id:
type: string
default: tVzSTZu2sD
2024-08-20 10:43:37 -07:00
params:
type: array
items: {}
2024-08-20 15:13:34 -07:00
default: '[]'
responses:
2024-08-20 15:13:34 -07:00
'200':
description: OK
2024-08-20 10:43:37 -07:00
content:
application/json:
schema:
type: object
properties:
2024-08-20 15:13:34 -07:00
result:
type: object
default: '0.0'
/z_listunifiedreceivers:
post:
tags:
- wallet
description: |-
Returns the list of individual payment addresses given a unified address.
**Request body `params` arguments:**
- `address` - The zcash unified address to get the list from.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
method:
type: string
default: z_listunifiedreceivers
id:
type: string
default: le2NmJBmPt
2024-08-20 15:13:34 -07:00
params:
type: array
items: {}
default: '[]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
2024-08-20 15:13:34 -07:00
default: '{"orchard":"orchard address if any","sapling":"sapling address if any","p2pkh":"p2pkh address if any","p2sh":"p2sh address if any"}'
/generate:
post:
tags:
- generating
description: |-
Mine blocks immediately. Returns the block hashes of the generated blocks.
**Request body `params` arguments:**
- `num_blocks` - Number of blocks to be generated.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
method:
type: string
default: generate
id:
type: string
default: vVVOWxHqlN
params:
type: array
items: {}
default: '[1]'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: object
default: '{}'
'400':
description: Bad request
content:
application/json:
schema:
type: object
properties:
error:
type: string
default: Invalid parameters