JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q54031F
  • License ISC

UTXO derivation from a list of transactions

Package Exports

  • utxo

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (utxo) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

utxo

TRAVIS NPM

js-standard-style

Example

let utxo = require('utxo')
let transactions = {
    "2c20ca6ca3a2af32d3ca0c6c1a60f6d3c00101342620a21f3622fc6faf2ddcda": {
        "inputs": [
            {
                "txId": "xxx ...",
                "vout": 0
            },
            {
                "txId": "xxx ...",
                "vout": 1
            }
        ],
        "outputs": [
            { "script": "..." }
        ]
    },
    "bdcdd2fafa1c6c0ac3d23fa2a3ac66cf2263f12a03444310100c3d6c06ac02c3": {
        "inputs": [
            {
                "txId": "2c20ca6ca3a2af32d3ca0c6c1a60f6d3c00101342620a21f3622fc6faf2ddcda"
                "vout": 0
            },
            ...
        ],
        // and so on
    }
}

// equates all transaction outputs for where no matching input exists
// subsequent double spends are ignored in the returned result, with priority given to first-seen
// txId and vout is extended onto the outputs for convenience (outputs are copied, not mutated)
let unspents = utxo(transactions)
[{
    "txId": "2c20ca6ca3a2af32d3ca0c6c1a60f6d3c00101342620a21f3622fc6faf2ddcda",
    "vout": 0,
    "script": "..."
}, ...]

LICENSE MIT