Class: CoinEntry

coins.CoinEntry()

Coin Entry Represents an unspent output.

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) → {CoinEntry}

Instantiate a coin from a TX

Parameters:
Name Type Description
tx TX
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) fromTX(tx, index) → {CoinEntry}

Instantiate a coin from a TX

Parameters:
Name Type Description
tx TX
index Number

Output index.

Source:
Returns:
Type
CoinEntry

(private) decode(data)

Inject properties from serialized data.

Parameters:
Name Type Description
data Buffer
Source:

encode() → {Buffer}

Serialize the coin.

Source:
Returns:
Type
Buffer

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:

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

(private) read(br)

Inject properties from serialized buffer writer.

Parameters:
Name Type Description
br 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)

Write the coin to a buffer writer.

Parameters:
Name Type Description
bw BufferWriter
Source: