Trait AsyncPaymentsMessageHandler
pub trait AsyncPaymentsMessageHandler {
// Required methods
fn held_htlc_available(
&self,
message: HeldHtlcAvailable,
responder: Option<Responder>,
) -> Option<(ReleaseHeldHtlc, ResponseInstruction)>;
fn release_held_htlc(&self, message: ReleaseHeldHtlc);
// Provided method
fn release_pending_messages(
&self,
) -> Vec<(AsyncPaymentsMessage, MessageSendInstructions)> { ... }
}
Expand description
A handler for an OnionMessage
containing an async payments message as its payload.
Required Methods§
fn held_htlc_available(
&self,
message: HeldHtlcAvailable,
responder: Option<Responder>,
) -> Option<(ReleaseHeldHtlc, ResponseInstruction)>
fn held_htlc_available( &self, message: HeldHtlcAvailable, responder: Option<Responder>, ) -> Option<(ReleaseHeldHtlc, ResponseInstruction)>
Handle a HeldHtlcAvailable
message. A ReleaseHeldHtlc
should be returned to release
the held funds.
fn release_held_htlc(&self, message: ReleaseHeldHtlc)
fn release_held_htlc(&self, message: ReleaseHeldHtlc)
Handle a ReleaseHeldHtlc
message. If authentication of the message succeeds, an HTLC
should be released to the corresponding payee.
Provided Methods§
fn release_pending_messages(
&self,
) -> Vec<(AsyncPaymentsMessage, MessageSendInstructions)>
fn release_pending_messages( &self, ) -> Vec<(AsyncPaymentsMessage, MessageSendInstructions)>
Release any AsyncPaymentsMessage
s that need to be sent.
Typically, this is used for messages initiating an async payment flow rather than in response to another message.