Interface IHtlcDbRepository
- Namespace
- NLightning.Domain.Channels.Interfaces
- Assembly
- NLightning.Domain.dll
Repository interface for managing HTLC (Hashed Time-Locked Contract) entities
public interface IHtlcDbRepository
Methods
AddAsync(ChannelId, Htlc)
Adds a new HTLC to a channel
Task AddAsync(ChannelId channelId, Htlc htlc)
Parameters
Returns
DeleteAllForChannelId(ChannelId)
Deletes all HTLCs for a channel
void DeleteAllForChannelId(ChannelId channelId)
Parameters
channelId
ChannelIdChannel ID
DeleteAsync(ChannelId, ulong, HtlcDirection)
Deletes an HTLC
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
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
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
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
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
Task UpdateAsync(ChannelId channelId, Htlc htlc)