+ long[] htlcs = obj.htlcs;
+ int htlcs_conv_13_len = htlcs.length;
+ ClaimedHTLC[] htlcs_conv_13_arr = new ClaimedHTLC[htlcs_conv_13_len];
+ for (int n = 0; n < htlcs_conv_13_len; n++) {
+ long htlcs_conv_13 = htlcs[n];
+ org.ldk.structs.ClaimedHTLC htlcs_conv_13_hu_conv = null; if (htlcs_conv_13 < 0 || htlcs_conv_13 > 4096) { htlcs_conv_13_hu_conv = new org.ldk.structs.ClaimedHTLC(null, htlcs_conv_13); }
+ if (htlcs_conv_13_hu_conv != null) { htlcs_conv_13_hu_conv.ptrs_to.add(this); };
+ htlcs_conv_13_arr[n] = htlcs_conv_13_hu_conv;
+ }
+ this.htlcs = htlcs_conv_13_arr;
+ long sender_intended_total_msat = obj.sender_intended_total_msat;
+ org.ldk.structs.Option_u64Z sender_intended_total_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(sender_intended_total_msat);
+ if (sender_intended_total_msat_hu_conv != null) { sender_intended_total_msat_hu_conv.ptrs_to.add(this); };
+ this.sender_intended_total_msat = sender_intended_total_msat_hu_conv;
+ }
+ }
+ /**
+ * Indicates that a peer connection with a node is needed in order to send an [`OnionMessage`].
+ *
+ * Typically, this happens when a [`MessageRouter`] is unable to find a complete path to a
+ * [`Destination`]. Once a connection is established, any messages buffered by an
+ * [`OnionMessageHandler`] may be sent.
+ *
+ * This event will not be generated for onion message forwards; only for sends including
+ * replies. Handlers should connect to the node otherwise any buffered messages may be lost.
+ *
+ * [`OnionMessage`]: msgs::OnionMessage
+ * [`MessageRouter`]: crate::onion_message::messenger::MessageRouter
+ * [`Destination`]: crate::onion_message::messenger::Destination
+ * [`OnionMessageHandler`]: crate::ln::msgs::OnionMessageHandler
+ */
+ public final static class ConnectionNeeded extends Event {
+ /**
+ * The node id for the node needing a connection.
+ */
+ public final byte[] node_id;
+ /**
+ * Sockets for connecting to the node.
+ */
+ public final SocketAddress[] addresses;
+ private ConnectionNeeded(long ptr, bindings.LDKEvent.ConnectionNeeded obj) {
+ super(null, ptr);
+ this.node_id = obj.node_id;
+ long[] addresses = obj.addresses;
+ int addresses_conv_15_len = addresses.length;
+ SocketAddress[] addresses_conv_15_arr = new SocketAddress[addresses_conv_15_len];
+ for (int p = 0; p < addresses_conv_15_len; p++) {
+ long addresses_conv_15 = addresses[p];
+ org.ldk.structs.SocketAddress addresses_conv_15_hu_conv = org.ldk.structs.SocketAddress.constr_from_ptr(addresses_conv_15);
+ if (addresses_conv_15_hu_conv != null) { addresses_conv_15_hu_conv.ptrs_to.add(this); };
+ addresses_conv_15_arr[p] = addresses_conv_15_hu_conv;
+ }
+ this.addresses = addresses_conv_15_arr;
+ }
+ }
+ /**
+ * Indicates a request for an invoice failed to yield a response in a reasonable amount of time
+ * or was explicitly abandoned by [`ChannelManager::abandon_payment`]. This may be for an
+ * [`InvoiceRequest`] sent for an [`Offer`] or for a [`Refund`] that hasn't been redeemed.
+ *
+ * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ * [`Offer`]: crate::offers::offer::Offer
+ * [`Refund`]: crate::offers::refund::Refund
+ */
+ public final static class InvoiceRequestFailed extends Event {
+ /**
+ * The `payment_id` to have been associated with payment for the requested invoice.
+ */
+ public final byte[] payment_id;
+ private InvoiceRequestFailed(long ptr, bindings.LDKEvent.InvoiceRequestFailed obj) {
+ super(null, ptr);
+ this.payment_id = obj.payment_id;