aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/REST-interface.md36
1 files changed, 31 insertions, 5 deletions
diff --git a/doc/REST-interface.md b/doc/REST-interface.md
index 11af040ad2..0b718d664e 100644
--- a/doc/REST-interface.md
+++ b/doc/REST-interface.md
@@ -7,7 +7,7 @@ Supported API
-------------
####Transactions
-`GET /rest/tx/TX-HASH.{bin|hex|json}`
+`GET /rest/tx/<TX-HASH>.<bin|hex|json>`
Given a transaction hash,
Returns a transaction, in binary, hex-encoded binary or JSON formats.
@@ -15,8 +15,8 @@ Returns a transaction, in binary, hex-encoded binary or JSON formats.
For full TX query capability, one must enable the transaction index via "txindex=1" command line / configuration option.
####Blocks
-`GET /rest/block/BLOCK-HASH.{bin|hex|json}`
-`GET /rest/block/notxdetails/BLOCK-HASH.{bin|hex|json}`
+`GET /rest/block/<BLOCK-HASH>.<bin|hex|json>`
+`GET /rest/block/notxdetails/<BLOCK-HASH>.<bin|hex|json>`
Given a block hash,
Returns a block, in binary, hex-encoded binary or JSON formats.
@@ -46,12 +46,38 @@ Only supports JSON as output format.
* verificationprogress : (numeric) estimate of verification progress [0..1]
* chainwork : (string) total amount of work in active chain, in hexadecimal
-`GET /rest/getutxos`
+####Query UTXO set
+`GET /rest/getutxos.<bin|hex|json>`
-The getutxo command allows querying of the UTXO set given a set of of outpoints.
+The getutxo command allows querying of the UTXO set given a set of outpoints.
See BIP64 for input and output serialisation:
https://github.com/bitcoin/bips/blob/master/bip-0064.mediawiki
+Example:
+```
+$ curl --data '{"checkmempool":true,"outpoints":[{"txid":"b2cdfd7b89def827ff8af7cd9bff7627ff72e5e8b0f71210f92ea7a4000c5d75","n":0}]}' localhost:18332/rest/getutxos.json 2>/dev/null | json_pp
+{
+ "chaintipHash" : "00000000fb01a7f3745a717f8caebee056c484e6e0bfe4a9591c235bb70506fb",
+ "chainHeight" : 325347,
+ "utxos" : [
+ {
+ "scriptPubKey" : {
+ "addresses" : [
+ "mi7as51dvLJsizWnTMurtRmrP8hG2m1XvD"
+ ],
+ "type" : "pubkeyhash",
+ "hex" : "76a9141c7cebb529b86a04c683dfa87be49de35bcf589e88ac",
+ "reqSigs" : 1,
+ "asm" : "OP_DUP OP_HASH160 1c7cebb529b86a04c683dfa87be49de35bcf589e OP_EQUALVERIFY OP_CHECKSIG"
+ },
+ "value" : 8.8687,
+ "height" : 2147483647,
+ "txvers" : 1
+ }
+ ],
+ "bitmap" : "1"
+}
+```
Risks
-------------