cake_wallet/lib/entities/pending_transaction.dart

26 lines
949 B
Dart
Raw Normal View History

2020-01-04 19:31:52 +00:00
import 'package:flutter/foundation.dart';
2020-01-08 12:26:34 +00:00
import 'package:cw_monero/transaction_history.dart' as transaction_history;
2020-01-04 19:31:52 +00:00
import 'package:cw_monero/structs/pending_transaction.dart';
2020-09-21 11:50:26 +00:00
import 'package:cake_wallet/monero/monero_amount_format.dart';
2020-01-04 19:31:52 +00:00
class PendingTransaction {
PendingTransaction(
{@required this.amount, @required this.fee, @required this.hash});
PendingTransaction.fromTransactionDescription(
PendingTransactionDescription transactionDescription)
: amount = moneroAmountToString(amount: transactionDescription.amount),
fee = moneroAmountToString(amount: transactionDescription.fee),
hash = transactionDescription.hash,
_pointerAddress = transactionDescription.pointerAddress;
2020-01-08 12:26:34 +00:00
final String amount;
final String fee;
final String hash;
int _pointerAddress;
Future<void> commit() async => transaction_history
2020-01-04 19:31:52 +00:00
.commitTransactionFromPointerAddress(address: _pointerAddress);
}