[Java] Update auto-generated Java files
[ldk-java] / src / main / java / org / ldk / structs / Event.java
index 3a9d799e6382268de68946928a4ae66834f46f68..8663e761b6baa87d1aed6729eb8f62247cdc5ed4 100644 (file)
@@ -46,6 +46,12 @@ public class Event extends CommonBase {
                if (raw_val.getClass() == bindings.LDKEvent.PaymentPathFailed.class) {
                        return new PaymentPathFailed(ptr, (bindings.LDKEvent.PaymentPathFailed)raw_val);
                }
+               if (raw_val.getClass() == bindings.LDKEvent.ProbeSuccessful.class) {
+                       return new ProbeSuccessful(ptr, (bindings.LDKEvent.ProbeSuccessful)raw_val);
+               }
+               if (raw_val.getClass() == bindings.LDKEvent.ProbeFailed.class) {
+                       return new ProbeFailed(ptr, (bindings.LDKEvent.ProbeFailed)raw_val);
+               }
                if (raw_val.getClass() == bindings.LDKEvent.PendingHTLCsForwardable.class) {
                        return new PendingHTLCsForwardable(ptr, (bindings.LDKEvent.PendingHTLCsForwardable)raw_val);
                }
@@ -64,6 +70,9 @@ public class Event extends CommonBase {
                if (raw_val.getClass() == bindings.LDKEvent.OpenChannelRequest.class) {
                        return new OpenChannelRequest(ptr, (bindings.LDKEvent.OpenChannelRequest)raw_val);
                }
+               if (raw_val.getClass() == bindings.LDKEvent.HTLCHandlingFailed.class) {
+                       return new HTLCHandlingFailed(ptr, (bindings.LDKEvent.HTLCHandlingFailed)raw_val);
+               }
                assert false; return null; // Unreachable without extending the (internal) bindings interface
        }
 
@@ -155,7 +164,7 @@ public class Event extends CommonBase {
                        this.amount_msat = obj.amount_msat;
                        long purpose = obj.purpose;
                        org.ldk.structs.PaymentPurpose purpose_hu_conv = org.ldk.structs.PaymentPurpose.constr_from_ptr(purpose);
-                       purpose_hu_conv.ptrs_to.add(this);
+                       if (purpose_hu_conv != null) { purpose_hu_conv.ptrs_to.add(this); };
                        this.purpose = purpose_hu_conv;
                }
        }
@@ -196,7 +205,7 @@ public class Event extends CommonBase {
                        this.amount_msat = obj.amount_msat;
                        long purpose = obj.purpose;
                        org.ldk.structs.PaymentPurpose purpose_hu_conv = org.ldk.structs.PaymentPurpose.constr_from_ptr(purpose);
-                       purpose_hu_conv.ptrs_to.add(this);
+                       if (purpose_hu_conv != null) { purpose_hu_conv.ptrs_to.add(this); };
                        this.purpose = purpose_hu_conv;
                }
        }
@@ -249,7 +258,7 @@ public class Event extends CommonBase {
                        this.payment_hash = obj.payment_hash;
                        long fee_paid_msat = obj.fee_paid_msat;
                        org.ldk.structs.Option_u64Z fee_paid_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(fee_paid_msat);
-                       fee_paid_msat_hu_conv.ptrs_to.add(this);
+                       if (fee_paid_msat_hu_conv != null) { fee_paid_msat_hu_conv.ptrs_to.add(this); };
                        this.fee_paid_msat = fee_paid_msat_hu_conv;
                }
        }
@@ -324,7 +333,7 @@ public class Event extends CommonBase {
                        for (int k = 0; k < path_conv_10_len; k++) {
                                long path_conv_10 = path[k];
                                org.ldk.structs.RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, path_conv_10); }
