Skip to content

Commit

Permalink
Add RPC fee rates (#11350)
Browse files Browse the repository at this point in the history
  • Loading branch information
lontivero committed Aug 22, 2023
1 parent 9e9e043 commit 02efcd5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions WalletWasabi.Daemon/Rpc/WasabiJsonRpcService.cs
@@ -1,5 +1,6 @@
using NBitcoin;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading;
Expand Down Expand Up @@ -295,6 +296,18 @@ public void StopCoinJoining()
coinJoinManager.StopAsync(activeWallet, CancellationToken.None).ConfigureAwait(false);
}

[JsonRpcMethod("getfeerates", initializable: false)]
public object GetFeeRate()
{
if (Global.Synchronizer.LastAllFeeEstimate is { } nonNullFeeRates)
{
return nonNullFeeRates.Estimations;
}

return new Dictionary<int, int>();
}


private void SelectWallet(string walletName)
{
walletName = Guard.NotNullOrEmptyOrWhitespace(nameof(walletName), walletName);
Expand Down

0 comments on commit 02efcd5

Please sign in to comment.