Package org.ldk.structs
Class Event
- java.lang.Object
-
- org.ldk.structs.Event
-
- Direct Known Subclasses:
Event.ChannelClosed,Event.ChannelPending,Event.ChannelReady,Event.DiscardFunding,Event.FundingGenerationReady,Event.HTLCHandlingFailed,Event.HTLCIntercepted,Event.OpenChannelRequest,Event.PaymentClaimable,Event.PaymentClaimed,Event.PaymentFailed,Event.PaymentForwarded,Event.PaymentPathFailed,Event.PaymentPathSuccessful,Event.PaymentSent,Event.PendingHTLCsForwardable,Event.ProbeFailed,Event.ProbeSuccessful,Event.SpendableOutputs
public class Event extends Object
An Event which you should probably take some action in response to. Note that while Writeable and Readable are implemented for Event, you probably shouldn't use them directly as they don't round-trip exactly (for example FundingGenerationReady is never written as it makes no sense to respond to it after reconnecting to peers).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEvent.ChannelClosedUsed to indicate that a previously opened channel with the given `channel_id` is in the process of closure.static classEvent.ChannelPendingUsed to indicate that a channel with the given `channel_id` is being opened and pending confirmation on-chain.static classEvent.ChannelReadyUsed to indicate that a channel with the given `channel_id` is ready to be used.static classEvent.DiscardFundingUsed to indicate to the user that they can abandon the funding transaction and recycle the inputs for another purpose.static classEvent.FundingGenerationReadyUsed to indicate that the client should generate a funding transaction with the given parameters and then call [`ChannelManager::funding_transaction_generated`].static classEvent.HTLCHandlingFailedIndicates that the HTLC was accepted, but could not be processed when or after attempting to forward it.static classEvent.HTLCInterceptedUsed to indicate that we've intercepted an HTLC forward.static classEvent.OpenChannelRequestIndicates a request to open a new channel by a peer.static classEvent.PaymentClaimableIndicates that we've been offered a payment and it needs to be claimed via calling [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].static classEvent.PaymentClaimedIndicates a payment has been claimed and we've received money! This most likely occurs when [`ChannelManager::claim_funds`] has been called in response to an [`Event::PaymentClaimable`].static classEvent.PaymentFailedIndicates an outbound payment failed.static classEvent.PaymentForwardedThis event is generated when a payment has been successfully forwarded through us and a forwarding fee earned.static classEvent.PaymentPathFailedIndicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to handle the HTLC.static classEvent.PaymentPathSuccessfulIndicates that a path for an outbound payment was successful.static classEvent.PaymentSentIndicates an outbound payment we made succeeded (i.e.static classEvent.PendingHTLCsForwardableUsed to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at a time in the future.static classEvent.ProbeFailedIndicates that a probe payment we sent failed at an intermediary node on the path.static classEvent.ProbeSuccessfulIndicates that a probe payment we sent returned successful, i.e., only failed at the destination.static classEvent.SpendableOutputsUsed to indicate that an output which you should know how to spend was confirmed on chain and is now spendable.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Eventchannel_closed(byte[] channel_id, UInt128 user_channel_id, ClosureReason reason)Utility method to constructs a new ChannelClosed-variant Eventstatic Eventchannel_pending(byte[] channel_id, UInt128 user_channel_id, byte[] former_temporary_channel_id, byte[] counterparty_node_id, OutPoint funding_txo)Utility method to constructs a new ChannelPending-variant Eventstatic Eventchannel_ready(byte[] channel_id, UInt128 user_channel_id, byte[] counterparty_node_id, ChannelTypeFeatures channel_type)Utility method to constructs a new ChannelReady-variant EventEventclone()Creates a copy of the Eventstatic Eventdiscard_funding(byte[] channel_id, byte[] transaction)Utility method to constructs a new DiscardFunding-variant Eventbooleaneq(Event b)Checks if two Events contain equal inner contents.booleanequals(Object o)protected voidfinalize()static Eventfunding_generation_ready(byte[] temporary_channel_id, byte[] counterparty_node_id, long channel_value_satoshis, byte[] output_script, UInt128 user_channel_id)Utility method to constructs a new FundingGenerationReady-variant Eventstatic Eventhtlchandling_failed(byte[] prev_channel_id, HTLCDestination failed_next_destination)Utility method to constructs a new HTLCHandlingFailed-variant Eventstatic Eventhtlcintercepted(byte[] intercept_id, long requested_next_hop_scid, byte[] payment_hash, long inbound_amount_msat, long expected_outbound_amount_msat)Utility method to constructs a new HTLCIntercepted-variant Eventstatic Eventopen_channel_request(byte[] temporary_channel_id, byte[] counterparty_node_id, long funding_satoshis, long push_msat, ChannelTypeFeatures channel_type)Utility method to constructs a new OpenChannelRequest-variant Eventstatic Eventpayment_claimable(byte[] receiver_node_id, byte[] payment_hash, RecipientOnionFields onion_fields, long amount_msat, PaymentPurpose purpose, byte[] via_channel_id, Option_u128Z via_user_channel_id, Option_u32Z claim_deadline)Utility method to constructs a new PaymentClaimable-variant Eventstatic Eventpayment_claimed(byte[] receiver_node_id, byte[] payment_hash, long amount_msat, PaymentPurpose purpose)Utility method to constructs a new PaymentClaimed-variant Eventstatic Eventpayment_failed(byte[] payment_id, byte[] payment_hash, Option_PaymentFailureReasonZ reason)Utility method to constructs a new PaymentFailed-variant Eventstatic Eventpayment_forwarded(byte[] prev_channel_id, byte[] next_channel_id, Option_u64Z fee_earned_msat, boolean claim_from_onchain_tx, Option_u64Z outbound_amount_forwarded_msat)Utility method to constructs a new PaymentForwarded-variant Eventstatic Eventpayment_path_failed(byte[] payment_id, byte[] payment_hash, boolean payment_failed_permanently, PathFailure failure, Path path, Option_u64Z short_channel_id)Utility method to constructs a new PaymentPathFailed-variant Eventstatic Eventpayment_path_successful(byte[] payment_id, byte[] payment_hash, Path path)Utility method to constructs a new PaymentPathSuccessful-variant Eventstatic Eventpayment_sent(byte[] payment_id, byte[] payment_preimage, byte[] payment_hash, Option_u64Z fee_paid_msat)Utility method to constructs a new PaymentSent-variant Eventstatic Eventpending_htlcs_forwardable(long time_forwardable)Utility method to constructs a new PendingHTLCsForwardable-variant Eventstatic Eventprobe_failed(byte[] payment_id, byte[] payment_hash, Path path, Option_u64Z short_channel_id)Utility method to constructs a new ProbeFailed-variant Eventstatic Eventprobe_successful(byte[] payment_id, byte[] payment_hash, Path path)Utility method to constructs a new ProbeSuccessful-variant Eventstatic Eventspendable_outputs(SpendableOutputDescriptor[] outputs)Utility method to constructs a new SpendableOutputs-variant Eventbyte[]write()Serialize the Event object into a byte array which can be read by Event_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
funding_generation_ready
public static Event funding_generation_ready(byte[] temporary_channel_id, byte[] counterparty_node_id, long channel_value_satoshis, byte[] output_script, UInt128 user_channel_id)
Utility method to constructs a new FundingGenerationReady-variant Event
-
payment_claimable
public static Event payment_claimable(byte[] receiver_node_id, byte[] payment_hash, RecipientOnionFields onion_fields, long amount_msat, PaymentPurpose purpose, byte[] via_channel_id, Option_u128Z via_user_channel_id, Option_u32Z claim_deadline)
Utility method to constructs a new PaymentClaimable-variant Event
-
payment_claimed
public static Event payment_claimed(byte[] receiver_node_id, byte[] payment_hash, long amount_msat, PaymentPurpose purpose)
Utility method to constructs a new PaymentClaimed-variant Event
-
payment_sent
public static Event payment_sent(byte[] payment_id, byte[] payment_preimage, byte[] payment_hash, Option_u64Z fee_paid_msat)
Utility method to constructs a new PaymentSent-variant Event
-
payment_failed
public static Event payment_failed(byte[] payment_id, byte[] payment_hash, Option_PaymentFailureReasonZ reason)
Utility method to constructs a new PaymentFailed-variant Event
-
payment_path_successful
public static Event payment_path_successful(byte[] payment_id, byte[] payment_hash, Path path)
Utility method to constructs a new PaymentPathSuccessful-variant Event
-
payment_path_failed
public static Event payment_path_failed(byte[] payment_id, byte[] payment_hash, boolean payment_failed_permanently, PathFailure failure, Path path, Option_u64Z short_channel_id)
Utility method to constructs a new PaymentPathFailed-variant Event
-
probe_successful
public static Event probe_successful(byte[] payment_id, byte[] payment_hash, Path path)
Utility method to constructs a new ProbeSuccessful-variant Event
-
probe_failed
public static Event probe_failed(byte[] payment_id, byte[] payment_hash, Path path, Option_u64Z short_channel_id)
Utility method to constructs a new ProbeFailed-variant Event
-
pending_htlcs_forwardable
public static Event pending_htlcs_forwardable(long time_forwardable)
Utility method to constructs a new PendingHTLCsForwardable-variant Event
-
htlcintercepted
public static Event htlcintercepted(byte[] intercept_id, long requested_next_hop_scid, byte[] payment_hash, long inbound_amount_msat, long expected_outbound_amount_msat)
Utility method to constructs a new HTLCIntercepted-variant Event
-
spendable_outputs
public static Event spendable_outputs(SpendableOutputDescriptor[] outputs)
Utility method to constructs a new SpendableOutputs-variant Event
-
payment_forwarded
public static Event payment_forwarded(byte[] prev_channel_id, byte[] next_channel_id, Option_u64Z fee_earned_msat, boolean claim_from_onchain_tx, Option_u64Z outbound_amount_forwarded_msat)
Utility method to constructs a new PaymentForwarded-variant Event
-
channel_pending
public static Event channel_pending(byte[] channel_id, UInt128 user_channel_id, byte[] former_temporary_channel_id, byte[] counterparty_node_id, OutPoint funding_txo)
Utility method to constructs a new ChannelPending-variant Event
-
channel_ready
public static Event channel_ready(byte[] channel_id, UInt128 user_channel_id, byte[] counterparty_node_id, ChannelTypeFeatures channel_type)
Utility method to constructs a new ChannelReady-variant Event
-
channel_closed
public static Event channel_closed(byte[] channel_id, UInt128 user_channel_id, ClosureReason reason)
Utility method to constructs a new ChannelClosed-variant Event
-
discard_funding
public static Event discard_funding(byte[] channel_id, byte[] transaction)
Utility method to constructs a new DiscardFunding-variant Event
-
open_channel_request
public static Event open_channel_request(byte[] temporary_channel_id, byte[] counterparty_node_id, long funding_satoshis, long push_msat, ChannelTypeFeatures channel_type)
Utility method to constructs a new OpenChannelRequest-variant Event
-
htlchandling_failed
public static Event htlchandling_failed(byte[] prev_channel_id, HTLCDestination failed_next_destination)
Utility method to constructs a new HTLCHandlingFailed-variant Event
-
eq
public boolean eq(Event b)
Checks if two Events contain equal inner contents. This ignores pointers and is_owned flags and looks at the values in fields.
-
write
public byte[] write()
Serialize the Event object into a byte array which can be read by Event_read
-
-