sign method

  1. @override
LegacyWitnessInput sign({
  1. required Transaction tx,
  2. required int inputN,
  3. required ECPrivateKey key,
  4. required BigInt value,
  5. SigHashType hashType = const SigHashType.all(),
})
override

Signs the input given the tx, input number (inputN), private key and input value using the specifified hashType. Should throw CannotSignInput if the key cannot sign the input. Implemented by specific subclasses.

Implementation

@override
LegacyWitnessInput sign({
  required Transaction tx,
  required int inputN,
  required ECPrivateKey key,
  required BigInt value,
  hashType = const SigHashType.all(),
}) => addSignature(
  createInputSignature(
    tx: tx,
    inputN: inputN,
    key: checkKey(key),
    scriptCode: scriptCode,
    value: value,
    hashType: hashType,
  ),
);