[C#] Check in initial auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / MessageSendEvent.cs
diff --git a/c_sharp/src/org/ldk/structs/MessageSendEvent.cs b/c_sharp/src/org/ldk/structs/MessageSendEvent.cs
new file mode 100644 (file)
index 0000000..b1b4b9b
--- /dev/null
@@ -0,0 +1,713 @@
+using org.ldk.impl;
+using org.ldk.enums;
+using org.ldk.util;
+using System;
+
+namespace org { namespace ldk { namespace structs {
+
+/**
+ * An event generated by ChannelManager which indicates a message should be sent to a peer (or
+ * broadcast to most peers).
+ * These events are handled by PeerManager::process_events if you are using a PeerManager.
+ */
+public class MessageSendEvent : CommonBase {
+       protected MessageSendEvent(object _dummy, long ptr) : base(ptr) { }
+       ~MessageSendEvent() {
+               if (ptr != 0) { bindings.MessageSendEvent_free(ptr); }
+       }
+
+       internal static MessageSendEvent constr_from_ptr(long ptr) {
+               long raw_ty = bindings.LDKMessageSendEvent_ty_from_ptr(ptr);
+               switch (raw_ty) {
+                       case 0: return new MessageSendEvent_SendAcceptChannel(ptr);
+                       case 1: return new MessageSendEvent_SendOpenChannel(ptr);
+                       case 2: return new MessageSendEvent_SendFundingCreated(ptr);
+                       case 3: return new MessageSendEvent_SendFundingSigned(ptr);
+                       case 4: return new MessageSendEvent_SendChannelReady(ptr);
+                       case 5: return new MessageSendEvent_SendAnnouncementSignatures(ptr);
+                       case 6: return new MessageSendEvent_UpdateHTLCs(ptr);
+                       case 7: return new MessageSendEvent_SendRevokeAndACK(ptr);
+                       case 8: return new MessageSendEvent_SendClosingSigned(ptr);
+                       case 9: return new MessageSendEvent_SendShutdown(ptr);
+                       case 10: return new MessageSendEvent_SendChannelReestablish(ptr);
+                       case 11: return new MessageSendEvent_SendChannelAnnouncement(ptr);
+                       case 12: return new MessageSendEvent_BroadcastChannelAnnouncement(ptr);
+                       case 13: return new MessageSendEvent_BroadcastChannelUpdate(ptr);
+                       case 14: return new MessageSendEvent_SendChannelUpdate(ptr);
+                       case 15: return new MessageSendEvent_HandleError(ptr);
+                       case 16: return new MessageSendEvent_SendChannelRangeQuery(ptr);
+                       case 17: return new MessageSendEvent_SendShortIdsQuery(ptr);
+                       case 18: return new MessageSendEvent_SendReplyChannelRange(ptr);
+                       case 19: return new MessageSendEvent_SendGossipTimestampFilter(ptr);
+                       default:
+                               throw new ArgumentException("Impossible enum variant");
+               }
+       }
+
+       /** A MessageSendEvent of type SendAcceptChannel */
+       public class MessageSendEvent_SendAcceptChannel : MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+                */
+               public byte[] node_id;
+               /**
+                * The message which should be sent.
+                */
+               public AcceptChannel msg;
+               internal MessageSendEvent_SendAcceptChannel(long ptr) : base(null, ptr) {
+                       this.node_id = bindings.LDKMessageSendEvent_SendAcceptChannel_get_node_id(ptr);
+                       long msg = bindings.LDKMessageSendEvent_SendAcceptChannel_get_msg(ptr);
+                       org.ldk.structs.AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannel(null, msg); }
+                       if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.msg = msg_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type SendOpenChannel */
+       public class MessageSendEvent_SendOpenChannel : MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+                */
+               public byte[] node_id;
+               /**
+                * The message which should be sent.
+                */
+               public OpenChannel msg;
+               internal MessageSendEvent_SendOpenChannel(long ptr) : base(null, ptr) {
+                       this.node_id = bindings.LDKMessageSendEvent_SendOpenChannel_get_node_id(ptr);
+                       long msg = bindings.LDKMessageSendEvent_SendOpenChannel_get_msg(ptr);
+                       org.ldk.structs.OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannel(null, msg); }
+                       if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.msg = msg_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type SendFundingCreated */
+       public class MessageSendEvent_SendFundingCreated : MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+                */
+               public byte[] node_id;
+               /**
+                * The message which should be sent.
+                */
+               public FundingCreated msg;
+               internal MessageSendEvent_SendFundingCreated(long ptr) : base(null, ptr) {
+                       this.node_id = bindings.LDKMessageSendEvent_SendFundingCreated_get_node_id(ptr);
+                       long msg = bindings.LDKMessageSendEvent_SendFundingCreated_get_msg(ptr);
+                       org.ldk.structs.FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingCreated(null, msg); }
+                       if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.msg = msg_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type SendFundingSigned */
+       public class MessageSendEvent_SendFundingSigned : MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+                */
+               public byte[] node_id;
+               /**
+                * The message which should be sent.
+                */
+               public FundingSigned msg;
+               internal MessageSendEvent_SendFundingSigned(long ptr) : base(null, ptr) {
+                       this.node_id = bindings.LDKMessageSendEvent_SendFundingSigned_get_node_id(ptr);
+                       long msg = bindings.LDKMessageSendEvent_SendFundingSigned_get_msg(ptr);
+                       org.ldk.structs.FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingSigned(null, msg); }
+                       if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.msg = msg_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type SendChannelReady */
+       public class MessageSendEvent_SendChannelReady : MessageSendEvent {
+               /**
+                * The node_id of the node which should receive these message(s)
+                */
+               public byte[] node_id;
+               /**
+                * The channel_ready message which should be sent.
+                */
+               public ChannelReady msg;
+               internal MessageSendEvent_SendChannelReady(long ptr) : base(null, ptr) {
+                       this.node_id = bindings.LDKMessageSendEvent_SendChannelReady_get_node_id(ptr);
+                       long msg = bindings.LDKMessageSendEvent_SendChannelReady_get_msg(ptr);
+                       org.ldk.structs.ChannelReady msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReady(null, msg); }
+                       if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.msg = msg_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type SendAnnouncementSignatures */
+       public class MessageSendEvent_SendAnnouncementSignatures : MessageSendEvent {
+               /**
+                * The node_id of the node which should receive these message(s)
+                */
+               public byte[] node_id;
+               /**
+                * The announcement_signatures message which should be sent.
+                */
+               public AnnouncementSignatures msg;
+               internal MessageSendEvent_SendAnnouncementSignatures(long ptr) : base(null, ptr) {
+                       this.node_id = bindings.LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id(ptr);
+                       long msg = bindings.LDKMessageSendEvent_SendAnnouncementSignatures_get_msg(ptr);
+                       org.ldk.structs.AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, msg); }
+                       if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.msg = msg_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type UpdateHTLCs */
+       public class MessageSendEvent_UpdateHTLCs : MessageSendEvent {
+               /**
+                * The node_id of the node which should receive these message(s)
+                */
+               public byte[] node_id;
+               /**
+                * The update messages which should be sent. ALL messages in the struct should be sent!
+                */
+               public CommitmentUpdate updates;
+               internal MessageSendEvent_UpdateHTLCs(long ptr) : base(null, ptr) {
+                       this.node_id = bindings.LDKMessageSendEvent_UpdateHTLCs_get_node_id(ptr);
+                       long updates = bindings.LDKMessageSendEvent_UpdateHTLCs_get_updates(ptr);
+                       org.ldk.structs.CommitmentUpdate updates_hu_conv = null; if (updates < 0 || updates > 4096) { updates_hu_conv = new org.ldk.structs.CommitmentUpdate(null, updates); }
+                       if (updates_hu_conv != null) { updates_hu_conv.ptrs_to.AddLast(this); };
+                       this.updates = updates_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type SendRevokeAndACK */
+       public class MessageSendEvent_SendRevokeAndACK : MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+                */
+               public byte[] node_id;
+               /**
+                * The message which should be sent.
+                */
+               public RevokeAndACK msg;
+               internal MessageSendEvent_SendRevokeAndACK(long ptr) : base(null, ptr) {
+                       this.node_id = bindings.LDKMessageSendEvent_SendRevokeAndACK_get_node_id(ptr);
+                       long msg = bindings.LDKMessageSendEvent_SendRevokeAndACK_get_msg(ptr);
+                       org.ldk.structs.RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.RevokeAndACK(null, msg); }
+                       if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.msg = msg_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type SendClosingSigned */
+       public class MessageSendEvent_SendClosingSigned : MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+                */
+               public byte[] node_id;
+               /**
+                * The message which should be sent.
+                */
+               public ClosingSigned msg;
+               internal MessageSendEvent_SendClosingSigned(long ptr) : base(null, ptr) {
+                       this.node_id = bindings.LDKMessageSendEvent_SendClosingSigned_get_node_id(ptr);
+                       long msg = bindings.LDKMessageSendEvent_SendClosingSigned_get_msg(ptr);
+                       org.ldk.structs.ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ClosingSigned(null, msg); }
+                       if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.msg = msg_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type SendShutdown */
+       public class MessageSendEvent_SendShutdown : MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+                */
+               public byte[] node_id;
+               /**
+                * The message which should be sent.
+                */
+               public Shutdown msg;
+               internal MessageSendEvent_SendShutdown(long ptr) : base(null, ptr) {
+                       this.node_id = bindings.LDKMessageSendEvent_SendShutdown_get_node_id(ptr);
+                       long msg = bindings.LDKMessageSendEvent_SendShutdown_get_msg(ptr);
+                       org.ldk.structs.Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Shutdown(null, msg); }
+                       if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.msg = msg_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type SendChannelReestablish */
+       public class MessageSendEvent_SendChannelReestablish : MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+                */
+               public byte[] node_id;
+               /**
+                * The message which should be sent.
+                */
+               public ChannelReestablish msg;
+               internal MessageSendEvent_SendChannelReestablish(long ptr) : base(null, ptr) {
+                       this.node_id = bindings.LDKMessageSendEvent_SendChannelReestablish_get_node_id(ptr);
+                       long msg = bindings.LDKMessageSendEvent_SendChannelReestablish_get_msg(ptr);
+                       org.ldk.structs.ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReestablish(null, msg); }
+                       if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.msg = msg_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type SendChannelAnnouncement */
+       public class MessageSendEvent_SendChannelAnnouncement : MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+                */
+               public byte[] node_id;
+               /**
+                * The channel_announcement which should be sent.
+                */
+               public ChannelAnnouncement msg;
+               /**
+                * The followup channel_update which should be sent.
+                */
+               public ChannelUpdate update_msg;
+               internal MessageSendEvent_SendChannelAnnouncement(long ptr) : base(null, ptr) {
+                       this.node_id = bindings.LDKMessageSendEvent_SendChannelAnnouncement_get_node_id(ptr);
+                       long msg = bindings.LDKMessageSendEvent_SendChannelAnnouncement_get_msg(ptr);
+                       org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); }
+                       if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.msg = msg_hu_conv;
+                       long update_msg = bindings.LDKMessageSendEvent_SendChannelAnnouncement_get_update_msg(ptr);
+                       org.ldk.structs.ChannelUpdate update_msg_hu_conv = null; if (update_msg < 0 || update_msg > 4096) { update_msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, update_msg); }
+                       if (update_msg_hu_conv != null) { update_msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.update_msg = update_msg_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type BroadcastChannelAnnouncement */
+       public class MessageSendEvent_BroadcastChannelAnnouncement : MessageSendEvent {
+               /**
+                * The channel_announcement which should be sent.
+                */
+               public ChannelAnnouncement msg;
+               /**
+                * The followup channel_update which should be sent.
+                */
+               public ChannelUpdate update_msg;
+               internal MessageSendEvent_BroadcastChannelAnnouncement(long ptr) : base(null, ptr) {
+                       long msg = bindings.LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg(ptr);
+                       org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); }
+                       if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.msg = msg_hu_conv;
+                       long update_msg = bindings.LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg(ptr);
+                       org.ldk.structs.ChannelUpdate update_msg_hu_conv = null; if (update_msg < 0 || update_msg > 4096) { update_msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, update_msg); }
+                       if (update_msg_hu_conv != null) { update_msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.update_msg = update_msg_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type BroadcastChannelUpdate */
+       public class MessageSendEvent_BroadcastChannelUpdate : MessageSendEvent {
+               /**
+                * The channel_update which should be sent.
+                */
+               public ChannelUpdate msg;
+               internal MessageSendEvent_BroadcastChannelUpdate(long ptr) : base(null, ptr) {
+                       long msg = bindings.LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(ptr);
+                       org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); }
+                       if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.msg = msg_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type SendChannelUpdate */
+       public class MessageSendEvent_SendChannelUpdate : MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+                */
+               public byte[] node_id;
+               /**
+                * The channel_update which should be sent.
+                */
+               public ChannelUpdate msg;
+               internal MessageSendEvent_SendChannelUpdate(long ptr) : base(null, ptr) {
+                       this.node_id = bindings.LDKMessageSendEvent_SendChannelUpdate_get_node_id(ptr);
+                       long msg = bindings.LDKMessageSendEvent_SendChannelUpdate_get_msg(ptr);
+                       org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); }
+                       if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.msg = msg_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type HandleError */
+       public class MessageSendEvent_HandleError : MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+                */
+               public byte[] node_id;
+               /**
+                * The action which should be taken.
+                */
+               public ErrorAction action;
+               internal MessageSendEvent_HandleError(long ptr) : base(null, ptr) {
+                       this.node_id = bindings.LDKMessageSendEvent_HandleError_get_node_id(ptr);
+                       long action = bindings.LDKMessageSendEvent_HandleError_get_action(ptr);
+                       org.ldk.structs.ErrorAction action_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(action);
+                       if (action_hu_conv != null) { action_hu_conv.ptrs_to.AddLast(this); };
+                       this.action = action_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type SendChannelRangeQuery */
+       public class MessageSendEvent_SendChannelRangeQuery : MessageSendEvent {
+               /**
+                * The node_id of this message recipient
+                */
+               public byte[] node_id;
+               /**
+                * The query_channel_range which should be sent.
+                */
+               public QueryChannelRange msg;
+               internal MessageSendEvent_SendChannelRangeQuery(long ptr) : base(null, ptr) {
+                       this.node_id = bindings.LDKMessageSendEvent_SendChannelRangeQuery_get_node_id(ptr);
+                       long msg = bindings.LDKMessageSendEvent_SendChannelRangeQuery_get_msg(ptr);
+                       org.ldk.structs.QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryChannelRange(null, msg); }
+                       if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.msg = msg_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type SendShortIdsQuery */
+       public class MessageSendEvent_SendShortIdsQuery : MessageSendEvent {
+               /**
+                * The node_id of this message recipient
+                */
+               public byte[] node_id;
+               /**
+                * The query_short_channel_ids which should be sent.
+                */
+               public QueryShortChannelIds msg;
+               internal MessageSendEvent_SendShortIdsQuery(long ptr) : base(null, ptr) {
+                       this.node_id = bindings.LDKMessageSendEvent_SendShortIdsQuery_get_node_id(ptr);
+                       long msg = bindings.LDKMessageSendEvent_SendShortIdsQuery_get_msg(ptr);
+                       org.ldk.structs.QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, msg); }
+                       if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.msg = msg_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type SendReplyChannelRange */
+       public class MessageSendEvent_SendReplyChannelRange : MessageSendEvent {
+               /**
+                * The node_id of this message recipient
+                */
+               public byte[] node_id;
+               /**
+                * The reply_channel_range which should be sent.
+                */
+               public ReplyChannelRange msg;
+               internal MessageSendEvent_SendReplyChannelRange(long ptr) : base(null, ptr) {
+                       this.node_id = bindings.LDKMessageSendEvent_SendReplyChannelRange_get_node_id(ptr);
+                       long msg = bindings.LDKMessageSendEvent_SendReplyChannelRange_get_msg(ptr);
+                       org.ldk.structs.ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ReplyChannelRange(null, msg); }
+                       if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.msg = msg_hu_conv;
+               }
+       }
+       /** A MessageSendEvent of type SendGossipTimestampFilter */
+       public class MessageSendEvent_SendGossipTimestampFilter : MessageSendEvent {
+               /**
+                * The node_id of this message recipient
+                */
+               public byte[] node_id;
+               /**
+                * The gossip_timestamp_filter which should be sent.
+                */
+               public GossipTimestampFilter msg;
+               internal MessageSendEvent_SendGossipTimestampFilter(long ptr) : base(null, ptr) {
+                       this.node_id = bindings.LDKMessageSendEvent_SendGossipTimestampFilter_get_node_id(ptr);
+                       long msg = bindings.LDKMessageSendEvent_SendGossipTimestampFilter_get_msg(ptr);
+                       org.ldk.structs.GossipTimestampFilter msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.GossipTimestampFilter(null, msg); }
+                       if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
+                       this.msg = msg_hu_conv;
+               }
+       }
+       internal long clone_ptr() {
+               long ret = bindings.MessageSendEvent_clone_ptr(this.ptr);
+               GC.KeepAlive(this);
+               return ret;
+       }
+
+       /**
+        * Creates a copy of the MessageSendEvent
+        */
+       public MessageSendEvent clone() {
+               long ret = bindings.MessageSendEvent_clone(this.ptr);
+               GC.KeepAlive(this);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_accept_channel(byte[] node_id, org.ldk.structs.AcceptChannel msg) {
+               long ret = bindings.MessageSendEvent_send_accept_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
+               GC.KeepAlive(node_id);
+               GC.KeepAlive(msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_open_channel(byte[] node_id, org.ldk.structs.OpenChannel msg) {
+               long ret = bindings.MessageSendEvent_send_open_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
+               GC.KeepAlive(node_id);
+               GC.KeepAlive(msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_funding_created(byte[] node_id, org.ldk.structs.FundingCreated msg) {
+               long ret = bindings.MessageSendEvent_send_funding_created(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
+               GC.KeepAlive(node_id);
+               GC.KeepAlive(msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_funding_signed(byte[] node_id, org.ldk.structs.FundingSigned msg) {
+               long ret = bindings.MessageSendEvent_send_funding_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
+               GC.KeepAlive(node_id);
+               GC.KeepAlive(msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_channel_ready(byte[] node_id, org.ldk.structs.ChannelReady msg) {
+               long ret = bindings.MessageSendEvent_send_channel_ready(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
+               GC.KeepAlive(node_id);
+               GC.KeepAlive(msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_announcement_signatures(byte[] node_id, org.ldk.structs.AnnouncementSignatures msg) {
+               long ret = bindings.MessageSendEvent_send_announcement_signatures(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
+               GC.KeepAlive(node_id);
+               GC.KeepAlive(msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
+        */
+       public static MessageSendEvent update_htlcs(byte[] node_id, org.ldk.structs.CommitmentUpdate updates) {
+               long ret = bindings.MessageSendEvent_update_htlcs(InternalUtils.check_arr_len(node_id, 33), updates == null ? 0 : updates.ptr);
+               GC.KeepAlive(node_id);
+               GC.KeepAlive(updates);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(updates); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_revoke_and_ack(byte[] node_id, org.ldk.structs.RevokeAndACK msg) {
+               long ret = bindings.MessageSendEvent_send_revoke_and_ack(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
+               GC.KeepAlive(node_id);
+               GC.KeepAlive(msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_closing_signed(byte[] node_id, org.ldk.structs.ClosingSigned msg) {
+               long ret = bindings.MessageSendEvent_send_closing_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
+               GC.KeepAlive(node_id);
+               GC.KeepAlive(msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendShutdown-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_shutdown(byte[] node_id, org.ldk.structs.Shutdown msg) {
+               long ret = bindings.MessageSendEvent_send_shutdown(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
+               GC.KeepAlive(node_id);
+               GC.KeepAlive(msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_channel_reestablish(byte[] node_id, org.ldk.structs.ChannelReestablish msg) {
+               long ret = bindings.MessageSendEvent_send_channel_reestablish(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
+               GC.KeepAlive(node_id);
+               GC.KeepAlive(msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_channel_announcement(byte[] node_id, org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) {
+               long ret = bindings.MessageSendEvent_send_channel_announcement(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr, update_msg == null ? 0 : update_msg.ptr);
+               GC.KeepAlive(node_id);
+               GC.KeepAlive(msg);
+               GC.KeepAlive(update_msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_msg); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
+        */
+       public static MessageSendEvent broadcast_channel_announcement(org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) {
+               long ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : msg.ptr, update_msg == null ? 0 : update_msg.ptr);
+               GC.KeepAlive(msg);
+               GC.KeepAlive(update_msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_msg); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
+        */
+       public static MessageSendEvent broadcast_channel_update(org.ldk.structs.ChannelUpdate msg) {
+               long ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr);
+               GC.KeepAlive(msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_channel_update(byte[] node_id, org.ldk.structs.ChannelUpdate msg) {
+               long ret = bindings.MessageSendEvent_send_channel_update(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
+               GC.KeepAlive(node_id);
+               GC.KeepAlive(msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new HandleError-variant MessageSendEvent
+        */
+       public static MessageSendEvent handle_error(byte[] node_id, org.ldk.structs.ErrorAction action) {
+               long ret = bindings.MessageSendEvent_handle_error(InternalUtils.check_arr_len(node_id, 33), action.ptr);
+               GC.KeepAlive(node_id);
+               GC.KeepAlive(action);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_channel_range_query(byte[] node_id, org.ldk.structs.QueryChannelRange msg) {
+               long ret = bindings.MessageSendEvent_send_channel_range_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
+               GC.KeepAlive(node_id);
+               GC.KeepAlive(msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_short_ids_query(byte[] node_id, org.ldk.structs.QueryShortChannelIds msg) {
+               long ret = bindings.MessageSendEvent_send_short_ids_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
+               GC.KeepAlive(node_id);
+               GC.KeepAlive(msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_reply_channel_range(byte[] node_id, org.ldk.structs.ReplyChannelRange msg) {
+               long ret = bindings.MessageSendEvent_send_reply_channel_range(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
+               GC.KeepAlive(node_id);
+               GC.KeepAlive(msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_gossip_timestamp_filter(byte[] node_id, org.ldk.structs.GossipTimestampFilter msg) {
+               long ret = bindings.MessageSendEvent_send_gossip_timestamp_filter(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
+               GC.KeepAlive(node_id);
+               GC.KeepAlive(msg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
+               return ret_hu_conv;
+       }
+
+}
+} } }