Added ToFeeDisplayFormatString()  extension method and added Fee Display Format logic to CoinJoinDetailsViewModel
MODIFY
WalletWasabi.Fluent/Extensions/TransactionSummaryExtension.cs
WalletWasabi.Fluent/Extensions/TransactionSummaryExtension.cs
using NBitcoin;
using WalletWasabi.Blockchain.Transactions;
+using WalletWasabi.Extensions;
using WalletWasabi.Fluent.Models;
using WalletWasabi.Models;
@@ -20,4 +21,19 @@ public static class TransactionSummaryExtension
FeeDisplayFormat.Satoshis => MoneyUnit.Satoshi,
_ => throw new InvalidOperationException($"Invalid Fee Display Format value: {feeDisplayFormat}")
};
+
+ public static string? ToFeeDisplayFormatString(this Money? fee)
+ {
+ if (fee == null)
+ {
+ return null;
+ }
+
+ var displayFormat = Services.UiConfig.FeeDisplayFormat.GetEnumValueOrDefault(FeeDisplayFormat.BTC);
+ var moneyUnit = displayFormat.ToMoneyUnit();
+
+ var feeText = $"{fee.ToDecimal(moneyUnit)} {displayFormat.FriendlyName() } ";
+
+ return feeText;
+ }
}

MODIFY
WalletWasabi.Fluent/ViewModels/TransactionBroadcasting/BroadcastTransactionViewModel.cs
WalletWasabi.Fluent/ViewModels/TransactionBroadcasting/BroadcastTransactionViewModel.cs
@@ -89,13 +89,7 @@ public partial class BroadcastTransactionViewModel : RoutableViewModel
? null
: totalInputValue - totalOutputValue;
- var feeDisplayFormat = Services.UiConfig.FeeDisplayFormat.GetEnumValueOrDefault(FeeDisplayFormat.BTC);
- var feeMoneyUnit = feeDisplayFormat.ToMoneyUnit();
-
- FeeString =
- networkFee is null
- ? "Unknown"
- : $"{networkFee.ToDecimal(feeMoneyUnit)} {feeDisplayFormat.FriendlyName()}";
+ FeeString = networkFee?.ToFeeDisplayFormatString() ?? "Unknown";
}
private async Task OnNextAsync(SmartTransaction transaction)

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/CoinJoinDetailsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/CoinJoinDetailsViewModel.cs
@@ -6,6 +6,7 @@ using System.Windows.Input;
using Avalonia;
using NBitcoin;
using ReactiveUI;
+using WalletWasabi.Fluent.Extensions;
using WalletWasabi.Fluent.ViewModels.Navigation;
using WalletWasabi.Fluent.ViewModels.Wallets.Home.History.HistoryItems;
@@ -19,6 +20,7 @@ public partial class CoinJoinDetailsViewModel : RoutableViewModel
[AutoNotify] private string _date = "";
[AutoNotify] private string _status = "";
[AutoNotify] private Money? _coinJoinFee;
+ [AutoNotify] private string _coinJoinFeeString;
[AutoNotify] private ObservableCollection<uint256>? _transactionIds;
public CoinJoinDetailsViewModel(CoinJoinsHistoryItemViewModel coinJoinGroup)
@@ -57,6 +59,8 @@ public partial class CoinJoinDetailsViewModel : RoutableViewModel
Date = _coinJoinGroup.DateString;
Status = _coinJoinGroup.IsConfirmed ? "Confirmed" : "Pending";
CoinJoinFee = _coinJoinGroup.OutgoingAmount;
+ CoinJoinFeeString = CoinJoinFee.ToFeeDisplayFormatString() ?? "Unknown";
+
TransactionIds = new ObservableCollection<uint256>(_coinJoinGroup.CoinJoinTransactions.Select(x => x.TransactionId));
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionSummaryViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionSummaryViewModel.cs
@@ -62,11 +62,8 @@ public partial class TransactionSummaryViewModel : ViewModelBase
destinationAmount.GenerateFiatText(_wallet.Synchronizer.UsdExchangeRate, "USD");
AmountText = $"{btcAmountText}{fiatAmountText}";
- var feeDisplayFormat = Services.UiConfig.FeeDisplayFormat.GetEnumValueOrDefault(FeeDisplayFormat.BTC);
- var feeMoneyUnit = feeDisplayFormat.ToMoneyUnit();
-
var fee = _transaction.Fee;
- var feeText = $"{fee.ToDecimal(feeMoneyUnit)} {feeDisplayFormat.FriendlyName() } ";
+ var feeText = fee.ToFeeDisplayFormatString();
var fiatFeeText = fee.ToDecimal(MoneyUnit.BTC)
.GenerateFiatText(_wallet.Synchronizer.UsdExchangeRate, "USD");

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/History/CoinJoinDetailsView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/History/CoinJoinDetailsView.axaml
<c:PreviewItem Icon="{StaticResource btc_logo}"
Text="Mining fee paid"
CopyParameter="{Binding CoinJoinFee}">
- <TextBlock Text="{Binding CoinJoinFee, StringFormat={}{0} BTC, Mode=OneWay}" />
+ <TextBlock Text="{Binding CoinJoinFeeString, Mode=OneWay}" />
</c:PreviewItem>
</StackPanel>

Added ToFeeDisplayFormatString()  extension method and added Fee Display Format logic to CoinJoinDetailsViewModel