Add autocoinjoin setting
MODIFY
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/CoinJoinProfileViewModelBase.cs
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/CoinJoinProfileViewModelBase.cs
@@ -10,6 +10,7 @@ public abstract class CoinJoinProfileViewModelBase : ViewModelBase
public abstract IImage Icon { get; }
+ public virtual bool AutoCoinjoin { get; } = true;
public virtual int MinAnonScoreTarget { get; } = 5;
public virtual int MaxAnonScoreTarget { get; } = 10;

MODIFY
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/CoinJoinProfilesViewModel.cs
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/CoinJoinProfilesViewModel.cs
@@ -59,6 +59,7 @@ public partial class CoinJoinProfilesViewModel : RoutableViewModel
{
var selected = SelectedProfile ?? SelectedManualProfile ?? Profiles.First();
+ keyManager.AutoCoinJoin = selected.AutoCoinjoin;
keyManager.SetAnonScoreTargets(selected.MinAnonScoreTarget, selected.MaxAnonScoreTarget, toFile: false);
keyManager.SetFeeRateAverageTimeFrame(selected.FeeRateAverageTimeFrameHours, toFile: false);

MODIFY
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/ManualCoinJoinProfile.cs
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/ManualCoinJoinProfile.cs
@@ -5,8 +5,9 @@ namespace WalletWasabi.Fluent.ViewModels.CoinJoinProfiles;
public class ManualCoinJoinProfile : CoinJoinProfileViewModelBase
{
- public ManualCoinJoinProfile(int minAnonScoreTarget, int maxAnonScoreTarget, int feeRateAverageTimeFrameHours)
+ public ManualCoinJoinProfile(bool autoCoinjoin, int minAnonScoreTarget, int maxAnonScoreTarget, int feeRateAverageTimeFrameHours)
{
+ AutoCoinjoin = autoCoinjoin;
MinAnonScoreTarget = minAnonScoreTarget;
MaxAnonScoreTarget = maxAnonScoreTarget;
FeeRateAverageTimeFrameHours = feeRateAverageTimeFrameHours;
@@ -18,6 +19,7 @@ public class ManualCoinJoinProfile : CoinJoinProfileViewModelBase
public override IImage Icon => AssetHelpers.GetBitmapAsset($"avares://WalletWasabi.Fluent/Assets/WalletIcons/{ThemeHelper.CurrentTheme}/normal.png");
+ public override bool AutoCoinjoin { get; }
public override int MinAnonScoreTarget { get; }
public override int MaxAnonScoreTarget { get; }

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/ManualCoinJoinProfileDialogViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/ManualCoinJoinProfileDialogViewModel.cs
@@ -8,9 +8,10 @@ using WalletWasabi.Models;
namespace WalletWasabi.Fluent.ViewModels.Dialogs;
-[NavigationMetaData(Title = "Manual CoinJoin Profile")]
+[NavigationMetaData(Title = "Coinjoin Settings")]
public partial class ManualCoinJoinProfileDialogViewModel : DialogViewModelBase<ManualCoinJoinProfile?>
{
+ [AutoNotify] private bool _autoCoinjoin;
[AutoNotify] private string _minAnonScoreTarget;
[AutoNotify] private string _maxAnonScoreTarget;
[AutoNotify] private TimeFrameItem[] _timeFrames;
@@ -18,6 +19,7 @@ public partial class ManualCoinJoinProfileDialogViewModel : DialogViewModelBase<
public ManualCoinJoinProfileDialogViewModel(CoinJoinProfileViewModelBase current)
{
+ _autoCoinjoin = true;
_minAnonScoreTarget = current.MinAnonScoreTarget.ToString();
_maxAnonScoreTarget = current.MaxAnonScoreTarget.ToString();
_timeFrames = new[]
@@ -35,11 +37,12 @@ public partial class ManualCoinJoinProfileDialogViewModel : DialogViewModelBase<
NextCommand = ReactiveCommand.Create(() =>
{
+ var auto = AutoCoinjoin;
var min = int.Parse(MinAnonScoreTarget);
var max = int.Parse(MaxAnonScoreTarget);
var hours = (int)Math.Floor(SelectedTimeFrame.TimeFrame.TotalHours);
- Close(DialogResultKind.Normal, new ManualCoinJoinProfile(min, max, hours));
+ Close(DialogResultKind.Normal, new ManualCoinJoinProfile(auto, min, max, hours));
});
this.ValidateProperty(x => x.MinAnonScoreTarget, errors => ValidateInteger(MinAnonScoreTarget, nameof(MinAnonScoreTarget), errors));

MODIFY
WalletWasabi.Fluent/Views/Dialogs/ManualCoinJoinProfileDialogView.axaml
WalletWasabi.Fluent/Views/Dialogs/ManualCoinJoinProfileDialogView.axaml
<RowDefinition />
<RowDefinition />
<RowDefinition />
+ <RowDefinition />
</Grid.RowDefinitions>
- <TextBlock Grid.Row="0" Grid.Column="0" Text="MinAnonScoreTarget" />
- <TextBlock Grid.Row="1" Grid.Column="0" Text="MaxAnonScoreTarget" />
- <TextBlock Grid.Row="2" Grid.Column="0" Text="Average time frame" />
- <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding MinAnonScoreTarget}" />
- <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding MaxAnonScoreTarget}" />
- <ComboBox Grid.Row="2" Grid.Column="1" HorizontalAlignment="Stretch"
+ <TextBlock Grid.Row="0" Grid.Column="0" Text="Auto Coinjoin" />
+ <TextBlock Grid.Row="1" Grid.Column="0" Text="MinAnonScoreTarget" />
+ <TextBlock Grid.Row="2" Grid.Column="0" Text="MaxAnonScoreTarget" />
+ <TextBlock Grid.Row="3" Grid.Column="0" Text="Average time frame" />
+ <ToggleSwitch Grid.Row="0" Grid.Column="1" IsChecked="{Binding AutoCoinjoin}" />
+ <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding MinAnonScoreTarget}" />
+ <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding MaxAnonScoreTarget}" />
+ <ComboBox Grid.Row="3" Grid.Column="1" HorizontalAlignment="Stretch"
Items="{Binding TimeFrames}"
SelectedItem="{Binding SelectedTimeFrame}" />
</Grid>

Add autocoinjoin setting