2023-12-22 11:59:02 +00:00
|
|
|
import 'package:cw_core/pending_transaction.dart';
|
|
|
|
import 'package:cw_decred/amount_format.dart';
|
|
|
|
|
|
|
|
class DecredPendingTransaction with PendingTransaction {
|
|
|
|
DecredPendingTransaction(
|
2024-03-06 02:32:15 +00:00
|
|
|
{required this.txid,
|
2023-12-22 11:59:02 +00:00
|
|
|
required this.amount,
|
|
|
|
required this.fee,
|
2024-02-06 10:58:19 +00:00
|
|
|
required this.rawHex,
|
|
|
|
required this.send});
|
2023-12-22 11:59:02 +00:00
|
|
|
|
|
|
|
final int amount;
|
|
|
|
final int fee;
|
|
|
|
final String txid;
|
|
|
|
final String rawHex;
|
2024-02-06 10:58:19 +00:00
|
|
|
final Future<void> Function() send;
|
2023-12-22 11:59:02 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
String get id => txid;
|
|
|
|
|
|
|
|
@override
|
|
|
|
String get amountFormatted => decredAmountToString(amount: amount);
|
|
|
|
|
|
|
|
@override
|
|
|
|
String get feeFormatted => decredAmountToString(amount: fee);
|
|
|
|
|
|
|
|
@override
|
|
|
|
String get hex => rawHex;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<void> commit() async {
|
2024-02-06 10:58:19 +00:00
|
|
|
return send();
|
2023-12-22 11:59:02 +00:00
|
|
|
}
|
|
|
|
}
|