hide adjust fee hyperlink when txn fees are low
MODIFY
WalletWasabi.Fluent/Helpers/TransactionFeeHelper.cs
WalletWasabi.Fluent/Helpers/TransactionFeeHelper.cs
using System;
using System.Collections.Generic;
+using System.Linq;
using NBitcoin;
using WalletWasabi.Wallets;
@@ -30,5 +31,15 @@ namespace WalletWasabi.Fluent.Helpers
[432] = 1,
[1008] = 1
};
+
+ public static bool AreTransactionFeesLow(Wallet wallet)
+ {
+ var feeEstimates = GetFeeEstimates(wallet);
+
+ var first = feeEstimates.First();
+ var last = feeEstimates.Last();
+
+ return first.Value != last.Value;
+ }
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -2,6 +2,7 @@ using System;
using System.Linq;
using System.Reactive.Concurrency;
using System.Reactive.Disposables;
+using System.Reactive.Linq;
using System.Threading.Tasks;
using System.Windows.Input;
using NBitcoin;
@@ -49,6 +50,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
AddressText = info.Address.ToString();
PayJoinUrl = info.PayJoinClient?.PaymentUrl.AbsoluteUri;
IsPayJoin = PayJoinUrl is not null;
+ AdjustFeeAvailable = TransactionFeeHelper.AreTransactionFeesLow(_wallet);
if (PreferPsbtWorkflow)
{
@@ -70,7 +72,6 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
AvoidChangeCommand = ReactiveCommand.CreateFromTask(OnAvoidChangeAsync);
ChangePocketsCommand = ReactiveCommand.CreateFromTask(OnChangePocketsAsync);
-
}
public bool PreferPsbtWorkflow => _wallet.KeyManager.PreferPsbtWorkflow;
@@ -296,6 +297,11 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
ConfirmationTimeText = $"Approximately {TextHelpers.TimeSpanToFriendlyString(_info.ConfirmationTimeSpan)} ";
+ Observable
+ .FromEventPattern(_wallet.FeeProvider, nameof(_wallet.FeeProvider.AllFeeEstimateChanged))
+ .Subscribe(_ => AdjustFeeAvailable = TransactionFeeHelper.AreTransactionFeesLow(_wallet))
+ .DisposeWith(disposables);
+
if (!isInHistory)
{
RxApp.MainThreadScheduler.Schedule(async () =>

hide adjust fee hyperlink when txn fees are low