pub enum Event {
PaymentSuccessful {
payment_id: Option<PaymentId>,
payment_hash: PaymentHash,
fee_paid_msat: Option<u64>,
},
PaymentFailed {
payment_id: Option<PaymentId>,
payment_hash: PaymentHash,
reason: Option<PaymentFailureReason>,
},
PaymentReceived {
payment_id: Option<PaymentId>,
payment_hash: PaymentHash,
amount_msat: u64,
},
PaymentClaimable {
payment_id: PaymentId,
payment_hash: PaymentHash,
claimable_amount_msat: u64,
claim_deadline: Option<u32>,
},
ChannelPending {
channel_id: ChannelId,
user_channel_id: UserChannelId,
former_temporary_channel_id: ChannelId,
counterparty_node_id: PublicKey,
funding_txo: OutPoint,
},
ChannelReady {
channel_id: ChannelId,
user_channel_id: UserChannelId,
counterparty_node_id: Option<PublicKey>,
},
ChannelClosed {
channel_id: ChannelId,
user_channel_id: UserChannelId,
counterparty_node_id: Option<PublicKey>,
reason: Option<ClosureReason>,
},
}
Expand description
An event emitted by Node
, which should be handled by the user.
Variants§
PaymentSuccessful
A sent payment was successful.
Fields
payment_id: Option<PaymentId>
A local identifier used to track the payment.
Will only be None
for events serialized with LDK Node v0.2.1 or prior.
payment_hash: PaymentHash
The hash of the payment.
PaymentFailed
A sent payment has failed.
Fields
payment_id: Option<PaymentId>
A local identifier used to track the payment.
Will only be None
for events serialized with LDK Node v0.2.1 or prior.
payment_hash: PaymentHash
The hash of the payment.
reason: Option<PaymentFailureReason>
The reason why the payment failed.
This will be None
for events serialized by LDK Node v0.2.1 and prior.
PaymentReceived
A payment has been received.
Fields
payment_id: Option<PaymentId>
A local identifier used to track the payment.
Will only be None
for events serialized with LDK Node v0.2.1 or prior.
payment_hash: PaymentHash
The hash of the payment.
PaymentClaimable
A payment for a previously-registered payment hash has been received.
This needs to be manually claimed by supplying the correct preimage to claim_for_hash
.
If the the provided parameters don’t match the expectations or the preimage can’t be
retrieved in time, should be failed-back via fail_for_hash
.
Note claiming will necessarily fail after the claim_deadline
has been reached.
Fields
payment_hash: PaymentHash
The hash of the payment.
ChannelPending
A channel has been created and is pending confirmation on-chain.
Fields
user_channel_id: UserChannelId
The user_channel_id
of the channel.
ChannelReady
A channel is ready to be used.
Fields
user_channel_id: UserChannelId
The user_channel_id
of the channel.
ChannelClosed
A channel has been closed.
Fields
user_channel_id: UserChannelId
The user_channel_id
of the channel.
counterparty_node_id: Option<PublicKey>
The node_id
of the channel counterparty.
This will be None
for events serialized by LDK Node v0.1.0 and prior.
reason: Option<ClosureReason>
This will be None
for events serialized by LDK Node v0.2.1 and prior.
Trait Implementations§
source§impl PartialEq for Event
impl PartialEq for Event
source§impl Writeable for Event
impl Writeable for Event
impl Eq for Event
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more