+ /**
+ * Indicates that a path for an outbound payment was successful.
+ *
+ * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
+ * [`Event::PaymentSent`] for obtaining the payment preimage.
+ */
+ public final static class PaymentPathSuccessful extends Event {
+ /**
+ * The id returned by [`ChannelManager::send_payment`] and used with
+ * [`ChannelManager::retry_payment`].
+ *
+ * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+ * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
+ */
+ public final byte[] payment_id;
+ /**
+ * The hash that was given to [`ChannelManager::send_payment`].
+ *
+ * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ @Nullable public final byte[] payment_hash;
+ /**
+ * The payment path that was successful.
+ *
+ * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
+ */
+ public final RouteHop[] path;
+ private PaymentPathSuccessful(long ptr, bindings.LDKEvent.PaymentPathSuccessful obj) {
+ super(null, ptr);
+ this.payment_id = obj.payment_id;
+ this.payment_hash = obj.payment_hash;
+ long[] path = obj.path;
+ int path_conv_10_len = path.length;
+ RouteHop[] path_conv_10_arr = new RouteHop[path_conv_10_len];
+ for (int k = 0; k < path_conv_10_len; k++) {
+ long path_conv_10 = path[k];
+ RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new RouteHop(null, path_conv_10); }
+ path_conv_10_hu_conv.ptrs_to.add(this);
+ path_conv_10_arr[k] = path_conv_10_hu_conv;
+ }
+ this.path = path_conv_10_arr;
+ }
+ }
+ /**
+ * Indicates a request to open a new channel by a peer.
+ *
+ * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the
+ * request, call [`ChannelManager::force_close_channel`].
+ *
+ * The event is only triggered when a new open channel request is received and the
+ * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
+ *
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel
+ * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+ */
+ public final static class OpenChannelRequest extends Event {
+ /**
+ * The temporary channel ID of the channel requested to be opened.
+ *
+ * When responding to the request, the `temporary_channel_id` should be passed
+ * back to the ChannelManager with [`ChannelManager::accept_inbound_channel`] to accept,
+ * or to [`ChannelManager::force_close_channel`] to reject.
+ *
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel
+ */
+ public final byte[] temporary_channel_id;
+ /**
+ * The node_id of the counterparty requesting to open the channel.
+ */
+ public final byte[] counterparty_node_id;
+ /**
+ * The channel value of the requested channel.
+ */
+ public final long funding_satoshis;
+ /**
+ * Our starting balance in the channel if the request is accepted, in milli-satoshi.
+ */
+ public final long push_msat;
+ /**
+ * The features that this channel will operate with. If you reject the channel, a
+ * well-behaved counterparty may automatically re-attempt the channel with a new set of
+ * feature flags.
+ *
+ * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
+ * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
+ * 0.0.106.
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ */
+ public final org.ldk.structs.ChannelTypeFeatures channel_type;
+ private OpenChannelRequest(long ptr, bindings.LDKEvent.OpenChannelRequest obj) {
+ super(null, ptr);
+ this.temporary_channel_id = obj.temporary_channel_id;
+ this.counterparty_node_id = obj.counterparty_node_id;
+ this.funding_satoshis = obj.funding_satoshis;
+ this.push_msat = obj.push_msat;
+ long channel_type = obj.channel_type;
+ ChannelTypeFeatures channel_type_hu_conv = null; if (channel_type < 0 || channel_type > 4096) { channel_type_hu_conv = new ChannelTypeFeatures(null, channel_type); }
+ channel_type_hu_conv.ptrs_to.add(this);
+ this.channel_type = channel_type_hu_conv;
+ }
+ }
+ long clone_ptr() {
+ long ret = bindings.Event_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+