Name: utxo
Owner: BitcoinJS
Description: null
Created: 2015-11-08 02:14:10.0
Updated: 2018-01-17 04:36:10.0
Pushed: 2017-10-18 06:48:22.0
Homepage: null
Size: 10
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
utxo = require('utxo')
transactions = {
"2c20ca6ca3a2af32d3ca0c6c1a60f6d3c00101342620a21f3622fc6faf2ddcda": {
"inputs": [
{
"txId": "xxx ...",
"vout": 0
},
{
"txId": "xxx ...",
"vout": 1
}
],
"outputs": [
{ "script": "..." }
]
},
"bdcdd2fafa1c6c0ac3d23fa2a3ac66cf2263f12a03444310100c3d6c06ac02c3": {
"inputs": [
{
"txId": "2c20ca6ca3a2af32d3ca0c6c1a60f6d3c00101342620a21f3622fc6faf2ddcda"
"vout": 0
},
...
],
// etc
}
unspents = utxo(transactions)
> [{
"txId": "2c20ca6ca3a2af32d3ca0c6c1a60f6d3c00101342620a21f3622fc6faf2ddcda",
"vout": 0,
"script": "..."
, ...]
NOTE: Any 'double spends' are ignored, with priority given to first-seen.
If .outputs
is undefined, an unspent is only { txId, vout }
.