-                               path_conv_10_hu_conv.ptrs_to.add(this);
+                               if (path_conv_10_hu_conv != null) { 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;
@@ -362,7 +371,7 @@ public class Event extends CommonBase {
                 * the payment has failed, not just the route in question. If this is not set, you may
                 * retry the payment via a different route.
                */
-               public final boolean rejected_by_dest;
+               public final boolean payment_failed_permanently;
                /**
                 * Any failure information conveyed via the Onion return packet by a node along the failed
                 * payment route.
@@ -423,10 +432,10 @@ public class Event extends CommonBase {
                        super(null, ptr);
                        this.payment_id = obj.payment_id;
                        this.payment_hash = obj.payment_hash;
-                       this.rejected_by_dest = obj.rejected_by_dest;
+                       this.payment_failed_permanently = obj.payment_failed_permanently;
                        long network_update = obj.network_update;
                        org.ldk.structs.Option_NetworkUpdateZ network_update_hu_conv = org.ldk.structs.Option_NetworkUpdateZ.constr_from_ptr(network_update);
-                       network_update_hu_conv.ptrs_to.add(this);
+                       if (network_update_hu_conv != null) { network_update_hu_conv.ptrs_to.add(this); };
                        this.network_update = network_update_hu_conv;
                        this.all_paths_failed = obj.all_paths_failed;
                        long[] path = obj.path;
@@ -435,20 +444,104 @@ public class Event extends CommonBase {
                        for (int k = 0; k < path_conv_10_len; k++) {
                                long path_conv_10 = path[k];
                                org.ldk.structs.RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, path_conv_10); }
-                               path_conv_10_hu_conv.ptrs_to.add(this);
+                               if (path_conv_10_hu_conv != null) { 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;
                        long short_channel_id = obj.short_channel_id;
                        org.ldk.structs.Option_u64Z short_channel_id_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(short_channel_id);
-                       short_channel_id_hu_conv.ptrs_to.add(this);
+                       if (short_channel_id_hu_conv != null) { short_channel_id_hu_conv.ptrs_to.add(this); };
                        this.short_channel_id = short_channel_id_hu_conv;
                        long retry = obj.retry;
                        org.ldk.structs.RouteParameters retry_hu_conv = null; if (retry < 0 || retry > 4096) { retry_hu_conv = new org.ldk.structs.RouteParameters(null, retry); }
-                       retry_hu_conv.ptrs_to.add(this);
+                       if (retry_hu_conv != null) { retry_hu_conv.ptrs_to.add(this); };
                        this.retry = retry_hu_conv;
                }
        }
+       /**
+        * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
+        */
+       public final static class ProbeSuccessful extends Event {
+               /**
+                * The id returned by [`ChannelManager::send_probe`].
+                * 
+                * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
+               */
+               public final byte[] payment_id;
+               /**
+                * The hash generated by [`ChannelManager::send_probe`].
+                * 
+                * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
+               */
+               public final byte[] payment_hash;
+               /**
+                * The payment path that was successful.
+               */
+               public final RouteHop[] path;
+               private ProbeSuccessful(long ptr, bindings.LDKEvent.ProbeSuccessful 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];
+                               org.ldk.structs.RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, path_conv_10); }
+                               if (path_conv_10_hu_conv != null) { 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 that a probe payment we sent failed at an intermediary node on the path.
+        */
+       public final static class ProbeFailed extends Event {
+               /**
+                * The id returned by [`ChannelManager::send_probe`].
+                * 
+                * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
+               */
+               public final byte[] payment_id;
+               /**
+                * The hash generated by [`ChannelManager::send_probe`].
+                * 
+                * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
+               */
+               public final byte[] payment_hash;
+               /**
+                * The payment path that failed.
+               */
+               public final RouteHop[] path;
+               /**
+                * The channel responsible for the failed probe.
+                * 
+                * Note that for route hints or for the first hop in a path this may be an SCID alias and
+                * may not refer to a channel in the public network graph. These aliases may also collide
+                * with channels in the public network graph.
+               */
+               public final org.ldk.structs.Option_u64Z short_channel_id;
+               private ProbeFailed(long ptr, bindings.LDKEvent.ProbeFailed 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];
+                               org.ldk.structs.RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, path_conv_10); }
+                               if (path_conv_10_hu_conv != null) { 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;
+                       long short_channel_id = obj.short_channel_id;
+                       org.ldk.structs.Option_u64Z short_channel_id_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(short_channel_id);
+                       if (short_channel_id_hu_conv != null) { short_channel_id_hu_conv.ptrs_to.add(this); };
+                       this.short_channel_id = short_channel_id_hu_conv;
+               }
+       }
        /**
         * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
         * a time in the future.
@@ -488,7 +581,7 @@ public class Event extends CommonBase {
                        for (int b = 0; b < outputs_conv_27_len; b++) {
                                long outputs_conv_27 = outputs[b];
                                org.ldk.structs.SpendableOutputDescriptor outputs_conv_27_hu_conv = org.ldk.structs.SpendableOutputDescriptor.constr_from_ptr(outputs_conv_27);
-                               outputs_conv_27_hu_conv.ptrs_to.add(this);
+                               if (outputs_conv_27_hu_conv != null) { outputs_conv_27_hu_conv.ptrs_to.add(this); };
                                outputs_conv_27_arr[b] = outputs_conv_27_hu_conv;
                        }
                        this.outputs = outputs_conv_27_arr;
@@ -540,7 +633,7 @@ public class Event extends CommonBase {
                        this.next_channel_id = obj.next_channel_id;
                        long fee_earned_msat = obj.fee_earned_msat;
                        org.ldk.structs.Option_u64Z fee_earned_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(fee_earned_msat);
-                       fee_earned_msat_hu_conv.ptrs_to.add(this);
+                       if (fee_earned_msat_hu_conv != null) { fee_earned_msat_hu_conv.ptrs_to.add(this); };
                        this.fee_earned_msat = fee_earned_msat_hu_conv;
                        this.claim_from_onchain_tx = obj.claim_from_onchain_tx;
                }
@@ -577,7 +670,7 @@ public class Event extends CommonBase {
                        this.user_channel_id = obj.user_channel_id;
                        long reason = obj.reason;
                        org.ldk.structs.ClosureReason reason_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(reason);
-                       reason_hu_conv.ptrs_to.add(this);
+                       if (reason_hu_conv != null) { reason_hu_conv.ptrs_to.add(this); };
                        this.reason = reason_hu_conv;
                }
        }
@@ -604,13 +697,13 @@ public class Event extends CommonBase {
         * 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`].
+        * 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_channel`]: crate::ln::channelmanager::ChannelManager::force_close_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 {
@@ -619,10 +712,10 @@ public class Event extends CommonBase {
                 * 
                 * 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_channel`] to reject.
+                * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
                 * 
                 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
-                * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel
+                * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
                */
                public final byte[] temporary_channel_id;
                /**
@@ -630,11 +723,11 @@ public class Event extends CommonBase {
                 * 
                 * 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_channel`] to reject the
+                * 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_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel
+                * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
                */
                public final byte[] counterparty_node_id;
                /**
@@ -671,10 +764,42 @@ public class Event extends CommonBase {
                        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); }
-                       channel_type_hu_conv.ptrs_to.add(this);
+                       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);
@@ -689,7 +814,7 @@ public class Event extends CommonBase {
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(this);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
@@ -705,7 +830,7 @@ public class Event extends CommonBase {
                Reference.reachabilityFence(user_channel_id);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -719,7 +844,7 @@ public class Event extends CommonBase {
                Reference.reachabilityFence(purpose);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -733,7 +858,7 @@ public class Event extends CommonBase {
                Reference.reachabilityFence(purpose);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -748,7 +873,7 @@ public class Event extends CommonBase {
                Reference.reachabilityFence(fee_paid_msat);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -761,7 +886,7 @@ public class Event extends CommonBase {
                Reference.reachabilityFence(payment_hash);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -769,24 +894,25 @@ public class Event extends CommonBase {
         * Utility method to constructs a new PaymentPathSuccessful-variant Event
         */
        public static Event payment_path_successful(byte[] payment_id, byte[] payment_hash, RouteHop[] path) {
-               long ret = bindings.Event_payment_path_successful(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray() : null);
+               long ret = bindings.Event_payment_path_successful(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr).toArray() : null);
                Reference.reachabilityFence(payment_id);
                Reference.reachabilityFence(payment_hash);
                Reference.reachabilityFence(path);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+               for (RouteHop path_conv_10: path) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(path_conv_10); }; };
                return ret_hu_conv;
        }
 
        /**
         * Utility method to constructs a new PaymentPathFailed-variant Event
         */
