Update json_rpc_api.md

Corrections suggested by @onyb https://github.com/btcsuite/btcd/pull/1608#discussion_r458363077
This commit is contained in:
qqjettkgjzhxmwj 2020-07-21 17:24:02 -03:00 committed by John C. Vernaleo
parent 3c56a6bd3a
commit 69773a7b41

View file

@ -271,7 +271,7 @@ the method name for further details such as parameter and return information.
| | |
|---|---|
|Method|getblock|
|Parameters|1. block hash (string, required) - the hash of the block<br />2. verbosity (int, optional, default=1) - specifies the block is returned as a JSON object instead of hex-encoded string<font color="orange">**This parameter is a btcd extension**</font>|
|Parameters|1. block hash (string, required) - the hash of the block<br />2. verbosity (int, optional, default=1) - Specifies whether the block data should be returned as a hex-encoded string (0), as parsed data with a slice of TXIDs (1), or as parsed data with parsed transaction data (2).
|Description|Returns information about a block given its hash.|
|Returns (verbosity=0)|`"data" (string) hex-encoded bytes of the serialized block`|
|Returns (verbosity=1)|`{ (json object)`<br />&nbsp;&nbsp;`"hash": "blockhash", (string) the hash of the block (same as provided)`<br />&nbsp;&nbsp;`"confirmations": n, (numeric) the number of confirmations`<br />&nbsp;&nbsp;`"strippedsize", n (numeric) the size of the block without witness data`<br />&nbsp;&nbsp;`"size": n, (numeric) the size of the block`<br />&nbsp;&nbsp;`"weight": n, (numeric) value of the weight metric`<br />&nbsp;&nbsp;`"height": n, (numeric) the height of the block in the block chain`<br />&nbsp;&nbsp;`"version": n, (numeric) the block version`<br />&nbsp;&nbsp;`"merkleroot": "hash", (string) root hash of the merkle tree`<br />&nbsp;&nbsp;`"tx": [ (json array of string) the transaction hashes`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"transactionhash", (string) hash of the parent transaction`<br />&nbsp;&nbsp;&nbsp;&nbsp;`...`<br />&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;`"time": n, (numeric) the block time in seconds since 1 Jan 1970 GMT`<br />&nbsp;&nbsp;`"nonce": n, (numeric) the block nonce`<br />&nbsp;&nbsp;`"bits", n, (numeric) the bits which represent the block difficulty`<br />&nbsp;&nbsp;`difficulty: n.nn, (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`<br />&nbsp;&nbsp;`"previousblockhash": "hash", (string) the hash of the previous block`<br />&nbsp;&nbsp;`"nextblockhash": "hash", (string) the hash of the next block (only if there is one)`<br />`}`|