Input constructor
Input({
- Uint8List? hash,
- int? index,
- Uint8List? script,
- int? sequence,
- int? value,
- Uint8List? prevOutScript,
- Uint8List? redeemScript,
- Uint8List? witnessScript,
- List<
Uint8List?> ? pubkeys, - List<
Uint8List?> ? signatures, - List<
Uint8List?> ? witness, - String? signType,
- String? prevOutType,
- String? redeemScriptType,
- String? witnessScriptType,
- int? maxSignatures,
Implementation
Input(
{this.hash,
this.index,
this.script,
this.sequence,
this.value,
this.prevOutScript,
this.redeemScript,
this.witnessScript,
this.pubkeys,
this.signatures,
this.witness,
this.signType,
this.prevOutType,
this.redeemScriptType,
this.witnessScriptType,
this.maxSignatures}) {
hasWitness = false; // Default value
if (hash != null && !isHash256bit(hash!)) {
throw ArgumentError('Invalid input hash');
}
if (index != null && !isUint(index!, 32)) {
throw ArgumentError('Invalid input index');
}
if (sequence != null && !isUint(sequence!, 32)) {
throw ArgumentError('Invalid input sequence');
}
if (value != null && !isShatoshi(value!)) {
throw ArgumentError('Invalid ouput value');
}
}