mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-05-12 11:32:13 +00:00
40 lines
1.2 KiB
Dart
40 lines
1.2 KiB
Dart
import 'package:cw_core/transaction_info.dart';
|
|
import 'package:cw_core/monero_amount_format.dart';
|
|
import 'package:cw_core/transaction_direction.dart';
|
|
import 'package:cw_core/format_amount.dart';
|
|
|
|
class MoneroTransactionInfo extends TransactionInfo {
|
|
MoneroTransactionInfo(this.txHash, this.height, this.direction, this.date,
|
|
this.isPending, this.amount, this.accountIndex, this.addressIndex, this.fee,
|
|
this.confirmations) :
|
|
id = "${txHash}_${amount}_${accountIndex}_${addressIndex}";
|
|
|
|
final String id;
|
|
final String txHash;
|
|
final int height;
|
|
final TransactionDirection direction;
|
|
final DateTime date;
|
|
final int accountIndex;
|
|
final bool isPending;
|
|
final int amount;
|
|
final int fee;
|
|
final int addressIndex;
|
|
final int confirmations;
|
|
String? recipientAddress;
|
|
String? key;
|
|
String? _fiatAmount;
|
|
|
|
@override
|
|
String amountFormatted() =>
|
|
'${formatAmount(moneroAmountToString(amount: amount))} XMR';
|
|
|
|
@override
|
|
String fiatAmount() => _fiatAmount ?? '';
|
|
|
|
@override
|
|
void changeFiatAmount(String amount) => _fiatAmount = formatAmount(amount);
|
|
|
|
@override
|
|
String feeFormatted() =>
|
|
'${formatAmount(moneroAmountToString(amount: fee))} XMR';
|
|
}
|