Constructor
new CoinEntry()
Create a coin entry.
Properties:
Name | Type | Description |
---|---|---|
version |
Number | Transaction version. |
height |
Number | Transaction height (-1 if unconfirmed). |
coinbase |
Boolean | Whether the containing transaction is a coinbase. |
output |
Output | |
spent |
Boolean | |
raw |
Buffer |
- Source:
Methods
(static) fromCoin(tx, index) → {CoinEntry}
Instantiate a coin from a TX
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX | |
index |
Number | Output index. |
- Source:
Returns:
- Type
- CoinEntry
(static) fromOutput(tx, index) → {CoinEntry}
Instantiate a coin from a TX
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX | |
index |
Number | Output index. |
- Source:
Returns:
- Type
- CoinEntry
(static) fromRaw(data) → {CoinEntry}
Instantiate a coin from a serialized Buffer.
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer |
- Source:
Returns:
- Type
- CoinEntry
(static) fromReader(data) → {CoinEntry}
Instantiate a coin from a serialized Buffer.
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer |
- Source:
Returns:
- Type
- CoinEntry
(static) fromTX(tx, index) → {CoinEntry}
Instantiate a coin from a TX
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX | |
index |
Number | Output index. |
- Source:
Returns:
- Type
- CoinEntry
fromCoin(tx, index)
Inject properties from TX.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX | |
index |
Number |
- Source:
fromOutput(tx, index)
Inject properties from TX.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX | |
index |
Number |
- Source:
(private) fromRaw(data)
Inject properties from serialized data.
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer |
- Source:
(private) fromReader(br)
Inject properties from serialized buffer writer.
Parameters:
Name | Type | Description |
---|---|---|
br |
BufferReader |
- Source:
fromTX(tx, index)
Inject properties from TX.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX | |
index |
Number |
- Source:
getSize() → {Number}
Calculate size of coin.
- Source:
Returns:
- Type
- Number
toCoin(prevout) → {Coin}
Convert coin entry to a coin.
Parameters:
Name | Type | Description |
---|---|---|
prevout |
Outpoint |
- Source:
Returns:
- Type
- Coin
toOutput() → {Output}
Convert coin entry to an output.
- Source:
Returns:
- Type
- Output
toRaw() → {Buffer}
Serialize the coin.
- Source:
Returns:
- Type
- Buffer
toWriter(bw)
Write the coin to a buffer writer.
Parameters:
Name | Type | Description |
---|---|---|
bw |
BufferWriter |
- Source: