Input constructor

Input({
  1. Uint8List? hash,
  2. int? index,
  3. Uint8List? script,
  4. int? sequence,
  5. int? value,
  6. Uint8List? prevOutScript,
  7. List<Uint8List?>? pubkeys,
  8. List<Uint8List?>? signatures,
  9. List<Uint8List?>? witness,
  10. String? prevOutType,
})

Implementation

Input(
    {this.hash,
    this.index,
    this.script,
    this.sequence,
    this.value,
    this.prevOutScript,
    this.pubkeys,
    this.signatures,
    this.witness,
    this.prevOutType}) {
  this.hasWitness = false; // Default value
  if (this.hash != null && !isHash256bit(this.hash!))
    throw new ArgumentError('Invalid input hash');
  if (this.index != null && !isUint(this.index!, 32))
    throw new ArgumentError('Invalid input index');
  if (this.sequence != null && !isUint(this.sequence!, 32))
    throw new ArgumentError('Invalid input sequence');
  if (this.value != null && !isShatoshi(this.value!))
    throw ArgumentError('Invalid ouput value');
}