Add transaction counters in wallet stats
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Advanced/WalletStatsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Advanced/WalletStatsViewModel.cs
@@ -4,8 +4,10 @@ using System.Reactive.Linq;
using NBitcoin;
using ReactiveUI;
using WalletWasabi.Blockchain.Keys;
+using WalletWasabi.Blockchain.Transactions;
using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Fluent.ViewModels.Navigation;
+using WalletWasabi.Fluent.ViewModels.Wallets.Home.History;
using WalletWasabi.Wallets;
namespace WalletWasabi.Fluent.ViewModels.Wallets.Advanced;
@@ -14,6 +16,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Advanced;
public partial class WalletStatsViewModel : RoutableViewModel
{
private readonly Wallet _wallet;
+ private readonly WalletViewModel _walletViewModel;
[AutoNotify] private int _coinCount;
[AutoNotify] private string _balance = "";
@@ -25,10 +28,14 @@ public partial class WalletStatsViewModel : RoutableViewModel
[AutoNotify] private int _generatedUsedKeyCount;
[AutoNotify] private int _largestExternalKeyGap;
[AutoNotify] private int _largestInternalKeyGap;
+ [AutoNotify] private int _totalTransactionCount;
+ [AutoNotify] private int _transactionCount;
+ [AutoNotify] private int _coinjoinCount;
- public WalletStatsViewModel(WalletViewModelBase walletViewModelBase)
+ public WalletStatsViewModel(WalletViewModel walletViewModel)
{
- _wallet = walletViewModelBase.Wallet;
+ _wallet = walletViewModel.Wallet;
+ _walletViewModel = walletViewModel;
UpdateProps();
@@ -66,5 +73,9 @@ public partial class WalletStatsViewModel : RoutableViewModel
LargestExternalKeyGap = _wallet.KeyManager.CountConsecutiveUnusedKeys(isInternal: false, ignoreTail: true);
LargestInternalKeyGap = _wallet.KeyManager.CountConsecutiveUnusedKeys(isInternal: true, ignoreTail: true);
+
+ TotalTransactionCount = _walletViewModel.History.Transactions.Count;
+ TransactionCount = _walletViewModel.History.Transactions.Count(x => !x.IsCoinJoin);
+ CoinjoinCount = _walletViewModel.History.Transactions.Count(x => x.IsCoinJoin);
}
}

MODIFY
WalletWasabi.Fluent/Views/Wallets/Advanced/WalletStatsView.axaml
WalletWasabi.Fluent/Views/Wallets/Advanced/WalletStatsView.axaml
TextValue="{Binding Balance}">
<c:PrivacyContentControl NumberOfPrivacyChars="11" Content="{Binding Balance, StringFormat={}{0} BTC, Mode=OneWay}" Classes="monoSpaced" />
</c:PreviewItem>
-
<Separator />
+ <c:PreviewItem Label="Total Number of Transactions"
+ TextValue="{Binding TotalTransactionCount}">
+ <c:PrivacyContentControl NumberOfPrivacyChars="11" Content="{Binding TotalTransactionCount, Mode=OneWay}" Classes="monoSpaced" />
+ </c:PreviewItem>
+ <Separator />
+ <c:PreviewItem Label="Number of non-Coinjoin Transactions"
+ TextValue="{Binding TransactionCount}">
+ <c:PrivacyContentControl NumberOfPrivacyChars="11" Content="{Binding TransactionCount, Mode=OneWay}" Classes="monoSpaced" />
+ </c:PreviewItem>
+ <Separator />
+ <c:PreviewItem Label="Number of Coinjoin Transactions"
+ TextValue="{Binding CoinjoinCount}">
+ <c:PrivacyContentControl NumberOfPrivacyChars="11" Content="{Binding CoinjoinCount, Mode=OneWay}" Classes="monoSpaced" />
+ </c:PreviewItem>
+ <Separator />
+
<c:PreviewItem Label="Number of addresses"
TextValue="{Binding GeneratedKeyCount}">
<c:PrivacyContentControl Classes="monoSpaced"

Add transaction counters in wallet stats