scantxoutset
scantxoutset “action” ( [scanobjects,…] )
Scans the unspent transaction output set for entries that match certain output descriptors. Examples of output descriptors are: addr(
) Outputs whose scriptPubKey corresponds to the specified address (does not include P2PK) raw(In the above,
Arguments:
- action (string, required) The action to execute “start” for starting a scan “abort” for aborting the current scan (returns true when abort was successful) “status” for progress report (in %) of the current scan
- scanobjects (json array) Array of scan objects. Required for “start” action Every scan object is either a string descriptor or an object: [ “descriptor”, (string) An output descriptor { (json object) An object with output descriptor and metadata “desc”: “str”, (string, required) An output descriptor “range”: n or [n,n], (numeric or array, optional, default=1000) The range of HD chain indexes to explore (either end or [begin,end]) }, … ]
Result (When action==‘abort’): true|false (boolean)
Result (When action==‘status’ and no scan is in progress): null (json null)
Result (When action==‘status’ and scan is in progress): { (json object) “progress” : n (numeric) The scan progress }
Result (When action==‘start’): { (json object) “success” : true|false, (boolean) Whether the scan was completed “txouts” : n, (numeric) The number of unspent transaction outputs scanned “height” : n, (numeric) The current block height (index) “bestblock” : “hex”, (string) The hash of the block at the tip of the chain “unspents” : [ (json array) { (json object) “txid” : “hex”, (string) The transaction id “vout” : n, (numeric) The vout value “scriptPubKey” : “hex”, (string) The script key “desc” : “str”, (string) A specialized descriptor for the matched scriptPubKey “amount” : n, (numeric) The total amount in BTC of the unspent output “height” : n (numeric) Height of the unspent transaction output }, … ], “total_amount” : n (numeric) The total amount of all found unspent outputs in BTC }