[C#] Check in initial auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / MessageSendEvent.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8 /**
9  * An event generated by ChannelManager which indicates a message should be sent to a peer (or
10  * broadcast to most peers).
11  * These events are handled by PeerManager::process_events if you are using a PeerManager.
12  */
13 public class MessageSendEvent : CommonBase {
14         protected MessageSendEvent(object _dummy, long ptr) : base(ptr) { }
15         ~MessageSendEvent() {
16                 if (ptr != 0) { bindings.MessageSendEvent_free(ptr); }
17         }
18
19         internal static MessageSendEvent constr_from_ptr(long ptr) {
20                 long raw_ty = bindings.LDKMessageSendEvent_ty_from_ptr(ptr);
21                 switch (raw_ty) {
22                         case 0: return new MessageSendEvent_SendAcceptChannel(ptr);
23                         case 1: return new MessageSendEvent_SendOpenChannel(ptr);
24                         case 2: return new MessageSendEvent_SendFundingCreated(ptr);
25                         case 3: return new MessageSendEvent_SendFundingSigned(ptr);
26                         case 4: return new MessageSendEvent_SendChannelReady(ptr);
27                         case 5: return new MessageSendEvent_SendAnnouncementSignatures(ptr);
28                         case 6: return new MessageSendEvent_UpdateHTLCs(ptr);
29                         case 7: return new MessageSendEvent_SendRevokeAndACK(ptr);
30                         case 8: return new MessageSendEvent_SendClosingSigned(ptr);
31                         case 9: return new MessageSendEvent_SendShutdown(ptr);
32                         case 10: return new MessageSendEvent_SendChannelReestablish(ptr);
33                         case 11: return new MessageSendEvent_SendChannelAnnouncement(ptr);
34                         case 12: return new MessageSendEvent_BroadcastChannelAnnouncement(ptr);
35                         case 13: return new MessageSendEvent_BroadcastChannelUpdate(ptr);
36                         case 14: return new MessageSendEvent_SendChannelUpdate(ptr);
37                         case 15: return new MessageSendEvent_HandleError(ptr);
38                         case 16: return new MessageSendEvent_SendChannelRangeQuery(ptr);
39                         case 17: return new MessageSendEvent_SendShortIdsQuery(ptr);
40                         case 18: return new MessageSendEvent_SendReplyChannelRange(ptr);
41                         case 19: return new MessageSendEvent_SendGossipTimestampFilter(ptr);
42                         default:
43                                 throw new ArgumentException("Impossible enum variant");
44                 }
45         }
46
47         /** A MessageSendEvent of type SendAcceptChannel */
48         public class MessageSendEvent_SendAcceptChannel : MessageSendEvent {
49                 /**
50                  * The node_id of the node which should receive this message
51                  */
52                 public byte[] node_id;
53                 /**
54                  * The message which should be sent.
55                  */
56                 public AcceptChannel msg;
57                 internal MessageSendEvent_SendAcceptChannel(long ptr) : base(null, ptr) {
58                         this.node_id = bindings.LDKMessageSendEvent_SendAcceptChannel_get_node_id(ptr);
59                         long msg = bindings.LDKMessageSendEvent_SendAcceptChannel_get_msg(ptr);
60                         org.ldk.structs.AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannel(null, msg); }
61                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
62                         this.msg = msg_hu_conv;
63                 }
64         }
65         /** A MessageSendEvent of type SendOpenChannel */
66         public class MessageSendEvent_SendOpenChannel : MessageSendEvent {
67                 /**
68                  * The node_id of the node which should receive this message
69                  */
70                 public byte[] node_id;
71                 /**
72                  * The message which should be sent.
73                  */
74                 public OpenChannel msg;
75                 internal MessageSendEvent_SendOpenChannel(long ptr) : base(null, ptr) {
76                         this.node_id = bindings.LDKMessageSendEvent_SendOpenChannel_get_node_id(ptr);
77                         long msg = bindings.LDKMessageSendEvent_SendOpenChannel_get_msg(ptr);
78                         org.ldk.structs.OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannel(null, msg); }
79                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
80                         this.msg = msg_hu_conv;
81                 }
82         }
83         /** A MessageSendEvent of type SendFundingCreated */
84         public class MessageSendEvent_SendFundingCreated : MessageSendEvent {
85                 /**
86                  * The node_id of the node which should receive this message
87                  */
88                 public byte[] node_id;
89                 /**
90                  * The message which should be sent.
91                  */
92                 public FundingCreated msg;
93                 internal MessageSendEvent_SendFundingCreated(long ptr) : base(null, ptr) {
94                         this.node_id = bindings.LDKMessageSendEvent_SendFundingCreated_get_node_id(ptr);
95                         long msg = bindings.LDKMessageSendEvent_SendFundingCreated_get_msg(ptr);
96                         org.ldk.structs.FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingCreated(null, msg); }
97                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
98                         this.msg = msg_hu_conv;
99                 }
100         }
101         /** A MessageSendEvent of type SendFundingSigned */
102         public class MessageSendEvent_SendFundingSigned : MessageSendEvent {
103                 /**
104                  * The node_id of the node which should receive this message
105                  */
106                 public byte[] node_id;
107                 /**
108                  * The message which should be sent.
109                  */
110                 public FundingSigned msg;
111                 internal MessageSendEvent_SendFundingSigned(long ptr) : base(null, ptr) {
112                         this.node_id = bindings.LDKMessageSendEvent_SendFundingSigned_get_node_id(ptr);
113                         long msg = bindings.LDKMessageSendEvent_SendFundingSigned_get_msg(ptr);
114                         org.ldk.structs.FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingSigned(null, msg); }
115                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
116                         this.msg = msg_hu_conv;
117                 }
118         }
119         /** A MessageSendEvent of type SendChannelReady */
120         public class MessageSendEvent_SendChannelReady : MessageSendEvent {
121                 /**
122                  * The node_id of the node which should receive these message(s)
123                  */
124                 public byte[] node_id;
125                 /**
126                  * The channel_ready message which should be sent.
127                  */
128                 public ChannelReady msg;
129                 internal MessageSendEvent_SendChannelReady(long ptr) : base(null, ptr) {
130                         this.node_id = bindings.LDKMessageSendEvent_SendChannelReady_get_node_id(ptr);
131                         long msg = bindings.LDKMessageSendEvent_SendChannelReady_get_msg(ptr);
132                         org.ldk.structs.ChannelReady msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReady(null, msg); }
133                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
134                         this.msg = msg_hu_conv;
135                 }
136         }
137         /** A MessageSendEvent of type SendAnnouncementSignatures */
138         public class MessageSendEvent_SendAnnouncementSignatures : MessageSendEvent {
139                 /**
140                  * The node_id of the node which should receive these message(s)
141                  */
142                 public byte[] node_id;
143                 /**
144                  * The announcement_signatures message which should be sent.
145                  */
146                 public AnnouncementSignatures msg;
147                 internal MessageSendEvent_SendAnnouncementSignatures(long ptr) : base(null, ptr) {
148                         this.node_id = bindings.LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id(ptr);
149                         long msg = bindings.LDKMessageSendEvent_SendAnnouncementSignatures_get_msg(ptr);
150                         org.ldk.structs.AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, msg); }
151                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
152                         this.msg = msg_hu_conv;
153                 }
154         }
155         /** A MessageSendEvent of type UpdateHTLCs */
156         public class MessageSendEvent_UpdateHTLCs : MessageSendEvent {
157                 /**
158                  * The node_id of the node which should receive these message(s)
159                  */
160                 public byte[] node_id;
161                 /**
162                  * The update messages which should be sent. ALL messages in the struct should be sent!
163                  */
164                 public CommitmentUpdate updates;
165                 internal MessageSendEvent_UpdateHTLCs(long ptr) : base(null, ptr) {
166                         this.node_id = bindings.LDKMessageSendEvent_UpdateHTLCs_get_node_id(ptr);
167                         long updates = bindings.LDKMessageSendEvent_UpdateHTLCs_get_updates(ptr);
168                         org.ldk.structs.CommitmentUpdate updates_hu_conv = null; if (updates < 0 || updates > 4096) { updates_hu_conv = new org.ldk.structs.CommitmentUpdate(null, updates); }
169                         if (updates_hu_conv != null) { updates_hu_conv.ptrs_to.AddLast(this); };
170                         this.updates = updates_hu_conv;
171                 }
172         }
173         /** A MessageSendEvent of type SendRevokeAndACK */
174         public class MessageSendEvent_SendRevokeAndACK : MessageSendEvent {
175                 /**
176                  * The node_id of the node which should receive this message
177                  */
178                 public byte[] node_id;
179                 /**
180                  * The message which should be sent.
181                  */
182                 public RevokeAndACK msg;
183                 internal MessageSendEvent_SendRevokeAndACK(long ptr) : base(null, ptr) {
184                         this.node_id = bindings.LDKMessageSendEvent_SendRevokeAndACK_get_node_id(ptr);
185                         long msg = bindings.LDKMessageSendEvent_SendRevokeAndACK_get_msg(ptr);
186                         org.ldk.structs.RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.RevokeAndACK(null, msg); }
187                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
188                         this.msg = msg_hu_conv;
189                 }
190         }
191         /** A MessageSendEvent of type SendClosingSigned */
192         public class MessageSendEvent_SendClosingSigned : MessageSendEvent {
193                 /**
194                  * The node_id of the node which should receive this message
195                  */
196                 public byte[] node_id;
197                 /**
198                  * The message which should be sent.
199                  */
200                 public ClosingSigned msg;
201                 internal MessageSendEvent_SendClosingSigned(long ptr) : base(null, ptr) {
202                         this.node_id = bindings.LDKMessageSendEvent_SendClosingSigned_get_node_id(ptr);
203                         long msg = bindings.LDKMessageSendEvent_SendClosingSigned_get_msg(ptr);
204                         org.ldk.structs.ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ClosingSigned(null, msg); }
205                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
206                         this.msg = msg_hu_conv;
207                 }
208         }
209         /** A MessageSendEvent of type SendShutdown */
210         public class MessageSendEvent_SendShutdown : MessageSendEvent {
211                 /**
212                  * The node_id of the node which should receive this message
213                  */
214                 public byte[] node_id;
215                 /**
216                  * The message which should be sent.
217                  */
218                 public Shutdown msg;
219                 internal MessageSendEvent_SendShutdown(long ptr) : base(null, ptr) {
220                         this.node_id = bindings.LDKMessageSendEvent_SendShutdown_get_node_id(ptr);
221                         long msg = bindings.LDKMessageSendEvent_SendShutdown_get_msg(ptr);
222                         org.ldk.structs.Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Shutdown(null, msg); }
223                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
224                         this.msg = msg_hu_conv;
225                 }
226         }
227         /** A MessageSendEvent of type SendChannelReestablish */
228         public class MessageSendEvent_SendChannelReestablish : MessageSendEvent {
229                 /**
230                  * The node_id of the node which should receive this message
231                  */
232                 public byte[] node_id;
233                 /**
234                  * The message which should be sent.
235                  */
236                 public ChannelReestablish msg;
237                 internal MessageSendEvent_SendChannelReestablish(long ptr) : base(null, ptr) {
238                         this.node_id = bindings.LDKMessageSendEvent_SendChannelReestablish_get_node_id(ptr);
239                         long msg = bindings.LDKMessageSendEvent_SendChannelReestablish_get_msg(ptr);
240                         org.ldk.structs.ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReestablish(null, msg); }
241                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
242                         this.msg = msg_hu_conv;
243                 }
244         }
245         /** A MessageSendEvent of type SendChannelAnnouncement */
246         public class MessageSendEvent_SendChannelAnnouncement : MessageSendEvent {
247                 /**
248                  * The node_id of the node which should receive this message
249                  */
250                 public byte[] node_id;
251                 /**
252                  * The channel_announcement which should be sent.
253                  */
254                 public ChannelAnnouncement msg;
255                 /**
256                  * The followup channel_update which should be sent.
257                  */
258                 public ChannelUpdate update_msg;
259                 internal MessageSendEvent_SendChannelAnnouncement(long ptr) : base(null, ptr) {
260                         this.node_id = bindings.LDKMessageSendEvent_SendChannelAnnouncement_get_node_id(ptr);
261                         long msg = bindings.LDKMessageSendEvent_SendChannelAnnouncement_get_msg(ptr);
262                         org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); }
263                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
264                         this.msg = msg_hu_conv;
265                         long update_msg = bindings.LDKMessageSendEvent_SendChannelAnnouncement_get_update_msg(ptr);
266                         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); }
267                         if (update_msg_hu_conv != null) { update_msg_hu_conv.ptrs_to.AddLast(this); };
268                         this.update_msg = update_msg_hu_conv;
269                 }
270         }
271         /** A MessageSendEvent of type BroadcastChannelAnnouncement */
272         public class MessageSendEvent_BroadcastChannelAnnouncement : MessageSendEvent {
273                 /**
274                  * The channel_announcement which should be sent.
275                  */
276                 public ChannelAnnouncement msg;
277                 /**
278                  * The followup channel_update which should be sent.
279                  */
280                 public ChannelUpdate update_msg;
281                 internal MessageSendEvent_BroadcastChannelAnnouncement(long ptr) : base(null, ptr) {
282                         long msg = bindings.LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg(ptr);
283                         org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); }
284                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
285                         this.msg = msg_hu_conv;
286                         long update_msg = bindings.LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg(ptr);
287                         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); }
288                         if (update_msg_hu_conv != null) { update_msg_hu_conv.ptrs_to.AddLast(this); };
289                         this.update_msg = update_msg_hu_conv;
290                 }
291         }
292         /** A MessageSendEvent of type BroadcastChannelUpdate */
293         public class MessageSendEvent_BroadcastChannelUpdate : MessageSendEvent {
294                 /**
295                  * The channel_update which should be sent.
296                  */
297                 public ChannelUpdate msg;
298                 internal MessageSendEvent_BroadcastChannelUpdate(long ptr) : base(null, ptr) {
299                         long msg = bindings.LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(ptr);
300                         org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); }
301                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
302                         this.msg = msg_hu_conv;
303                 }
304         }
305         /** A MessageSendEvent of type SendChannelUpdate */
306         public class MessageSendEvent_SendChannelUpdate : MessageSendEvent {
307                 /**
308                  * The node_id of the node which should receive this message
309                  */
310                 public byte[] node_id;
311                 /**
312                  * The channel_update which should be sent.
313                  */
314                 public ChannelUpdate msg;
315                 internal MessageSendEvent_SendChannelUpdate(long ptr) : base(null, ptr) {
316                         this.node_id = bindings.LDKMessageSendEvent_SendChannelUpdate_get_node_id(ptr);
317                         long msg = bindings.LDKMessageSendEvent_SendChannelUpdate_get_msg(ptr);
318                         org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); }
319                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
320                         this.msg = msg_hu_conv;
321                 }
322         }
323         /** A MessageSendEvent of type HandleError */
324         public class MessageSendEvent_HandleError : MessageSendEvent {
325                 /**
326                  * The node_id of the node which should receive this message
327                  */
328                 public byte[] node_id;
329                 /**
330                  * The action which should be taken.
331                  */
332                 public ErrorAction action;
333                 internal MessageSendEvent_HandleError(long ptr) : base(null, ptr) {
334                         this.node_id = bindings.LDKMessageSendEvent_HandleError_get_node_id(ptr);
335                         long action = bindings.LDKMessageSendEvent_HandleError_get_action(ptr);
336                         org.ldk.structs.ErrorAction action_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(action);
337                         if (action_hu_conv != null) { action_hu_conv.ptrs_to.AddLast(this); };
338                         this.action = action_hu_conv;
339                 }
340         }
341         /** A MessageSendEvent of type SendChannelRangeQuery */
342         public class MessageSendEvent_SendChannelRangeQuery : MessageSendEvent {
343                 /**
344                  * The node_id of this message recipient
345                  */
346                 public byte[] node_id;
347                 /**
348                  * The query_channel_range which should be sent.
349                  */
350                 public QueryChannelRange msg;
351                 internal MessageSendEvent_SendChannelRangeQuery(long ptr) : base(null, ptr) {
352                         this.node_id = bindings.LDKMessageSendEvent_SendChannelRangeQuery_get_node_id(ptr);
353                         long msg = bindings.LDKMessageSendEvent_SendChannelRangeQuery_get_msg(ptr);
354                         org.ldk.structs.QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryChannelRange(null, msg); }
355                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
356                         this.msg = msg_hu_conv;
357                 }
358         }
359         /** A MessageSendEvent of type SendShortIdsQuery */
360         public class MessageSendEvent_SendShortIdsQuery : MessageSendEvent {
361                 /**
362                  * The node_id of this message recipient
363                  */
364                 public byte[] node_id;
365                 /**
366                  * The query_short_channel_ids which should be sent.
367                  */
368                 public QueryShortChannelIds msg;
369                 internal MessageSendEvent_SendShortIdsQuery(long ptr) : base(null, ptr) {
370                         this.node_id = bindings.LDKMessageSendEvent_SendShortIdsQuery_get_node_id(ptr);
371                         long msg = bindings.LDKMessageSendEvent_SendShortIdsQuery_get_msg(ptr);
372                         org.ldk.structs.QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, msg); }
373                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
374                         this.msg = msg_hu_conv;
375                 }
376         }
377         /** A MessageSendEvent of type SendReplyChannelRange */
378         public class MessageSendEvent_SendReplyChannelRange : MessageSendEvent {
379                 /**
380                  * The node_id of this message recipient
381                  */
382                 public byte[] node_id;
383                 /**
384                  * The reply_channel_range which should be sent.
385                  */
386                 public ReplyChannelRange msg;
387                 internal MessageSendEvent_SendReplyChannelRange(long ptr) : base(null, ptr) {
388                         this.node_id = bindings.LDKMessageSendEvent_SendReplyChannelRange_get_node_id(ptr);
389                         long msg = bindings.LDKMessageSendEvent_SendReplyChannelRange_get_msg(ptr);
390                         org.ldk.structs.ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ReplyChannelRange(null, msg); }
391                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
392                         this.msg = msg_hu_conv;
393                 }
394         }
395         /** A MessageSendEvent of type SendGossipTimestampFilter */
396         public class MessageSendEvent_SendGossipTimestampFilter : MessageSendEvent {
397                 /**
398                  * The node_id of this message recipient
399                  */
400                 public byte[] node_id;
401                 /**
402                  * The gossip_timestamp_filter which should be sent.
403                  */
404                 public GossipTimestampFilter msg;
405                 internal MessageSendEvent_SendGossipTimestampFilter(long ptr) : base(null, ptr) {
406                         this.node_id = bindings.LDKMessageSendEvent_SendGossipTimestampFilter_get_node_id(ptr);
407                         long msg = bindings.LDKMessageSendEvent_SendGossipTimestampFilter_get_msg(ptr);
408                         org.ldk.structs.GossipTimestampFilter msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.GossipTimestampFilter(null, msg); }
409                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
410                         this.msg = msg_hu_conv;
411                 }
412         }
413         internal long clone_ptr() {
414                 long ret = bindings.MessageSendEvent_clone_ptr(this.ptr);
415                 GC.KeepAlive(this);
416                 return ret;
417         }
418
419         /**
420          * Creates a copy of the MessageSendEvent
421          */
422         public MessageSendEvent clone() {
423                 long ret = bindings.MessageSendEvent_clone(this.ptr);
424                 GC.KeepAlive(this);
425                 if (ret >= 0 && ret <= 4096) { return null; }
426                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
427                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
428                 return ret_hu_conv;
429         }
430
431         /**
432          * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
433          */
434         public static MessageSendEvent send_accept_channel(byte[] node_id, org.ldk.structs.AcceptChannel msg) {
435                 long ret = bindings.MessageSendEvent_send_accept_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
436                 GC.KeepAlive(node_id);
437                 GC.KeepAlive(msg);
438                 if (ret >= 0 && ret <= 4096) { return null; }
439                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
440                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
441                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
442                 return ret_hu_conv;
443         }
444
445         /**
446          * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
447          */
448         public static MessageSendEvent send_open_channel(byte[] node_id, org.ldk.structs.OpenChannel msg) {
449                 long ret = bindings.MessageSendEvent_send_open_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
450                 GC.KeepAlive(node_id);
451                 GC.KeepAlive(msg);
452                 if (ret >= 0 && ret <= 4096) { return null; }
453                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
454                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
455                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
456                 return ret_hu_conv;
457         }
458
459         /**
460          * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
461          */
462         public static MessageSendEvent send_funding_created(byte[] node_id, org.ldk.structs.FundingCreated msg) {
463                 long ret = bindings.MessageSendEvent_send_funding_created(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
464                 GC.KeepAlive(node_id);
465                 GC.KeepAlive(msg);
466                 if (ret >= 0 && ret <= 4096) { return null; }
467                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
468                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
469                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
470                 return ret_hu_conv;
471         }
472
473         /**
474          * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
475          */
476         public static MessageSendEvent send_funding_signed(byte[] node_id, org.ldk.structs.FundingSigned msg) {
477                 long ret = bindings.MessageSendEvent_send_funding_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
478                 GC.KeepAlive(node_id);
479                 GC.KeepAlive(msg);
480                 if (ret >= 0 && ret <= 4096) { return null; }
481                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
482                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
483                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
484                 return ret_hu_conv;
485         }
486
487         /**
488          * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
489          */
490         public static MessageSendEvent send_channel_ready(byte[] node_id, org.ldk.structs.ChannelReady msg) {
491                 long ret = bindings.MessageSendEvent_send_channel_ready(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
492                 GC.KeepAlive(node_id);
493                 GC.KeepAlive(msg);
494                 if (ret >= 0 && ret <= 4096) { return null; }
495                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
496                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
497                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
498                 return ret_hu_conv;
499         }
500
501         /**
502          * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
503          */
504         public static MessageSendEvent send_announcement_signatures(byte[] node_id, org.ldk.structs.AnnouncementSignatures msg) {
505                 long ret = bindings.MessageSendEvent_send_announcement_signatures(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
506                 GC.KeepAlive(node_id);
507                 GC.KeepAlive(msg);
508                 if (ret >= 0 && ret <= 4096) { return null; }
509                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
510                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
511                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
512                 return ret_hu_conv;
513         }
514
515         /**
516          * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
517          */
518         public static MessageSendEvent update_htlcs(byte[] node_id, org.ldk.structs.CommitmentUpdate updates) {
519                 long ret = bindings.MessageSendEvent_update_htlcs(InternalUtils.check_arr_len(node_id, 33), updates == null ? 0 : updates.ptr);
520                 GC.KeepAlive(node_id);
521                 GC.KeepAlive(updates);
522                 if (ret >= 0 && ret <= 4096) { return null; }
523                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
524                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
525                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(updates); };
526                 return ret_hu_conv;
527         }
528
529         /**
530          * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
531          */
532         public static MessageSendEvent send_revoke_and_ack(byte[] node_id, org.ldk.structs.RevokeAndACK msg) {
533                 long ret = bindings.MessageSendEvent_send_revoke_and_ack(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
534                 GC.KeepAlive(node_id);
535                 GC.KeepAlive(msg);
536                 if (ret >= 0 && ret <= 4096) { return null; }
537                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
538                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
539                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
540                 return ret_hu_conv;
541         }
542
543         /**
544          * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
545          */
546         public static MessageSendEvent send_closing_signed(byte[] node_id, org.ldk.structs.ClosingSigned msg) {
547                 long ret = bindings.MessageSendEvent_send_closing_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
548                 GC.KeepAlive(node_id);
549                 GC.KeepAlive(msg);
550                 if (ret >= 0 && ret <= 4096) { return null; }
551                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
552                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
553                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
554                 return ret_hu_conv;
555         }
556
557         /**
558          * Utility method to constructs a new SendShutdown-variant MessageSendEvent
559          */
560         public static MessageSendEvent send_shutdown(byte[] node_id, org.ldk.structs.Shutdown msg) {
561                 long ret = bindings.MessageSendEvent_send_shutdown(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
562                 GC.KeepAlive(node_id);
563                 GC.KeepAlive(msg);
564                 if (ret >= 0 && ret <= 4096) { return null; }
565                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
566                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
567                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
568                 return ret_hu_conv;
569         }
570
571         /**
572          * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
573          */
574         public static MessageSendEvent send_channel_reestablish(byte[] node_id, org.ldk.structs.ChannelReestablish msg) {
575                 long ret = bindings.MessageSendEvent_send_channel_reestablish(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
576                 GC.KeepAlive(node_id);
577                 GC.KeepAlive(msg);
578                 if (ret >= 0 && ret <= 4096) { return null; }
579                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
580                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
581                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
582                 return ret_hu_conv;
583         }
584
585         /**
586          * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
587          */
588         public static MessageSendEvent send_channel_announcement(byte[] node_id, org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) {
589                 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);
590                 GC.KeepAlive(node_id);
591                 GC.KeepAlive(msg);
592                 GC.KeepAlive(update_msg);
593                 if (ret >= 0 && ret <= 4096) { return null; }
594                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
595                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
596                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
597                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_msg); };
598                 return ret_hu_conv;
599         }
600
601         /**
602          * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
603          */
604         public static MessageSendEvent broadcast_channel_announcement(org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) {
605                 long ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : msg.ptr, update_msg == null ? 0 : update_msg.ptr);
606                 GC.KeepAlive(msg);
607                 GC.KeepAlive(update_msg);
608                 if (ret >= 0 && ret <= 4096) { return null; }
609                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
610                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
611                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
612                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_msg); };
613                 return ret_hu_conv;
614         }
615
616         /**
617          * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
618          */
619         public static MessageSendEvent broadcast_channel_update(org.ldk.structs.ChannelUpdate msg) {
620                 long ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr);
621                 GC.KeepAlive(msg);
622                 if (ret >= 0 && ret <= 4096) { return null; }
623                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
624                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
625                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
626                 return ret_hu_conv;
627         }
628
629         /**
630          * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
631          */
632         public static MessageSendEvent send_channel_update(byte[] node_id, org.ldk.structs.ChannelUpdate msg) {
633                 long ret = bindings.MessageSendEvent_send_channel_update(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
634                 GC.KeepAlive(node_id);
635                 GC.KeepAlive(msg);
636                 if (ret >= 0 && ret <= 4096) { return null; }
637                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
638                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
639                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
640                 return ret_hu_conv;
641         }
642
643         /**
644          * Utility method to constructs a new HandleError-variant MessageSendEvent
645          */
646         public static MessageSendEvent handle_error(byte[] node_id, org.ldk.structs.ErrorAction action) {
647                 long ret = bindings.MessageSendEvent_handle_error(InternalUtils.check_arr_len(node_id, 33), action.ptr);
648                 GC.KeepAlive(node_id);
649                 GC.KeepAlive(action);
650                 if (ret >= 0 && ret <= 4096) { return null; }
651                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
652                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
653                 return ret_hu_conv;
654         }
655
656         /**
657          * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
658          */
659         public static MessageSendEvent send_channel_range_query(byte[] node_id, org.ldk.structs.QueryChannelRange msg) {
660                 long ret = bindings.MessageSendEvent_send_channel_range_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
661                 GC.KeepAlive(node_id);
662                 GC.KeepAlive(msg);
663                 if (ret >= 0 && ret <= 4096) { return null; }
664                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
665                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
666                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
667                 return ret_hu_conv;
668         }
669
670         /**
671          * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
672          */
673         public static MessageSendEvent send_short_ids_query(byte[] node_id, org.ldk.structs.QueryShortChannelIds msg) {
674                 long ret = bindings.MessageSendEvent_send_short_ids_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
675                 GC.KeepAlive(node_id);
676                 GC.KeepAlive(msg);
677                 if (ret >= 0 && ret <= 4096) { return null; }
678                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
679                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
680                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
681                 return ret_hu_conv;
682         }
683
684         /**
685          * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
686          */
687         public static MessageSendEvent send_reply_channel_range(byte[] node_id, org.ldk.structs.ReplyChannelRange msg) {
688                 long ret = bindings.MessageSendEvent_send_reply_channel_range(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
689                 GC.KeepAlive(node_id);
690                 GC.KeepAlive(msg);
691                 if (ret >= 0 && ret <= 4096) { return null; }
692                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
693                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
694                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
695                 return ret_hu_conv;
696         }
697
698         /**
699          * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
700          */
701         public static MessageSendEvent send_gossip_timestamp_filter(byte[] node_id, org.ldk.structs.GossipTimestampFilter msg) {
702                 long ret = bindings.MessageSendEvent_send_gossip_timestamp_filter(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
703                 GC.KeepAlive(node_id);
704                 GC.KeepAlive(msg);
705                 if (ret >= 0 && ret <= 4096) { return null; }
706                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
707                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
708                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
709                 return ret_hu_conv;
710         }
711
712 }
713 } } }