Skip to main content

tapScriptFinalizer

bitcoinjs-lib v1.0.7


bitcoinjs-lib / bip371 / tapScriptFinalizer

Function: tapScriptFinalizer()

tapScriptFinalizer(inputIndex, input, tapLeafHashToFinalize?): object

Defined in: ts_src/psbt/bip371.ts:47

Default tapscript finalizer. It searches for the tapLeafHashToFinalize if provided. Otherwise it will search for the tapleaf that has at least one signature and has the shortest path.

Parameters

inputIndex

number

the position of the PSBT input.

input

PsbtInput

the PSBT input.

tapLeafHashToFinalize?

Uint8Array

optional, if provided the finalizer will search for a tapleaf that has this hash and will try to build the finalScriptWitness.

Returns

object

the finalScriptWitness or throws an exception if no tapleaf found.

finalScriptWitness

finalScriptWitness: undefined | Uint8Array