UNPKG

@node-dlc/bitcoin

Version:
58 lines (57 loc) 1.74 kB
/// <reference types="node" /> import { StreamReader } from '@node-dlc/bufio'; import { ICloneable } from './ICloneable'; import { Script } from './Script'; import { Value } from './Value'; export declare class TxOut implements ICloneable<TxOut> { /** * Parses a TxOut from a stream and returns a new instance of TxOut * @param reader */ static parse(reader: StreamReader): TxOut; /** * Parses a hex string serialization of a transaction output. This * is a helper function instead of having to do `StreamReader.fromHex` * on a string directly. * @param hex */ static fromHex(hex: string): TxOut; /** * Value (often in satoshi or bitcoin) that will be locked into the * output using the provided scriptPubKey. The combined outputs must * be lte the combined input value for in transaction. */ value: Value; /** * The locking script used to encumbered the value in the output. * To claim these funds as an input in another transaction requires * providing a ScriptSig that successfully evaluates when combined * with the ScriptPubKey. */ scriptPubKey: Script; /** * Constructs a new TxOut from the supplied arguments * @param value * @param scriptPubKey */ constructor(value: Value, scriptPubKey: Script); /** * Returns the TxOut as a string */ toString(): string; /** * Returns the TxOut as a JSON object */ toJSON(): { value: string; scriptPubKey: string; }; /** * Returns the serialization of the transaction output into a buffer */ serialize(): Buffer; /** * Clone via deep copy */ clone(): TxOut; }