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
TMessageThe 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
messageTMessageThe message to handle
currentStateChannelStateThe current state of the channel
negotiatedFeaturesFeatureOptionsFeatures negotiated with the peer
peerPubKeyCompactPubKeyThe public key of the peer
Returns
- Task<IChannelMessage>
A response message if needed, or null if no response is needed