+ /**
+ * 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_without_broadcasting_txn`].
+ *
+ * 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_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
+ * [`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 through [`ChannelManager::accept_inbound_channel`] to accept,
+ * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
+ *
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
+ */
+ public final byte[] temporary_channel_id;
+ /**
+ * The node_id of the counterparty requesting to open the channel.
+ *
+ * When responding to the request, the `counterparty_node_id` should be passed
+ * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
+ * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
+ * request.
+ *
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
+ */
+ 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.
+ *
+ * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
+ * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
+ * 0.0.107. Channels setting this type also need to get manually accepted via
+ * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
+ * or will be rejected otherwise.
+ *
+ * [`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;
+ org.ldk.structs.ChannelTypeFeatures channel_type_hu_conv = null; if (channel_type < 0 || channel_type > 4096) { channel_type_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, channel_type); }
+ if (channel_type_hu_conv != null) { channel_type_hu_conv.ptrs_to.add(this); };
+ this.channel_type = channel_type_hu_conv;
+ }
+ }
+ /**
+ * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
+ * forward it.
+ *
+ * Some scenarios where this event may be sent include:
+ * Insufficient capacity in the outbound channel
+ * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
+ * When an unknown SCID is requested for forwarding a payment.
+ * Claiming an amount for an MPP payment that exceeds the HTLC total
+ * The HTLC has timed out
+ *
+ * This event, however, does not get generated if an HTLC fails to meet the forwarding
+ * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
+ */
+ public final static class HTLCHandlingFailed extends Event {
+ /**
+ * The channel over which the HTLC was received.
+ */
+ public final byte[] prev_channel_id;
+ /**
+ * Destination of the HTLC that failed to be processed.
+ */
+ public final org.ldk.structs.HTLCDestination failed_next_destination;
+ private HTLCHandlingFailed(long ptr, bindings.LDKEvent.HTLCHandlingFailed obj) {
+ super(null, ptr);
+ this.prev_channel_id = obj.prev_channel_id;
+ long failed_next_destination = obj.failed_next_destination;
+ org.ldk.structs.HTLCDestination failed_next_destination_hu_conv = org.ldk.structs.HTLCDestination.constr_from_ptr(failed_next_destination);
+ if (failed_next_destination_hu_conv != null) { failed_next_destination_hu_conv.ptrs_to.add(this); };
+ this.failed_next_destination = failed_next_destination_hu_conv;
+ }
+ }
+ long clone_ptr() {
+ long ret = bindings.Event_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+