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) fromJSON(json) → {Outpoint}
Instantiate outpoint from json object.
Parameters:
Name | Type | Description |
---|---|---|
json |
Object |
- Source:
Returns:
- Type
- Outpoint
(static) fromKey(key) → {Outpoint}
Instantiate outpoint from hash table key.
Parameters:
Name | Type | Description |
---|---|---|
key |
String |
- Source:
Returns:
- Type
- Outpoint
(static) fromOptions(options) → {Outpoint}
Instantate outpoint from options object.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
- Source:
Returns:
- Type
- Outpoint
(static) fromRaw(data) → {Outpoint}
Instantiate outpoint from serialized data.
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer |
- Source:
Returns:
- Type
- Outpoint
(static) fromReader(br) → {Outpoint}
Instantiate outpoint from a buffer reader.
Parameters:
Name | Type | Description |
---|---|---|
br |
BufferReader |
- 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
clone() → {Outpoint}
Clone the outpoint.
- Source:
Returns:
- Type
- Outpoint
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
(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) fromRaw(data)
Inject properties from serialized data.
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer |
- Source:
(private) fromReader(br)
Inject properties from buffer reader.
Parameters:
Name | Type | Description |
---|---|---|
br |
BufferReader |
- Source:
(private) fromTX(tx, index)
Inject properties from tx.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX | |
index |
Number |
- Source:
getSize() → {Number}
Calculate size of outpoint.
- Source:
Returns:
- Type
- Number
inspectSymbol() → {String}
Convert the outpoint to a user-friendly string.
- Source:
Returns:
- Type
- String
isNull() → {Boolean}
Test whether the outpoint is null (hash of zeroes with max-u32 index). Used to detect coinbases.
- Source:
Returns:
- Type
- Boolean
rhash() → {Hash}
Get little-endian hash.
- Source:
Returns:
- Type
- Hash
toJSON() → {Object}
Convert the outpoint to an object suitable for JSON serialization. Note that the hash will be reversed to abide by bitcoind's legacy of little-endian uint256s.
- Source:
Returns:
- Type
- Object
toKey() → {String}
Serialize outpoint to a key suitable for a hash table.
- Source:
Returns:
- Type
- String
toRaw() → {Buffer}
Serialize outpoint.
- Source:
Returns:
- Type
- Buffer
toWriter(bw)
Write outpoint to a buffer writer.
Parameters:
Name | Type | Description |
---|---|---|
bw |
BufferWriter |
- Source:
txid() → {Hash}
Get little-endian hash.
- Source:
Returns:
- Type
- Hash