+ /**
+ * Indicates a [`ChannelMonitor`] update has failed. See
+ * [`ChannelMonitorUpdateErr::PermanentFailure`] for more information on how this is used.
+ *
+ * [`ChannelMonitorUpdateErr::PermanentFailure`]: super::ChannelMonitorUpdateErr::PermanentFailure
+ */
+ public final static class UpdateFailed extends MonitorEvent {
+ public final org.ldk.structs.OutPoint update_failed;
+ private UpdateFailed(long ptr, bindings.LDKMonitorEvent.UpdateFailed obj) {
+ super(null, ptr);
+ long update_failed = obj.update_failed;
+ OutPoint update_failed_hu_conv = null; if (update_failed < 0 || update_failed > 4096) { update_failed_hu_conv = new OutPoint(null, update_failed); }
+ update_failed_hu_conv.ptrs_to.add(this);
+ this.update_failed = update_failed_hu_conv;
+ }
+ }
+ long clone_ptr() {
+ long ret = bindings.MonitorEvent_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Creates a copy of the MonitorEvent
+ */
+ public MonitorEvent clone() {
+ long ret = bindings.MonitorEvent_clone(this.ptr);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.MonitorEvent ret_hu_conv = org.ldk.structs.MonitorEvent.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new HTLCEvent-variant MonitorEvent
+ */
+ public static MonitorEvent htlcevent(HTLCUpdate a) {
+ long ret = bindings.MonitorEvent_htlcevent(a == null ? 0 : a.ptr & ~1);
+ Reference.reachabilityFence(a);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.MonitorEvent ret_hu_conv = org.ldk.structs.MonitorEvent.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new CommitmentTxConfirmed-variant MonitorEvent
+ */
+ public static MonitorEvent commitment_tx_confirmed(OutPoint a) {
+ long ret = bindings.MonitorEvent_commitment_tx_confirmed(a == null ? 0 : a.ptr & ~1);
+ Reference.reachabilityFence(a);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.MonitorEvent ret_hu_conv = org.ldk.structs.MonitorEvent.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new UpdateCompleted-variant MonitorEvent
+ */
+ public static MonitorEvent update_completed(OutPoint funding_txo, long monitor_update_id) {
+ long ret = bindings.MonitorEvent_update_completed(funding_txo == null ? 0 : funding_txo.ptr & ~1, monitor_update_id);
+ Reference.reachabilityFence(funding_txo);
+ Reference.reachabilityFence(monitor_update_id);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.MonitorEvent ret_hu_conv = org.ldk.structs.MonitorEvent.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new UpdateFailed-variant MonitorEvent
+ */
+ public static MonitorEvent update_failed(OutPoint a) {
+ long ret = bindings.MonitorEvent_update_failed(a == null ? 0 : a.ptr & ~1);
+ Reference.reachabilityFence(a);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.MonitorEvent ret_hu_conv = org.ldk.structs.MonitorEvent.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
+ */
+ public byte[] write() {
+ byte[] ret = bindings.MonitorEvent_write(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+