fix address on monero tx info (#3192)
malik1004x committed
Apr 20, 2026 at 14:31 UTC
fed74388901860db30a56dbd5a5ccf5823ff78d3
1 file changed
+16
-8
lib/view_model/transaction_details_view_model.dart
+16
-8
@@ -98,22 +98,30 @@ class TxDetailRowDefinition {
98
keyString: "standard_list_item_transaction_details_recipient_address_key",
99
title: S.current.transaction_details_recipient_address,
100
valueGetter: (vm) {
101
- vm.isRecipientAddressShown = true;
101
+ String? ret = null;
102
+
103
switch (vm.wallet.type) {
104
case WalletType.monero:
104
- return monero!.getTransactionAddress(
105
- vm.wallet,
106
- vm.transactionInfo.additionalInfo['accountIndex'] as int,
107
- vm.transactionInfo.additionalInfo['addressIndex'] as int);
105
+ if (vm.transactionInfo.direction == TransactionDirection.incoming) {
106
+ ret = monero!.getTransactionAddress(
107
+ vm.wallet,
108
+ vm.transactionInfo.additionalInfo['accountIndex'] as int,
109
+ vm.transactionInfo.additionalInfo['addressIndex'] as int);
110
+ }
111
case WalletType.bitcoin:
109
- return (bitcoin!.getTransactionAddresses(vm.wallet, vm.transactionInfo) ?? [])
112
+ ret = (bitcoin!.getTransactionAddresses(vm.wallet, vm.transactionInfo) ?? [])
113
.firstOrNull ??
114
"";
115
case WalletType.tron:
113
- return tron!.getTronBase58Address(vm.transactionInfo.to!, vm.wallet);
116
+ ret = tron!.getTronBase58Address(vm.transactionInfo.to!, vm.wallet);
117
default:
115
- return vm.transactionInfo.to!;
118
+ break;
119
+ }
120
+ if(ret == null) {
121
+ ret = vm.transactionInfo.to ?? "";
122
}
123
+ vm.isRecipientAddressShown = ret.isNotEmpty;
124
+ return ret;
125
},
126
applicable: (vm) =>
127
vm.showRecipientAddress &&