signInputAsync method

Future<void> signInputAsync(
  1. int index,
  2. AsyncSignerCallback signer
)

Implementation

Future<void> signInputAsync(int index, AsyncSignerCallback signer) async {
  final inputSection = _getInputSection(index);
  final hashType = _getInputSighashType(inputSection) ?? defaultHashType;
  final tx = _buildUnsignedTx();
  final witnessUtxo = _findInputKv(
      inputSection, PsbtInputEntry.witnessUtxo.keyType);

  final digest = _computeDigest(tx, index, hashType, inputSection, witnessUtxo);
  final sig = await signer(tx, index, digest, hashType);
  _storePartialSig(index, sig, hashType);
}