Class FeeService
- Namespace
- NLightning.Application.NLTG.Services
- Assembly
- NLightning.Application.NLTG.dll
public class FeeService : IFeeService
- Inheritance
-
FeeService
- Implements
- Inherited Members
Constructors
FeeService(IOptions<FeeEstimationOptions>, HttpClient, ILogger<FeeService>)
public FeeService(IOptions<FeeEstimationOptions> feeOptions, HttpClient httpClient, ILogger<FeeService> logger)
Parameters
feeOptions
IOptions<FeeEstimationOptions>httpClient
HttpClientlogger
ILogger<FeeService>
Methods
GetCachedFeeRatePerKw()
Gets the current cached fee rate without checking API
public LightningMoney GetCachedFeeRatePerKw()
Returns
GetFeeRatePerKwAsync(CancellationToken)
Gets the current fee rate in satoshis per kiloweight (sat/kW)
public Task<LightningMoney> GetFeeRatePerKwAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationToken
Returns
RefreshFeeRateAsync(CancellationToken)
Forces a refresh of the fee rate from the API
public Task RefreshFeeRateAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationToken
Returns
StartAsync(CancellationToken)
Starts a background task to periodically refresh the fee rate
public Task StartAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationToken
Returns
StopAsync()
Stops the background task and cancels any ongoing operations within the service.
public Task StopAsync()
Returns
- Task
A task representing the asynchronous stop operation.