Class HtlcDbRepository
- Namespace
- NLightning.Infrastructure.Repositories.Database.Channel
- Assembly
- NLightning.Infrastructure.Repositories.dll
public class HtlcDbRepository : BaseDbRepository<HtlcEntity>, IHtlcDbRepository
- Inheritance
-
HtlcDbRepository
- Implements
- Inherited Members
Constructors
HtlcDbRepository(NLightningDbContext, IMessageSerializer)
public HtlcDbRepository(NLightningDbContext context, IMessageSerializer messageSerializer)
Parameters
context
NLightningDbContextmessageSerializer
IMessageSerializer
Methods
AddAsync(ChannelId, Htlc)
Adds a new HTLC to a channel
public Task AddAsync(ChannelId channelId, Htlc htlc)
Parameters
Returns
DeleteAllForChannelId(ChannelId)
Deletes all HTLCs for a channel
public void DeleteAllForChannelId(ChannelId channelId)
Parameters
channelId
ChannelIdChannel ID
DeleteAsync(ChannelId, ulong, HtlcDirection)
Deletes an HTLC
public Task DeleteAsync(ChannelId channelId, ulong htlcId, HtlcDirection direction)
Parameters
channelId
ChannelIdChannel ID
htlcId
ulongHTLC ID
direction
HtlcDirectionHTLC direction (incoming/outgoing)
Returns
GetAllForChannelAsync(ChannelId)
Gets all HTLCs for a channel
public Task<IEnumerable<Htlc>> GetAllForChannelAsync(ChannelId channelId)
Parameters
channelId
ChannelIdChannel ID
Returns
- Task<IEnumerable<Htlc>>
Collection of HTLCs
GetByChannelIdAndDirectionAsync(ChannelId, HtlcDirection)
Gets HTLCs for a channel with a specific direction
public Task<IEnumerable<Htlc>> GetByChannelIdAndDirectionAsync(ChannelId channelId, HtlcDirection direction)
Parameters
channelId
ChannelIdChannel ID
direction
HtlcDirectionHTLC direction (incoming/outgoing)
Returns
- Task<IEnumerable<Htlc>>
Collection of HTLCs matching the direction
GetByChannelIdAndStateAsync(ChannelId, HtlcState)
Gets HTLCs for a channel with a specific state
public Task<IEnumerable<Htlc>> GetByChannelIdAndStateAsync(ChannelId channelId, HtlcState state)
Parameters
Returns
- Task<IEnumerable<Htlc>>
Collection of HTLCs matching the state
GetByIdAsync(ChannelId, ulong, HtlcDirection)
Gets a specific HTLC
public Task<Htlc?> GetByIdAsync(ChannelId channelId, ulong htlcId, HtlcDirection direction)
Parameters
channelId
ChannelIdChannel ID
htlcId
ulongHTLC ID
direction
HtlcDirectionHTLC direction (incoming/outgoing)
Returns
UpdateAsync(ChannelId, Htlc)
Updates an existing HTLC
public Task UpdateAsync(ChannelId channelId, Htlc htlc)