signSchnorrHd method
void
signSchnorrHd(
{ - required int vin,
- required Uint8List sig,
- int? hashType,
})
Implementation
void signSchnorrHd(
{required int vin, required Uint8List sig, int? hashType}) {
if (vin >= ins.length) throw ArgumentError('No input at index: $vin');
hashType = hashType ?? SIGHASH_DEFAULT;
final input = ins[vin];
final witness = [_serializeTaprootSignature(sig, hashType)];
if (input.tapLeafScript?.isNotEmpty ?? false) {
final item = input.tapLeafScript!.first;
witness.addAll([item.script, item.controlBlock]);
}
input.update(witness: witness);
}