Table of Contents

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 TMessage

The message to handle

currentState ChannelState

The current state of the channel

negotiatedFeatures FeatureOptions

Features negotiated with the peer

peerPubKey CompactPubKey

The public key of the peer

Returns

Task<IChannelMessage>

A response message if needed, or null if no response is needed