Class: Output

primitives~Output(optionsnullable)

Represents a transaction output.

Constructor

new Output(optionsnullable)

Create an output.

Parameters:
Name Type Attributes Description
options Object <nullable>
Properties:
Name Type Description
value Amount
address Address
Source:

Methods

(static) fromScript(address, value) → {Output}

Instantiate output from address/value pair.

Parameters:
Name Type Description
address Address
value Amount
Source:
Returns:
Type
Output

(static) isOutput(obj) → {Boolean}

Test an object to see if it is an Output.

Parameters:
Name Type Description
obj Object
Source:
Returns:
Type
Boolean

compare(output) → {Number}

Compare against another output (BIP69).

Parameters:
Name Type Description
output Output
Source:
Returns:
Type
Number

equals(output) → {Boolean}

Test equality against another output.

Parameters:
Name Type Description
output Output
Source:
Returns:
Type
Boolean

format() → {Object}

Convert the input to a more user-friendly object.

Source:
Returns:
Type
Object

(private) fromJSON(json)

Inject properties from a JSON object.

Parameters:
Name Type Description
json Object
Source:

(private) fromOptions(options)

Inject properties from options object.

Parameters:
Name Type Description
options Object
Source:

(private) fromScript(address, value) → {Output}

Inject properties from address/value pair.

Parameters:
Name Type Description
address Address
value Amount
Source:
Returns:
Type
Output

getAddress() → {Address}

Get the address.

Source:
Returns:

address

Type
Address

getDustThreshold(ratenullable) → {Amount}

Calculate the dust threshold for this output, based on serialize size and rate.

Parameters:
Name Type Attributes Description
rate Rate <nullable>
Source:
Returns:
Type
Amount

getHash() → {Hash}

Get the address hash.

Source:
Returns:

hash

Type
Hash

getJSON(network) → {Object}

Convert the output to an object suitable for JSON serialization.

Parameters:
Name Type Description
network Network
Source:
Returns:
Type
Object

getSize() → {Number}

Calculate size of serialized output.

Source:
Returns:
Type
Number

inject() → {Output}

Clone the output.

Source:
Returns:
Type
Output

isDust(ratenullable) → {Boolean}

Test whether the output should be considered dust.

Parameters:
Name Type Attributes Description
rate Rate <nullable>
Source:
Returns:
Type
Boolean

isUnspendable() → {Boolean}

Test whether the output is unspendable.

Source:
Returns:
Type
Boolean

(private) read(br)

Inject properties from buffer reader.

Parameters:
Name Type Description
br BufferReader
Source:

write(bw)

Write the output to a buffer writer.

Parameters:
Name Type Description
bw BufferWriter
Source: