effectiveOutputs property

List<InvoiceOutputSpec> get effectiveOutputs

Get effective outputs - either explicit outputs or computed from addresses/amount

Implementation

List<InvoiceOutputSpec> get effectiveOutputs {
  if (outputs != null && outputs!.isNotEmpty) {
    return outputs!;
  }
  // Convert legacy addresses/amount to P2PKH outputs
  if (addresses.isEmpty) return [];
  final amountPerAddress = amount ~/ BigInt.from(addresses.length);
  return addresses
      .map((addr) => P2PKHOutputSpec(address: addr, amount: amountPerAddress))
      .toList();
}