Constructor
new Outpoint(hashopt, nullable, indexopt, nullable)
Create an outpoint.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
hash |
Hash |
<optional> <nullable> |
|
index |
Number |
<optional> <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 |
Buffer |
- 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) → {Buffer}
Serialize outpoint to a key suitable for a hash table.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | |
index |
Number |
- Source:
Returns:
- Type
- Buffer
compare(prevout) → {Number}
Compare against another outpoint (BIP69).
Parameters:
Name | Type | Description |
---|---|---|
prevout |
this |
- Source:
Returns:
- Type
- Number
equals(prevout) → {Boolean}
Test equality against another outpoint.
Parameters:
Name | Type | Description |
---|---|---|
prevout |
this |
- Source:
Returns:
- Type
- Boolean
format() → {String}
Convert the outpoint to a user-friendly string.
- Source:
Returns:
- Type
- String
fromJSON(json)
Inject properties from json object.
Parameters:
Name | Type | Description |
---|---|---|
json |
OutpointJSON |
- Source:
fromKey(key) → {Outpoint}
Inject properties from hash table key.
Parameters:
Name | Type | Description |
---|---|---|
key |
Buffer |
- Source:
Returns:
- Type
- Outpoint
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() → {OutpointJSON}
Convert the outpoint to an object suitable for JSON serialization.
- Source:
Returns:
- Type
- OutpointJSON
getSize() → {Number}
Calculate size of outpoint.
- Source:
Returns:
- Type
- Number
inject(prevout) → {this}
Clone the outpoint.
Parameters:
Name | Type | Description |
---|---|---|
prevout |
this |
- Source:
Returns:
- Type
- this
isNull() → {Boolean}
Test whether the outpoint is null (hash of zeroes with max-u32 index). Used to detect coinbases.
- Source:
Returns:
- Type
- Boolean
read(br)
Inject properties from buffer reader.
Parameters:
Name | Type | Description |
---|---|---|
br |
bio.BufferReader |
- Source:
toKey() → {Buffer}
Serialize outpoint to a key suitable for a hash table.
- Source:
Returns:
- Type
- Buffer
txid() → {HexHash}
Get little-endian hash.
- Source:
Returns:
- Type
- HexHash
write(bw) → {BufioWriter}
Write outpoint to a buffer writer.
Parameters:
Name | Type | Description |
---|---|---|
bw |
BufioWriter |
- Source:
Returns:
- Type
- BufioWriter