Interface IChannelMessageHandler<TMessage>
- Namespace
- NLightning.Application.Channels.Handlers.Interfaces
- Assembly
- NLightning.Application.dll
Base interface for all channel message handlers
public interface IChannelMessageHandler<in TMessage> where TMessage : IChannelMessage
Type Parameters
TMessage
The type of message this handler can process
Methods
HandleAsync(TMessage, ChannelState, FeatureOptions, CompactPubKey)
Handles a channel message and returns a response message if needed
Task<IChannelMessage?> HandleAsync(TMessage message, ChannelState currentState, FeatureOptions negotiatedFeatures, CompactPubKey peerPubKey)
Parameters
message
TMessageThe message to handle
currentState
ChannelStateThe current state of the channel
negotiatedFeatures
FeatureOptionsFeatures negotiated with the peer
peerPubKey
CompactPubKeyThe public key of the peer
Returns
- Task<IChannelMessage>
A response message if needed, or null if no response is needed