add very basic change avoidance options.
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -34,6 +34,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
[AutoNotify] private string _nextButtonText;
[AutoNotify] private SmartLabel _labels;
[AutoNotify] private string _amountText;
+ [AutoNotify] private bool _transactionHasChange;
public TransactionPreviewViewModel(Wallet wallet, TransactionInfo info)
{
@@ -90,6 +91,17 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
UpdateTransaction(newTransaction);
}
});
+
+ AvoidChangeCommand = ReactiveCommand.CreateFromTask(async () =>
+ {
+ var optimisePrivacyDialog =
+ await NavigateDialogAsync(new OptimisePrivacyViewModel(wallet, info, _transaction!));
+
+ if (optimisePrivacyDialog.Kind == DialogResultKind.Normal && optimisePrivacyDialog.Result is { })
+ {
+ UpdateTransaction(optimisePrivacyDialog.Result);
+ }
+ });
}
public bool PreferPsbtWorkflow => _wallet.KeyManager.PreferPsbtWorkflow;
@@ -102,6 +114,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
public ICommand AdjustFeeCommand { get; }
+ public ICommand AvoidChangeCommand { get; }
+
private async Task InitialiseTransactionAsync()
{
var transactionInfo = _info;
@@ -180,7 +194,10 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
var btcFeeText = $"{fee.ToDecimal(MoneyUnit.Satoshi)} sats ";
var fiatFeeText = fee.ToDecimal(MoneyUnit.BTC)
.GenerateFiatText(_wallet.Synchronizer.UsdExchangeRate, "USD");
+
FeeText = $"{btcFeeText}{fiatFeeText}";
+
+ TransactionHasChange = _transaction.OuterWalletOutputs.Sum(x=>x.Amount) > fee && _transaction.InnerWalletOutputs.Sum(x=>x.Amount) > 0;
}
protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/TransactionPreviewView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/TransactionPreviewView.axaml
</c:PreviewItem>
<Separator IsVisible="{Binding IsPayJoin}" />
+ <c:PreviewItem Icon="{StaticResource lock_shield_regular}"
+ Text="You will receive change from this transaction."
+ IsVisible="{Binding TransactionHasChange}">
+ <Button Classes="activeHyperLink" Content="Avoid Change to improve privacy." HorizontalAlignment="Left" Command="{Binding AvoidChangeCommand}"/>
+ </c:PreviewItem>
+ <Separator IsVisible="{Binding TransactionHasChange}" />
+
<Panel>
<StackPanel Spacing="20">
<c:PreviewItem Icon="{StaticResource timer_regular}"

add very basic change avoidance options.