From fed74388901860db30a56dbd5a5ccf5823ff78d3 Mon Sep 17 00:00:00 2001 From: malik1004x Date: Mon, 20 Apr 2026 14:31:31 +0200 Subject: [PATCH] fix address on monero tx info (#3192) --- .../transaction_details_view_model.dart | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/view_model/transaction_details_view_model.dart b/lib/view_model/transaction_details_view_model.dart index cc2897336..492c561a6 100644 --- a/lib/view_model/transaction_details_view_model.dart +++ b/lib/view_model/transaction_details_view_model.dart @@ -98,22 +98,30 @@ class TxDetailRowDefinition { keyString: "standard_list_item_transaction_details_recipient_address_key", title: S.current.transaction_details_recipient_address, valueGetter: (vm) { - vm.isRecipientAddressShown = true; + String? ret = null; + switch (vm.wallet.type) { case WalletType.monero: - return monero!.getTransactionAddress( - vm.wallet, - vm.transactionInfo.additionalInfo['accountIndex'] as int, - vm.transactionInfo.additionalInfo['addressIndex'] as int); + if (vm.transactionInfo.direction == TransactionDirection.incoming) { + ret = monero!.getTransactionAddress( + vm.wallet, + vm.transactionInfo.additionalInfo['accountIndex'] as int, + vm.transactionInfo.additionalInfo['addressIndex'] as int); + } case WalletType.bitcoin: - return (bitcoin!.getTransactionAddresses(vm.wallet, vm.transactionInfo) ?? []) + ret = (bitcoin!.getTransactionAddresses(vm.wallet, vm.transactionInfo) ?? []) .firstOrNull ?? ""; case WalletType.tron: - return tron!.getTronBase58Address(vm.transactionInfo.to!, vm.wallet); + ret = tron!.getTronBase58Address(vm.transactionInfo.to!, vm.wallet); default: - return vm.transactionInfo.to!; + break; } + if(ret == null) { + ret = vm.transactionInfo.to ?? ""; + } + vm.isRecipientAddressShown = ret.isNotEmpty; + return ret; }, applicable: (vm) => vm.showRecipientAddress &&