|
|
@ -13,6 +13,7 @@ import 'package:mobx/mobx.dart';
|
|
|
|
import 'package:cake_wallet/store/settings_store.dart';
|
|
|
|
import 'package:cake_wallet/store/settings_store.dart';
|
|
|
|
import 'package:cake_wallet/generated/i18n.dart';
|
|
|
|
import 'package:cake_wallet/generated/i18n.dart';
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
import 'package:cake_wallet/monero/monero.dart';
|
|
|
|
|
|
|
|
|
|
|
|
part 'transaction_details_view_model.g.dart';
|
|
|
|
part 'transaction_details_view_model.g.dart';
|
|
|
|
|
|
|
|
|
|
|
@ -31,6 +32,9 @@ abstract class TransactionDetailsViewModelBase with Store {
|
|
|
|
|
|
|
|
|
|
|
|
final dateFormat = DateFormatter.withCurrentLocal();
|
|
|
|
final dateFormat = DateFormatter.withCurrentLocal();
|
|
|
|
final tx = transactionInfo;
|
|
|
|
final tx = transactionInfo;
|
|
|
|
|
|
|
|
final key = tx.additionalInfo['key'] as String;
|
|
|
|
|
|
|
|
final accountIndex = tx.additionalInfo['accountIndex'] as int;
|
|
|
|
|
|
|
|
final addressIndex = tx.additionalInfo['addressIndex'] as int;
|
|
|
|
|
|
|
|
|
|
|
|
if (wallet.type == WalletType.monero) {
|
|
|
|
if (wallet.type == WalletType.monero) {
|
|
|
|
final _items = [
|
|
|
|
final _items = [
|
|
|
@ -46,30 +50,27 @@ abstract class TransactionDetailsViewModelBase with Store {
|
|
|
|
value: tx.amountFormatted()),
|
|
|
|
value: tx.amountFormatted()),
|
|
|
|
StandartListItem(
|
|
|
|
StandartListItem(
|
|
|
|
title: S.current.transaction_details_fee, value: tx.feeFormatted()),
|
|
|
|
title: S.current.transaction_details_fee, value: tx.feeFormatted()),
|
|
|
|
|
|
|
|
if (key?.isNotEmpty ?? false)
|
|
|
|
|
|
|
|
StandartListItem(title: S.current.transaction_key, value: key)
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
//if (tx.key?.isNotEmpty ?? null) {
|
|
|
|
if (tx.direction == TransactionDirection.incoming &&
|
|
|
|
// _items.add(
|
|
|
|
accountIndex != null &&
|
|
|
|
// StandartListItem(title: S.current.transaction_key, value: tx.key));
|
|
|
|
addressIndex != null) {
|
|
|
|
//}
|
|
|
|
try {
|
|
|
|
|
|
|
|
final address = monero.getTransactionAddress(wallet, accountIndex, addressIndex);
|
|
|
|
//if (tx.direction == TransactionDirection.incoming) {
|
|
|
|
|
|
|
|
// try {
|
|
|
|
if (address?.isNotEmpty ?? false) {
|
|
|
|
// final accountIndex = tx.accountIndex;
|
|
|
|
isRecipientAddressShown = true;
|
|
|
|
// final addressIndex = tx.addressIndex;
|
|
|
|
_items.add(
|
|
|
|
//final address = moneroUtils.getTransactionAddress(wallet, accountIndex, addressIndex);
|
|
|
|
StandartListItem(
|
|
|
|
|
|
|
|
title: S.current.transaction_details_recipient_address,
|
|
|
|
//if (address?.isNotEmpty ?? false) {
|
|
|
|
value: address));
|
|
|
|
// isRecipientAddressShown = true;
|
|
|
|
}
|
|
|
|
// _items.add(
|
|
|
|
} catch (e) {
|
|
|
|
// StandartListItem(
|
|
|
|
print(e.toString());
|
|
|
|
// title: S.current.transaction_details_recipient_address,
|
|
|
|
}
|
|
|
|
// value: address));
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
|
|
|
|
// } catch (e) {
|
|
|
|
|
|
|
|
// print(e.toString());
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
items.addAll(_items);
|
|
|
|
items.addAll(_items);
|
|
|
|
}
|
|
|
|
}
|
|
|
|