-       public static Event payment_path_failed(byte[] payment_id, byte[] payment_hash, boolean rejected_by_dest, Option_NetworkUpdateZ network_update, boolean all_paths_failed, RouteHop[] path, Option_u64Z short_channel_id, RouteParameters retry) {
-               long ret = bindings.Event_payment_path_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), rejected_by_dest, network_update.ptr, all_paths_failed, path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray() : null, short_channel_id.ptr, retry == null ? 0 : retry.ptr & ~1);
+       public static Event payment_path_failed(byte[] payment_id, byte[] payment_hash, boolean payment_failed_permanently, Option_NetworkUpdateZ network_update, boolean all_paths_failed, RouteHop[] path, Option_u64Z short_channel_id, RouteParameters retry) {
+               long ret = bindings.Event_payment_path_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), payment_failed_permanently, network_update.ptr, all_paths_failed, path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr).toArray() : null, short_channel_id.ptr, retry == null ? 0 : retry.ptr);
                Reference.reachabilityFence(payment_id);
                Reference.reachabilityFence(payment_hash);
-               Reference.reachabilityFence(rejected_by_dest);
+               Reference.reachabilityFence(payment_failed_permanently);
                Reference.reachabilityFence(network_update);
                Reference.reachabilityFence(all_paths_failed);
                Reference.reachabilityFence(path);
