Send: Build Transaction logic.
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/OptimisePrivacyViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/OptimisePrivacyViewModel.cs
@@ -58,10 +58,10 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
.Skip(1)
.Select(x => x.OutPoint));
- _privacySuggestions.Add(new PrivacySuggestionControlViewModel(smallerTransaction));
+ _privacySuggestions.Add(new PrivacySuggestionControlViewModel(smallerTransaction, PrivacyOptimisationLevel.Better, "Improved Privacy", "Save on Transaction Fee", "Send Less"));
}
- var exactSuggestion = new PrivacySuggestionControlViewModel(_requestedTransaction);
+ var exactSuggestion = new PrivacySuggestionControlViewModel(_requestedTransaction, PrivacyOptimisationLevel.Standard, "Send the Exact Amount");
_privacySuggestions.Add(exactSuggestion);
@@ -72,7 +72,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
allowUnconfirmed: true,
_requestedTransaction.SpentCoins.Select(x => x.OutPoint));
- _privacySuggestions.Add(new PrivacySuggestionControlViewModel(largerTransaction));
+ _privacySuggestions.Add(new PrivacySuggestionControlViewModel(largerTransaction, PrivacyOptimisationLevel.Better, "Improved Privacy", "Save on Transaction Fee"));
SelectedPrivacySuggestion = exactSuggestion;

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacySuggestionControlViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacySuggestionControlViewModel.cs
+using System.Linq;
using WalletWasabi.Blockchain.TransactionBuilding;
namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
@@ -12,9 +13,18 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
private readonly BuildTransactionResult _transactionResult;
- public PrivacySuggestionControlViewModel(BuildTransactionResult transactionResult)
+ public PrivacySuggestionControlViewModel(BuildTransactionResult transactionResult, PrivacyOptimisationLevel optimisationLevel, params string[] benefits)
{
_transactionResult = transactionResult;
+ _optimisationLevel = optimisationLevel;
+ _benefits = benefits;
+
+ var total = transactionResult.OuterWalletOutputs.Sum(x => x.Amount);
+ var fee = transactionResult.Fee;
+ var feePercent = transactionResult.FeePercentOfSent;
+
+ _title = $"{total} BTC";
+ _caption = $"Fee: {feePercent}% ({fee})";
}
[AutoNotify] private string _title;

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
@@ -68,6 +68,15 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
this.WhenAnyValue(x => x.AmountBtc)
.Subscribe(x => _transactionInfo.Amount = new Money(x, MoneyUnit.BTC));
+ this.WhenAnyValue(x => x.XAxisCurrentValue)
+ .Subscribe(x =>
+ {
+ if (x > 0)
+ {
+ _transactionInfo.FeeRate = new FeeRate(GetYAxisValueFromXAxisCurrentValue(x));
+ }
+ });
+
Labels.ToObservableChangeSet().Subscribe(x =>
{
_transactionInfo.Labels = new SmartLabel(_labels.ToArray());
@@ -92,9 +101,11 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
var transactionInfo = _transactionInfo;
var wallet = _owner.Wallet;
- var targetAnonset = wallet.ServiceConfiguration.GetMixUntilAnonymitySetValue();
- var mixedCoins = wallet.Coins.Where(x => x.HdPubKey.AnonymitySet >= targetAnonset);
+ var targetAnonymitySet = wallet.ServiceConfiguration.GetMixUntilAnonymitySetValue();
+ var mixedCoins = wallet.Coins.Where(x => x.HdPubKey.AnonymitySet >= targetAnonymitySet).ToList();
+ if (mixedCoins.Any())
+ {
var intent = new PaymentIntent(
destination: transactionInfo.Address,
amount: transactionInfo.Amount,
@@ -112,12 +123,15 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
// Private coins are enough.
Navigate().To(new OptimisePrivacyViewModel(wallet, transactionInfo, txRes));
+ return;
}
catch (NotEnoughFundsException)
{
- // Not enough private coins.
- Navigate().To(new PrivacyControlViewModel());
+ // Do Nothing
}
+ }
+
+ Navigate().To(new PrivacyControlViewModel());
});
}

Send: Build Transaction logic.