UNPKG

opnet

Version:

The perfect library for building Bitcoin-based applications.

17 lines (16 loc) 440 B
import { script } from '@btc-vision/bitcoin'; export class TransactionOutput { value; index; scriptPubKey; script; constructor(data) { this.value = this.convertValue(data.value); this.index = data.index; this.scriptPubKey = data.scriptPubKey; this.script = script.decompile(Buffer.from(this.scriptPubKey.hex, 'hex')); } convertValue(value) { return BigInt(value); } }