Skip to main content

Module: utils

Functions

encodeRawInput

encodeRawInput(tx): Buffer

Parameters

NameType
txTransaction

Returns

Buffer

Defined in

utils.ts:15


encodeRawOutput

encodeRawOutput(tx): Buffer

Parameters

NameType
txTransaction

Returns

Buffer

Defined in

utils.ts:38


encodeRawWitness

encodeRawWitness(tx): Buffer

Parameters

NameType
txTransaction

Returns

Buffer

Defined in

utils.ts:71


getMerkleProof

getMerkleProof(block, txHash, forWitness?): Object

Retrieve a Merkle proof for a Bitcoin transaction from a block's raw data.

Parameters

NameTypeDescription
blockBlockThe Bitcoin block containing the transaction.
txHashstringThe transaction hash to construct a proof for.
forWitness?booleanSet to true to construct a witness proof (default is false).

Returns

Object

An object containing the position, proof, and root of the Merkle proof.

NameType
posany
proofstring
rootstring

Defined in

utils.ts:133