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(coin) → {CoinEntry}
Instantiate a coin from a TX
Parameters:
Name | Type | Description |
---|---|---|
coin |
Coin |
- Source:
Returns:
- Type
- CoinEntry
(static) fromOutput(output) → {CoinEntry}
Instantiate a coin from a TX
Parameters:
Name | Type | Description |
---|---|---|
output |
Output |
- Source:
Returns:
- Type
- CoinEntry
(static) fromTX(tx, index, height) → {CoinEntry}
Instantiate a coin from a TX
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX | |
index |
Number | Output index. |
height |
Number |
- Source:
Returns:
- Type
- CoinEntry
decode(data)
Inject properties from serialized data.
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer |
- Source:
encode() → {Buffer}
Serialize the coin.
- Source:
Returns:
- Type
- Buffer
fromCoin(coin)
Inject properties from Coin.
Parameters:
Name | Type | Description |
---|---|---|
coin |
Coin |
- Source:
fromOutput(output)
Inject properties from TX.
Parameters:
Name | Type | Description |
---|---|---|
output |
Output |
- Source:
fromTX(tx, index, height)
Inject properties from TX.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX | |
index |
Number | |
height |
Number |
- Source:
getSize() → {Number}
Calculate size of coin.
- Source:
Returns:
- Type
- Number
read(br)
Inject properties from serialized buffer writer.
Parameters:
Name | Type | Description |
---|---|---|
br |
bio.BufferReader |
- Source:
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
write(bw) → {BufioWriter}
Write the coin to a buffer writer.
Parameters:
Name | Type | Description |
---|---|---|
bw |
BufioWriter |
- Source:
Returns:
- Type
- BufioWriter