add initial changes for fee selection ux changes.
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendFeeViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendFeeViewModel.cs
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Reactive.Concurrency;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Threading.Tasks;
@@ -39,9 +40,11 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
[AutoNotify] private int _sliderValue;
private bool _updatingCurrentValue;
private double _lastConfirmationTarget;
+ private bool _isSilent;
- public SendFeeViewModel(Wallet wallet, TransactionInfo transactionInfo)
+ public SendFeeViewModel(Wallet wallet, TransactionInfo transactionInfo, bool isSilent)
{
+ _isSilent = isSilent;
_wallet = wallet;
_transactionInfo = transactionInfo;
@@ -116,6 +119,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
CurrentConfirmationTarget = _lastConfirmationTarget;
var feeProvider = _wallet.FeeProvider;
+
Observable
.FromEventPattern(feeProvider, nameof(feeProvider.AllFeeEstimateChanged))
.Select(x => (x.EventArgs as AllFeeEstimate)!.Estimations)
@@ -130,6 +134,22 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
UpdateFeeEstimates(_wallet.Network == Network.TestNet ? TestNetFeeEstimates : feeProvider.AllFeeEstimate.Estimations);
}
+ else
+ {
+ // TODO What to do?
+ }
+
+ if (_isSilent)
+ {
+ RxApp.MainThreadScheduler.Schedule(async () =>
+ {
+ // TODO implement algorithm to intelligently select fees.
+ _lastConfirmationTarget = 1;
+ _transactionInfo.ConfirmationTimeSpan = CalculateConfirmationTime(_lastConfirmationTarget);
+
+ await OnNextAsync();
+ });
+ }
}
private async Task BuildTransactionAsNormalAsync(TransactionInfo transactionInfo, Money totalMixedCoinsAmount)

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
@@ -117,7 +117,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
NextCommand = ReactiveCommand.Create(() =>
{
- Navigate().To(new SendFeeViewModel(_wallet, _transactionInfo));
+ Navigate().To(new SendFeeViewModel(_wallet, _transactionInfo, true));
}, nextCommandCanExecute);
EnableAutoBusyOn(NextCommand);

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
using System;
using System.Reactive.Disposables;
using System.Threading.Tasks;
+using System.Windows.Input;
using NBitcoin;
using ReactiveUI;
using WalletWasabi.Blockchain.Analysis.Clustering;
@@ -71,6 +72,10 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
_nextButtonText = "Confirm";
}
+ AdjustFeeCommand = ReactiveCommand.Create(() =>
+ {
+ Navigate().To(new SendFeeViewModel(wallet, info, false));
+ });
}
public bool PreferPsbtWorkflow => _wallet.KeyManager.PreferPsbtWorkflow;
@@ -85,6 +90,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
public bool IsPayJoin { get; }
+ public ICommand AdjustFeeCommand { get; }
+
protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
{
base.OnNavigatedTo(isInHistory, disposables);

add initial changes for fee selection ux changes.