@@ -794,7 +920,40 @@ public class Event extends CommonBase {
                Reference.reachabilityFence(retry);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+               for (RouteHop path_conv_10: path) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(path_conv_10); }; };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(retry); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new ProbeSuccessful-variant Event
+        */
+       public static Event probe_successful(byte[] payment_id, byte[] payment_hash, RouteHop[] path) {
+               long ret = bindings.Event_probe_successful(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr).toArray() : null);
+               Reference.reachabilityFence(payment_id);
+               Reference.reachabilityFence(payment_hash);
+               Reference.reachabilityFence(path);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+               for (RouteHop path_conv_10: path) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(path_conv_10); }; };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new ProbeFailed-variant Event
+        */
+       public static Event probe_failed(byte[] payment_id, byte[] payment_hash, RouteHop[] path, Option_u64Z short_channel_id) {
+               long ret = bindings.Event_probe_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr).toArray() : null, short_channel_id.ptr);
+               Reference.reachabilityFence(payment_id);
+               Reference.reachabilityFence(payment_hash);
+               Reference.reachabilityFence(path);
+               Reference.reachabilityFence(short_channel_id);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+               for (RouteHop path_conv_10: path) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(path_conv_10); }; };
                return ret_hu_conv;
        }
 
@@ -806,7 +965,7 @@ public class Event extends CommonBase {
                Reference.reachabilityFence(time_forwardable);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -818,7 +977,7 @@ public class Event extends CommonBase {
                Reference.reachabilityFence(outputs);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -833,7 +992,7 @@ public class Event extends CommonBase {
                Reference.reachabilityFence(claim_from_onchain_tx);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -847,7 +1006,7 @@ public class Event extends CommonBase {
                Reference.reachabilityFence(reason);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -860,7 +1019,7 @@ public class Event extends CommonBase {
                Reference.reachabilityFence(transaction);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
@@ -868,7 +1027,7 @@ public class Event extends CommonBase {
         * Utility method to constructs a new OpenChannelRequest-variant Event
         */
        public static Event open_channel_request(byte[] temporary_channel_id, byte[] counterparty_node_id, long funding_satoshis, long push_msat, ChannelTypeFeatures channel_type) {
-               long ret = bindings.Event_open_channel_request(InternalUtils.check_arr_len(temporary_channel_id, 32), InternalUtils.check_arr_len(counterparty_node_id, 33), funding_satoshis, push_msat, channel_type == null ? 0 : channel_type.ptr & ~1);
+               long ret = bindings.Event_open_channel_request(InternalUtils.check_arr_len(temporary_channel_id, 32), InternalUtils.check_arr_len(counterparty_node_id, 33), funding_satoshis, push_msat, channel_type == null ? 0 : channel_type.ptr);
                Reference.reachabilityFence(temporary_channel_id);
                Reference.reachabilityFence(counterparty_node_id);
                Reference.reachabilityFence(funding_satoshis);
@@ -876,7 +1035,21 @@ public class Event extends CommonBase {
                Reference.reachabilityFence(channel_type);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_type); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new HTLCHandlingFailed-variant Event
+        */
+       public static Event htlchandling_failed(byte[] prev_channel_id, HTLCDestination failed_next_destination) {
+               long ret = bindings.Event_htlchandling_failed(InternalUtils.check_arr_len(prev_channel_id, 32), failed_next_destination.ptr);
+               Reference.reachabilityFence(prev_channel_id);
+               Reference.reachabilityFence(failed_next_destination);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }