SplitUTXOsToBenfordCommand constructor

SplitUTXOsToBenfordCommand({
  1. required String walletId,
  2. required int targetUtxoCount,
  3. BigInt? feeRate,
  4. int? maxUtxosToSplit,
  5. String? commandId,
  6. DateTime? timestamp,
  7. Map<String, dynamic>? metadata,
})

Implementation

SplitUTXOsToBenfordCommand({
  required String walletId,
  required this.targetUtxoCount,
  this.feeRate,
  this.maxUtxosToSplit,
  String? commandId,
  DateTime? timestamp,
  Map<String, dynamic>? metadata,
}) : super(
        walletId: walletId,
        commandId: commandId,
        timestamp: timestamp,
        metadata: metadata,
      ) {
  // Validation
  if (targetUtxoCount < 2) {
    throw ArgumentError('Target UTXO count must be at least 2');
  }
  if (targetUtxoCount > 100) {
    throw ArgumentError('Target UTXO count cannot exceed 100 (transaction size limits)');
  }
  if (feeRate != null && feeRate! <= BigInt.zero) {
    throw ArgumentError('Fee rate must be positive');
  }
  if (maxUtxosToSplit != null && maxUtxosToSplit! < 1) {
    throw ArgumentError('maxUtxosToSplit must be at least 1');
  }
}