Files
hash-wallet/lib/anypay/any_pay_payment_instruction.dart
T
jwinterm 788318a3a2 style: format Dart at 100 columns, as upstream does
Upstream reformatted its whole tree in 16ddc0837. Matching it removes
formatting from the conflict surface of this and every later sync.
2026-10-24 22:48:17 -04:00

31 lines
989 B
Dart

import 'package:hash_wallet/anypay/any_pay_payment_instruction_output.dart';
class AnyPayPaymentInstruction {
AnyPayPaymentInstruction(
{required this.type,
required this.requiredFeeRate,
required this.txKey,
required this.txHash,
required this.outputs});
factory AnyPayPaymentInstruction.fromMap(Map<String, dynamic> obj) {
final outputs = (obj['outputs'] as List<dynamic>)
.map((dynamic out) => AnyPayPaymentInstructionOutput.fromMap(out as Map<String, dynamic>))
.toList();
return AnyPayPaymentInstruction(
type: obj['type'] as String,
requiredFeeRate: obj['requiredFeeRate'] as int,
txKey: obj['tx_key'] as bool? ?? false,
txHash: obj['tx_hash'] as bool? ?? false,
outputs: outputs);
}
static const transactionType = 'transaction';
final String type;
final int requiredFeeRate;
final bool txKey;
final bool txHash;
final List<AnyPayPaymentInstructionOutput> outputs;
}