WitnessSignatureHasher constructor

WitnessSignatureHasher({
  1. required Transaction tx,
  2. required int inputN,
  3. required Script scriptCode,
  4. required BigInt value,
  5. required SigHashType hashType,
})

Produces the hash of an input signature for a non-taproot witness input at inputN. The scriptCode of the redeem script is necessary and the value of the previous output is required. hashType controls what data is included in the signature.

Implementation

WitnessSignatureHasher({
  required this.tx,
  required this.inputN,
  required this.scriptCode,
  required this.value,
  required this.hashType,
}) : hashes = TransactionSignatureHashes(tx) {
  SignatureHasher.checkInputN(tx, inputN);
  SignatureHasher.checkSchnorrDisallowed(hashType);
}