Table of Contents

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 HttpClient
logger ILogger<FeeService>

Methods

GetCachedFeeRatePerKw()

Gets the current cached fee rate without checking API

public LightningMoney GetCachedFeeRatePerKw()

Returns

LightningMoney

GetFeeRatePerKwAsync(CancellationToken)

Gets the current fee rate in satoshis per kiloweight (sat/kW)

public Task<LightningMoney> GetFeeRatePerKwAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<LightningMoney>

RefreshFeeRateAsync(CancellationToken)

Forces a refresh of the fee rate from the API

public Task RefreshFeeRateAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task

StartAsync(CancellationToken)

Starts a background task to periodically refresh the fee rate

public Task StartAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task

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.