Skip to content

Commit a5a521e

Browse files
committed
Merge pull request #6154
b448002 [Docs] fix and improve REST documentation (Jonas Schnelli)
2 parents 26e08a1 + b448002 commit a5a521e

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

doc/REST-interface.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ Supported API
77
-------------
88

99
####Transactions
10-
`GET /rest/tx/TX-HASH.{bin|hex|json}`
10+
`GET /rest/tx/<TX-HASH>.<bin|hex|json>`
1111

1212
Given a transaction hash,
1313
Returns a transaction, in binary, hex-encoded binary or JSON formats.
1414

1515
For full TX query capability, one must enable the transaction index via "txindex=1" command line / configuration option.
1616

1717
####Blocks
18-
`GET /rest/block/BLOCK-HASH.{bin|hex|json}`
19-
`GET /rest/block/notxdetails/BLOCK-HASH.{bin|hex|json}`
18+
`GET /rest/block/<BLOCK-HASH>.<bin|hex|json>`
19+
`GET /rest/block/notxdetails/<BLOCK-HASH>.<bin|hex|json>`
2020

2121
Given a block hash,
2222
Returns a block, in binary, hex-encoded binary or JSON formats.
@@ -46,12 +46,38 @@ Only supports JSON as output format.
4646
* verificationprogress : (numeric) estimate of verification progress [0..1]
4747
* chainwork : (string) total amount of work in active chain, in hexadecimal
4848

49-
`GET /rest/getutxos`
49+
####Query UTXO set
50+
`GET /rest/getutxos.<bin|hex|json>`
5051

51-
The getutxo command allows querying of the UTXO set given a set of of outpoints.
52+
The getutxo command allows querying of the UTXO set given a set of outpoints.
5253
See BIP64 for input and output serialisation:
5354
https://github.com/bitcoin/bips/blob/master/bip-0064.mediawiki
5455

56+
Example:
57+
```
58+
$ curl --data '{"checkmempool":true,"outpoints":[{"txid":"b2cdfd7b89def827ff8af7cd9bff7627ff72e5e8b0f71210f92ea7a4000c5d75","n":0}]}' localhost:18332/rest/getutxos.json 2>/dev/null | json_pp
59+
{
60+
"chaintipHash" : "00000000fb01a7f3745a717f8caebee056c484e6e0bfe4a9591c235bb70506fb",
61+
"chainHeight" : 325347,
62+
"utxos" : [
63+
{
64+
"scriptPubKey" : {
65+
"addresses" : [
66+
"mi7as51dvLJsizWnTMurtRmrP8hG2m1XvD"
67+
],
68+
"type" : "pubkeyhash",
69+
"hex" : "76a9141c7cebb529b86a04c683dfa87be49de35bcf589e88ac",
70+
"reqSigs" : 1,
71+
"asm" : "OP_DUP OP_HASH160 1c7cebb529b86a04c683dfa87be49de35bcf589e OP_EQUALVERIFY OP_CHECKSIG"
72+
},
73+
"value" : 8.8687,
74+
"height" : 2147483647,
75+
"txvers" : 1
76+
}
77+
],
78+
"bitmap" : "1"
79+
}
80+
```
5581

5682
Risks
5783
-------------

0 commit comments

Comments
 (0)