match static method
Checks if the raw
input and witness
data match the expected format for
a TaprootKeyInput, with a signature. If it does it returns a
TaprootKeyInput for the input or else it returns null.
Implementation
static TaprootKeyInput? match(RawInput raw, List<Uint8List> witness) {
if (raw.scriptSig.isNotEmpty) return null;
if (witness.length != 1) return null;
try {
return TaprootKeyInput(
prevOut: raw.prevOut,
insig: SchnorrInputSignature.fromBytes(witness[0]),
sequence: raw.sequence,
);
} on InvalidInputSignature {
return null;
}
}