match static method
Matches a raw
input with witness data to a corresponding WitnessInput
or specialised sub-class object. If this is not a witness input, null is
returned.
Implementation
static WitnessInput? match(RawInput raw, List<Uint8List> witness)
=> raw.scriptSig.isEmpty && witness.isNotEmpty
? (
// Is a witness input, so match with the specific input type
P2WPKHInput.match(raw, witness)
?? TaprootKeyInput.match(raw, witness)
?? TaprootScriptInput.match(raw, witness)
?? WitnessInput(
prevOut: raw.prevOut,
witness: witness,
sequence: raw.sequence,
)
)
: null;