Ignore privacy suggestions that changes the amount when the send txn is from a URL.
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacySuggestionsFlyoutViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacySuggestionsFlyoutViewModel.cs
@@ -33,7 +33,8 @@ public partial class PrivacySuggestionsFlyoutViewModel : ViewModelBase
public ObservableCollection<SuggestionViewModel> Suggestions { get; }
- public async Task BuildPrivacySuggestionsAsync(Wallet wallet, TransactionInfo info, BitcoinAddress destination, BuildTransactionResult transaction)
+ public async Task BuildPrivacySuggestionsAsync(Wallet wallet, TransactionInfo info, BitcoinAddress destination,
+ BuildTransactionResult transaction, bool isFixedAmount)
{
IsLoading = true;
@@ -50,7 +51,7 @@ public partial class PrivacySuggestionsFlyoutViewModel : ViewModelBase
var hasChange = transaction.InnerWalletOutputs.Any(x => x.ScriptPubKey != destination.ScriptPubKey);
- if (hasChange)
+ if (hasChange && !isFixedAmount)
{
foreach (var suggestion in suggestions)
{

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
@@ -111,7 +111,7 @@ public partial class SendViewModel : RoutableViewModel
{
_transactionInfo.Amount = new Money(AmountBtc, MoneyUnit.BTC);
- Navigate().To(new TransactionPreviewViewModel(wallet, _transactionInfo, _currentAddress));
+ Navigate().To(new TransactionPreviewViewModel(wallet, _transactionInfo, _currentAddress, _isFixedAmount));
}
}, nextCommandCanExecute);
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -23,6 +23,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send;
[NavigationMetaData(Title = "Transaction Preview")]
public partial class TransactionPreviewViewModel : RoutableViewModel
{
+ private readonly bool _isFixedAmount;
private readonly Wallet _wallet;
private readonly TransactionInfo _info;
private readonly BitcoinAddress _destination;
@@ -31,11 +32,12 @@ public partial class TransactionPreviewViewModel : RoutableViewModel
[AutoNotify] private bool _adjustFeeAvailable;
[AutoNotify] private TransactionSummaryViewModel? _displayedTransactionSummary;
- public TransactionPreviewViewModel(Wallet wallet, TransactionInfo info, BitcoinAddress destination)
+ public TransactionPreviewViewModel(Wallet wallet, TransactionInfo info, BitcoinAddress destination, bool isFixedAmount)
{
_wallet = wallet;
_info = info;
_destination = destination;
+ _isFixedAmount = isFixedAmount;
PrivacySuggestions = new PrivacySuggestionsFlyoutViewModel();
CurrentTransactionSummary = new TransactionSummaryViewModel(this, _wallet, _info, destination);
@@ -72,7 +74,7 @@ public partial class TransactionPreviewViewModel : RoutableViewModel
{
UpdateTransaction(CurrentTransactionSummary, ca.TransactionResult);
- await PrivacySuggestions.BuildPrivacySuggestionsAsync(_wallet, _info, _destination, ca.TransactionResult);
+ await PrivacySuggestions.BuildPrivacySuggestionsAsync(_wallet, _info, _destination, ca.TransactionResult, _isFixedAmount);
}
else if (x is PocketSuggestionViewModel)
{
@@ -187,7 +189,7 @@ public partial class TransactionPreviewViewModel : RoutableViewModel
{
UpdateTransaction(CurrentTransactionSummary, newTransaction);
- await PrivacySuggestions.BuildPrivacySuggestionsAsync(_wallet, _info, _destination, newTransaction);
+ await PrivacySuggestions.BuildPrivacySuggestionsAsync(_wallet, _info, _destination, newTransaction, _isFixedAmount);
}
}
@@ -392,7 +394,7 @@ public partial class TransactionPreviewViewModel : RoutableViewModel
{
UpdateTransaction(CurrentTransactionSummary, initialTransaction);
- await PrivacySuggestions.BuildPrivacySuggestionsAsync(_wallet, _info, _destination, initialTransaction);
+ await PrivacySuggestions.BuildPrivacySuggestionsAsync(_wallet, _info, _destination, initialTransaction, _isFixedAmount);
}
else
{

Ignore privacy suggestions that changes the amount when the send txn is from a URL.