Class: Outpoint

primitives.Outpoint(hashnullable, indexnullable)

Outpoint Represents a COutPoint.

Constructor

new Outpoint(hashnullable, indexnullable)

Create an outpoint.

Parameters:
Name Type Attributes Description
hash Hash <nullable>
index Number <nullable>
Properties:
Name Type Description
hash Hash
index Number
Source:

Methods

(static) fromKey(key) → {Outpoint}

Instantiate outpoint from hash table key.

Parameters:
Name Type Description
key String
Source:
Returns:
Type
Outpoint

(static) fromTX(tx, index) → {Outpoint}

Instantiate outpoint from tx.

Parameters:
Name Type Description
tx TX
index Number
Source:
Returns:
Type
Outpoint

(static) isOutpoint(obj) → {Boolean}

Test an object to see if it is an outpoint.

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

(static) toKey(hash, index) → {String}

Serialize outpoint to a key suitable for a hash table.

Parameters:
Name Type Description
hash Hash
index Number
Source:
Returns:
Type
String

compare(prevout) → {Number}

Compare against another outpoint (BIP69).

Parameters:
Name Type Description
prevout Outpoint
Source:
Returns:
Type
Number

equals(prevout) → {Boolean}

Test equality against another outpoint.

Parameters:
Name Type Description
prevout Outpoint
Source:
Returns:
Type
Boolean

format() → {String}

Convert the outpoint to a user-friendly string.

Source:
Returns:
Type
String

(private) fromJSON()

Inject properties from json object.

Source:

(private) fromKey(key) → {Outpoint}

Inject properties from hash table key.

Parameters:
Name Type Description
key String
Source:
Returns:
Type
Outpoint

(private) fromOptions(options)

Inject properties from options object.

Parameters:
Name Type Description
options Object
Source:

(private) fromTX(tx, index)

Inject properties from tx.

Parameters:
Name Type Description
tx TX
index Number
Source:

getJSON() → {Object}

Convert the outpoint to an object suitable for JSON serialization.

Source:
Returns:
Type
Object

getSize() → {Number}

Calculate size of outpoint.

Source:
Returns:
Type
Number

inject() → {Outpoint}

Clone the outpoint.

Source:
Returns:
Type
Outpoint

isNull() → {Boolean}

Test whether the outpoint is null (hash of zeroes with max-u32 index). Used to detect coinbases.

Source:
Returns:
Type
Boolean

(private) read(br)

Inject properties from buffer reader.

Parameters:
Name Type Description
br BufferReader
Source:

toKey() → {String}

Serialize outpoint to a key suitable for a hash table.

Source:
Returns:
Type
String

txid() → {Hash}

Get little-endian hash.

Source:
Returns:
Type
Hash

write(bw)

Write outpoint to a buffer writer.

Parameters:
Name Type Description
bw BufferWriter
Source: