@@ -46,6 +46,12 @@ static Event constr_from_ptr(long ptr) {
4646 if (raw_val .getClass () == bindings .LDKEvent .PaymentPathFailed .class ) {
4747 return new PaymentPathFailed (ptr , (bindings .LDKEvent .PaymentPathFailed )raw_val );
4848 }
49+ if (raw_val .getClass () == bindings .LDKEvent .ProbeSuccessful .class ) {
50+ return new ProbeSuccessful (ptr , (bindings .LDKEvent .ProbeSuccessful )raw_val );
51+ }
52+ if (raw_val .getClass () == bindings .LDKEvent .ProbeFailed .class ) {
53+ return new ProbeFailed (ptr , (bindings .LDKEvent .ProbeFailed )raw_val );
54+ }
4955 if (raw_val .getClass () == bindings .LDKEvent .PendingHTLCsForwardable .class ) {
5056 return new PendingHTLCsForwardable (ptr , (bindings .LDKEvent .PendingHTLCsForwardable )raw_val );
5157 }
@@ -64,6 +70,9 @@ static Event constr_from_ptr(long ptr) {
6470 if (raw_val .getClass () == bindings .LDKEvent .OpenChannelRequest .class ) {
6571 return new OpenChannelRequest (ptr , (bindings .LDKEvent .OpenChannelRequest )raw_val );
6672 }
73+ if (raw_val .getClass () == bindings .LDKEvent .HTLCHandlingFailed .class ) {
74+ return new HTLCHandlingFailed (ptr , (bindings .LDKEvent .HTLCHandlingFailed )raw_val );
75+ }
6776 assert false ; return null ; // Unreachable without extending the (internal) bindings interface
6877 }
6978
@@ -449,6 +458,90 @@ private PaymentPathFailed(long ptr, bindings.LDKEvent.PaymentPathFailed obj) {
449458 this .retry = retry_hu_conv ;
450459 }
451460 }
461+ /**
462+ * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
463+ */
464+ public final static class ProbeSuccessful extends Event {
465+ /**
466+ * The id returned by [`ChannelManager::send_probe`].
467+ *
468+ * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
469+ */
470+ public final byte [] payment_id ;
471+ /**
472+ * The hash generated by [`ChannelManager::send_probe`].
473+ *
474+ * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
475+ */
476+ public final byte [] payment_hash ;
477+ /**
478+ * The payment path that was successful.
479+ */
480+ public final RouteHop [] path ;
481+ private ProbeSuccessful (long ptr , bindings .LDKEvent .ProbeSuccessful obj ) {
482+ super (null , ptr );
483+ this .payment_id = obj .payment_id ;
484+ this .payment_hash = obj .payment_hash ;
485+ long [] path = obj .path ;
486+ int path_conv_10_len = path .length ;
487+ RouteHop [] path_conv_10_arr = new RouteHop [path_conv_10_len ];
488+ for (int k = 0 ; k < path_conv_10_len ; k ++) {
489+ long path_conv_10 = path [k ];
490+ 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 ); }
491+ path_conv_10_hu_conv .ptrs_to .add (this );
492+ path_conv_10_arr [k ] = path_conv_10_hu_conv ;
493+ }
494+ this .path = path_conv_10_arr ;
495+ }
496+ }
497+ /**
498+ * Indicates that a probe payment we sent failed at an intermediary node on the path.
499+ */
500+ public final static class ProbeFailed extends Event {
501+ /**
502+ * The id returned by [`ChannelManager::send_probe`].
503+ *
504+ * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
505+ */
506+ public final byte [] payment_id ;
507+ /**
508+ * The hash generated by [`ChannelManager::send_probe`].
509+ *
510+ * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
511+ */
512+ public final byte [] payment_hash ;
513+ /**
514+ * The payment path that failed.
515+ */
516+ public final RouteHop [] path ;
517+ /**
518+ * The channel responsible for the failed probe.
519+ *
520+ * Note that for route hints or for the first hop in a path this may be an SCID alias and
521+ * may not refer to a channel in the public network graph. These aliases may also collide
522+ * with channels in the public network graph.
523+ */
524+ public final org .ldk .structs .Option_u64Z short_channel_id ;
525+ private ProbeFailed (long ptr , bindings .LDKEvent .ProbeFailed obj ) {
526+ super (null , ptr );
527+ this .payment_id = obj .payment_id ;
528+ this .payment_hash = obj .payment_hash ;
529+ long [] path = obj .path ;
530+ int path_conv_10_len = path .length ;
531+ RouteHop [] path_conv_10_arr = new RouteHop [path_conv_10_len ];
532+ for (int k = 0 ; k < path_conv_10_len ; k ++) {
533+ long path_conv_10 = path [k ];
534+ 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 ); }
535+ path_conv_10_hu_conv .ptrs_to .add (this );
536+ path_conv_10_arr [k ] = path_conv_10_hu_conv ;
537+ }
538+ this .path = path_conv_10_arr ;
539+ long short_channel_id = obj .short_channel_id ;
540+ org .ldk .structs .Option_u64Z short_channel_id_hu_conv = org .ldk .structs .Option_u64Z .constr_from_ptr (short_channel_id );
541+ short_channel_id_hu_conv .ptrs_to .add (this );
542+ this .short_channel_id = short_channel_id_hu_conv ;
543+ }
544+ }
452545 /**
453546 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
454547 * a time in the future.
@@ -675,6 +768,38 @@ private OpenChannelRequest(long ptr, bindings.LDKEvent.OpenChannelRequest obj) {
675768 this .channel_type = channel_type_hu_conv ;
676769 }
677770 }
771+ /**
772+ * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
773+ * forward it.
774+ *
775+ * Some scenarios where this event may be sent include:
776+ * Insufficient capacity in the outbound channel
777+ * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
778+ * When an unknown SCID is requested for forwarding a payment.
779+ * Claiming an amount for an MPP payment that exceeds the HTLC total
780+ * The HTLC has timed out
781+ *
782+ * This event, however, does not get generated if an HTLC fails to meet the forwarding
783+ * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
784+ */
785+ public final static class HTLCHandlingFailed extends Event {
786+ /**
787+ * The channel over which the HTLC was received.
788+ */
789+ public final byte [] prev_channel_id ;
790+ /**
791+ * Destination of the HTLC that failed to be processed.
792+ */
793+ public final org .ldk .structs .HTLCDestination failed_next_destination ;
794+ private HTLCHandlingFailed (long ptr , bindings .LDKEvent .HTLCHandlingFailed obj ) {
795+ super (null , ptr );
796+ this .prev_channel_id = obj .prev_channel_id ;
797+ long failed_next_destination = obj .failed_next_destination ;
798+ org .ldk .structs .HTLCDestination failed_next_destination_hu_conv = org .ldk .structs .HTLCDestination .constr_from_ptr (failed_next_destination );
799+ failed_next_destination_hu_conv .ptrs_to .add (this );
800+ this .failed_next_destination = failed_next_destination_hu_conv ;
801+ }
802+ }
678803 long clone_ptr () {
679804 long ret = bindings .Event_clone_ptr (this .ptr );
680805 Reference .reachabilityFence (this );
@@ -798,6 +923,35 @@ public static Event payment_path_failed(byte[] payment_id, byte[] payment_hash,
798923 return ret_hu_conv ;
799924 }
800925
926+ /**
927+ * Utility method to constructs a new ProbeSuccessful-variant Event
928+ */
929+ public static Event probe_successful (byte [] payment_id , byte [] payment_hash , RouteHop [] path ) {
930+ 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 & ~1 ).toArray () : null );
931+ Reference .reachabilityFence (payment_id );
932+ Reference .reachabilityFence (payment_hash );
933+ Reference .reachabilityFence (path );
934+ if (ret >= 0 && ret <= 4096 ) { return null ; }
935+ org .ldk .structs .Event ret_hu_conv = org .ldk .structs .Event .constr_from_ptr (ret );
936+ ret_hu_conv .ptrs_to .add (ret_hu_conv );
937+ return ret_hu_conv ;
938+ }
939+
940+ /**
941+ * Utility method to constructs a new ProbeFailed-variant Event
942+ */
943+ public static Event probe_failed (byte [] payment_id , byte [] payment_hash , RouteHop [] path , Option_u64Z short_channel_id ) {
944+ 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 & ~1 ).toArray () : null , short_channel_id .ptr );
945+ Reference .reachabilityFence (payment_id );
946+ Reference .reachabilityFence (payment_hash );
947+ Reference .reachabilityFence (path );
948+ Reference .reachabilityFence (short_channel_id );
949+ if (ret >= 0 && ret <= 4096 ) { return null ; }
950+ org .ldk .structs .Event ret_hu_conv = org .ldk .structs .Event .constr_from_ptr (ret );
951+ ret_hu_conv .ptrs_to .add (ret_hu_conv );
952+ return ret_hu_conv ;
953+ }
954+
801955 /**
802956 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
803957 */
@@ -880,6 +1034,19 @@ public static Event open_channel_request(byte[] temporary_channel_id, byte[] cou
8801034 return ret_hu_conv ;
8811035 }
8821036
1037+ /**
1038+ * Utility method to constructs a new HTLCHandlingFailed-variant Event
1039+ */
1040+ public static Event htlchandling_failed (byte [] prev_channel_id , HTLCDestination failed_next_destination ) {
1041+ long ret = bindings .Event_htlchandling_failed (InternalUtils .check_arr_len (prev_channel_id , 32 ), failed_next_destination .ptr );
1042+ Reference .reachabilityFence (prev_channel_id );
1043+ Reference .reachabilityFence (failed_next_destination );
1044+ if (ret >= 0 && ret <= 4096 ) { return null ; }
1045+ org .ldk .structs .Event ret_hu_conv = org .ldk .structs .Event .constr_from_ptr (ret );
1046+ ret_hu_conv .ptrs_to .add (ret_hu_conv );
1047+ return ret_hu_conv ;
1048+ }
1049+
8831050 /**
8841051 * Serialize the Event object into a byte array which can be read by Event_read
8851052 */
0 commit comments