Class: TXResponse

net/bip152~TXResponse(optionsnullable)

TX Response Represents BlockTransactions (bip152): blocktxn packet.

Constructor

new TXResponse(optionsnullable)

Create a tx response.

Parameters:
Name Type Attributes Description
options Object <nullable>
Properties:
Name Type Description
hash Hash
txs Array.<TX>
Source:
See:

Methods

(static) fromBlock(block) → {TXResponse}

Instantiate response from block.

Parameters:
Name Type Description
block Block
Source:
Returns:
Type
TXResponse

(static) fromOptions(options) → {TXResponse}

Instantiate response from options.

Parameters:
Name Type Description
options Object
Source:
Returns:
Type
TXResponse

(static) fromRaw(data) → {TXResponse}

Instantiate response from serialized data.

Parameters:
Name Type Description
data Buffer
Source:
Returns:
Type
TXResponse

(static) fromReader(br) → {TXResponse}

Instantiate response from buffer reader.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
TXResponse

(private) frameRaw(witness) → {Buffer}

Serialize response with witness data.

Parameters:
Name Type Description
witness Boolean
Source:
Returns:
Type
Buffer

(private) fromBlock(block) → {TXResponse}

Inject properties from block.

Parameters:
Name Type Description
block Block
Source:
Returns:
Type
TXResponse

(private) fromOptions(options) → {TXResponse}

Inject properties from options.

Parameters:
Name Type Description
options Object
Source:
Returns:
Type
TXResponse

(private) fromRaw(data) → {TXResponse}

Inject properties from serialized data.

Parameters:
Name Type Description
data Buffer
Source:
Returns:
Type
TXResponse

(private) fromReader(br) → {TXResponse}

Inject properties from buffer reader.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
TXResponse

getSize() → {Number}

Calculate request serialization size.

Source:
Returns:
Type
Number

toNormal() → {Buffer}

Serialize response without witness data.

Source:
Returns:
Type
Buffer

toNormalWriter(bw)

Write serialized response to a buffer writer (excludes witness data).

Parameters:
Name Type Description
bw BufferWriter
Source:

toRaw() → {Buffer}

Serialize response with witness data.

Source:
Returns:
Type
Buffer

toWriter(bw)

Write serialized response to a buffer writer (includes witness data).

Parameters:
Name Type Description
bw BufferWriter
Source:

(private) writeRaw(bw, witness)

Write serialized response to buffer writer.

Parameters:
Name Type Description
bw BufferWriter
witness Boolean
Source: