[C#] Update auto-generated files
[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_SendAcceptChannelV2(ptr);
24                         case 2: return new MessageSendEvent_SendOpenChannel(ptr);
25                         case 3: return new MessageSendEvent_SendOpenChannelV2(ptr);
26                         case 4: return new MessageSendEvent_SendFundingCreated(ptr);
27                         case 5: return new MessageSendEvent_SendFundingSigned(ptr);
28                         case 6: return new MessageSendEvent_SendTxAddInput(ptr);
29                         case 7: return new MessageSendEvent_SendTxAddOutput(ptr);
30                         case 8: return new MessageSendEvent_SendTxRemoveInput(ptr);
31                         case 9: return new MessageSendEvent_SendTxRemoveOutput(ptr);
32                         case 10: return new MessageSendEvent_SendTxComplete(ptr);
33                         case 11: return new MessageSendEvent_SendTxSignatures(ptr);
34                         case 12: return new MessageSendEvent_SendTxInitRbf(ptr);
35                         case 13: return new MessageSendEvent_SendTxAckRbf(ptr);
36                         case 14: return new MessageSendEvent_SendTxAbort(ptr);
37                         case 15: return new MessageSendEvent_SendChannelReady(ptr);
38                         case 16: return new MessageSendEvent_SendAnnouncementSignatures(ptr);
39                         case 17: return new MessageSendEvent_UpdateHTLCs(ptr);
40                         case 18: return new MessageSendEvent_SendRevokeAndACK(ptr);
41                         case 19: return new MessageSendEvent_SendClosingSigned(ptr);
42                         case 20: return new MessageSendEvent_SendShutdown(ptr);
43                         case 21: return new MessageSendEvent_SendChannelReestablish(ptr);
44                         case 22: return new MessageSendEvent_SendChannelAnnouncement(ptr);
45                         case 23: return new MessageSendEvent_BroadcastChannelAnnouncement(ptr);
46                         case 24: return new MessageSendEvent_BroadcastChannelUpdate(ptr);
47                         case 25: return new MessageSendEvent_BroadcastNodeAnnouncement(ptr);
48                         case 26: return new MessageSendEvent_SendChannelUpdate(ptr);
49                         case 27: return new MessageSendEvent_HandleError(ptr);
50                         case 28: return new MessageSendEvent_SendChannelRangeQuery(ptr);
51                         case 29: return new MessageSendEvent_SendShortIdsQuery(ptr);
52                         case 30: return new MessageSendEvent_SendReplyChannelRange(ptr);
53                         case 31: return new MessageSendEvent_SendGossipTimestampFilter(ptr);
54                         default:
55                                 throw new ArgumentException("Impossible enum variant");
56                 }
57         }
58
59         /** A MessageSendEvent of type SendAcceptChannel */
60         public class MessageSendEvent_SendAcceptChannel : MessageSendEvent {
61                 /**
62                  * The node_id of the node which should receive this message
63                  */
64                 public byte[] node_id;
65                 /**
66                  * The message which should be sent.
67                  */
68                 public AcceptChannel msg;
69                 internal MessageSendEvent_SendAcceptChannel(long ptr) : base(null, ptr) {
70                         this.node_id = bindings.LDKMessageSendEvent_SendAcceptChannel_get_node_id(ptr);
71                         long msg = bindings.LDKMessageSendEvent_SendAcceptChannel_get_msg(ptr);
72                         org.ldk.structs.AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannel(null, msg); }
73                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
74                         this.msg = msg_hu_conv;
75                 }
76         }
77         /** A MessageSendEvent of type SendAcceptChannelV2 */
78         public class MessageSendEvent_SendAcceptChannelV2 : MessageSendEvent {
79                 /**
80                  * The node_id of the node which should receive this message
81                  */
82                 public byte[] node_id;
83                 /**
84                  * The message which should be sent.
85                  */
86                 public AcceptChannelV2 msg;
87                 internal MessageSendEvent_SendAcceptChannelV2(long ptr) : base(null, ptr) {
88                         this.node_id = bindings.LDKMessageSendEvent_SendAcceptChannelV2_get_node_id(ptr);
89                         long msg = bindings.LDKMessageSendEvent_SendAcceptChannelV2_get_msg(ptr);
90                         org.ldk.structs.AcceptChannelV2 msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannelV2(null, msg); }
91                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
92                         this.msg = msg_hu_conv;
93                 }
94         }
95         /** A MessageSendEvent of type SendOpenChannel */
96         public class MessageSendEvent_SendOpenChannel : MessageSendEvent {
97                 /**
98                  * The node_id of the node which should receive this message
99                  */
100                 public byte[] node_id;
101                 /**
102                  * The message which should be sent.
103                  */
104                 public OpenChannel msg;
105                 internal MessageSendEvent_SendOpenChannel(long ptr) : base(null, ptr) {
106                         this.node_id = bindings.LDKMessageSendEvent_SendOpenChannel_get_node_id(ptr);
107                         long msg = bindings.LDKMessageSendEvent_SendOpenChannel_get_msg(ptr);
108                         org.ldk.structs.OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannel(null, msg); }
109                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
110                         this.msg = msg_hu_conv;
111                 }
112         }
113         /** A MessageSendEvent of type SendOpenChannelV2 */
114         public class MessageSendEvent_SendOpenChannelV2 : MessageSendEvent {
115                 /**
116                  * The node_id of the node which should receive this message
117                  */
118                 public byte[] node_id;
119                 /**
120                  * The message which should be sent.
121                  */
122                 public OpenChannelV2 msg;
123                 internal MessageSendEvent_SendOpenChannelV2(long ptr) : base(null, ptr) {
124                         this.node_id = bindings.LDKMessageSendEvent_SendOpenChannelV2_get_node_id(ptr);
125                         long msg = bindings.LDKMessageSendEvent_SendOpenChannelV2_get_msg(ptr);
126                         org.ldk.structs.OpenChannelV2 msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannelV2(null, msg); }
127                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
128                         this.msg = msg_hu_conv;
129                 }
130         }
131         /** A MessageSendEvent of type SendFundingCreated */
132         public class MessageSendEvent_SendFundingCreated : MessageSendEvent {
133                 /**
134                  * The node_id of the node which should receive this message
135                  */
136                 public byte[] node_id;
137                 /**
138                  * The message which should be sent.
139                  */
140                 public FundingCreated msg;
141                 internal MessageSendEvent_SendFundingCreated(long ptr) : base(null, ptr) {
142                         this.node_id = bindings.LDKMessageSendEvent_SendFundingCreated_get_node_id(ptr);
143                         long msg = bindings.LDKMessageSendEvent_SendFundingCreated_get_msg(ptr);
144                         org.ldk.structs.FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingCreated(null, msg); }
145                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
146                         this.msg = msg_hu_conv;
147                 }
148         }
149         /** A MessageSendEvent of type SendFundingSigned */
150         public class MessageSendEvent_SendFundingSigned : MessageSendEvent {
151                 /**
152                  * The node_id of the node which should receive this message
153                  */
154                 public byte[] node_id;
155                 /**
156                  * The message which should be sent.
157                  */
158                 public FundingSigned msg;
159                 internal MessageSendEvent_SendFundingSigned(long ptr) : base(null, ptr) {
160                         this.node_id = bindings.LDKMessageSendEvent_SendFundingSigned_get_node_id(ptr);
161                         long msg = bindings.LDKMessageSendEvent_SendFundingSigned_get_msg(ptr);
162                         org.ldk.structs.FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingSigned(null, msg); }
163                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
164                         this.msg = msg_hu_conv;
165                 }
166         }
167         /** A MessageSendEvent of type SendTxAddInput */
168         public class MessageSendEvent_SendTxAddInput : MessageSendEvent {
169                 /**
170                  * The node_id of the node which should receive this message
171                  */
172                 public byte[] node_id;
173                 /**
174                  * The message which should be sent.
175                  */
176                 public TxAddInput msg;
177                 internal MessageSendEvent_SendTxAddInput(long ptr) : base(null, ptr) {
178                         this.node_id = bindings.LDKMessageSendEvent_SendTxAddInput_get_node_id(ptr);
179                         long msg = bindings.LDKMessageSendEvent_SendTxAddInput_get_msg(ptr);
180                         org.ldk.structs.TxAddInput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAddInput(null, msg); }
181                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
182                         this.msg = msg_hu_conv;
183                 }
184         }
185         /** A MessageSendEvent of type SendTxAddOutput */
186         public class MessageSendEvent_SendTxAddOutput : MessageSendEvent {
187                 /**
188                  * The node_id of the node which should receive this message
189                  */
190                 public byte[] node_id;
191                 /**
192                  * The message which should be sent.
193                  */
194                 public TxAddOutput msg;
195                 internal MessageSendEvent_SendTxAddOutput(long ptr) : base(null, ptr) {
196                         this.node_id = bindings.LDKMessageSendEvent_SendTxAddOutput_get_node_id(ptr);
197                         long msg = bindings.LDKMessageSendEvent_SendTxAddOutput_get_msg(ptr);
198                         org.ldk.structs.TxAddOutput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAddOutput(null, msg); }
199                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
200                         this.msg = msg_hu_conv;
201                 }
202         }
203         /** A MessageSendEvent of type SendTxRemoveInput */
204         public class MessageSendEvent_SendTxRemoveInput : MessageSendEvent {
205                 /**
206                  * The node_id of the node which should receive this message
207                  */
208                 public byte[] node_id;
209                 /**
210                  * The message which should be sent.
211                  */
212                 public TxRemoveInput msg;
213                 internal MessageSendEvent_SendTxRemoveInput(long ptr) : base(null, ptr) {
214                         this.node_id = bindings.LDKMessageSendEvent_SendTxRemoveInput_get_node_id(ptr);
215                         long msg = bindings.LDKMessageSendEvent_SendTxRemoveInput_get_msg(ptr);
216                         org.ldk.structs.TxRemoveInput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxRemoveInput(null, msg); }
217                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
218                         this.msg = msg_hu_conv;
219                 }
220         }
221         /** A MessageSendEvent of type SendTxRemoveOutput */
222         public class MessageSendEvent_SendTxRemoveOutput : MessageSendEvent {
223                 /**
224                  * The node_id of the node which should receive this message
225                  */
226                 public byte[] node_id;
227                 /**
228                  * The message which should be sent.
229                  */
230                 public TxRemoveOutput msg;
231                 internal MessageSendEvent_SendTxRemoveOutput(long ptr) : base(null, ptr) {
232                         this.node_id = bindings.LDKMessageSendEvent_SendTxRemoveOutput_get_node_id(ptr);
233                         long msg = bindings.LDKMessageSendEvent_SendTxRemoveOutput_get_msg(ptr);
234                         org.ldk.structs.TxRemoveOutput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxRemoveOutput(null, msg); }
235                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
236                         this.msg = msg_hu_conv;
237                 }
238         }
239         /** A MessageSendEvent of type SendTxComplete */
240         public class MessageSendEvent_SendTxComplete : MessageSendEvent {
241                 /**
242                  * The node_id of the node which should receive this message
243                  */
244                 public byte[] node_id;
245                 /**
246                  * The message which should be sent.
247                  */
248                 public TxComplete msg;
249                 internal MessageSendEvent_SendTxComplete(long ptr) : base(null, ptr) {
250                         this.node_id = bindings.LDKMessageSendEvent_SendTxComplete_get_node_id(ptr);
251                         long msg = bindings.LDKMessageSendEvent_SendTxComplete_get_msg(ptr);
252                         org.ldk.structs.TxComplete msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxComplete(null, msg); }
253                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
254                         this.msg = msg_hu_conv;
255                 }
256         }
257         /** A MessageSendEvent of type SendTxSignatures */
258         public class MessageSendEvent_SendTxSignatures : MessageSendEvent {
259                 /**
260                  * The node_id of the node which should receive this message
261                  */
262                 public byte[] node_id;
263                 /**
264                  * The message which should be sent.
265                  */
266                 public TxSignatures msg;
267                 internal MessageSendEvent_SendTxSignatures(long ptr) : base(null, ptr) {
268                         this.node_id = bindings.LDKMessageSendEvent_SendTxSignatures_get_node_id(ptr);
269                         long msg = bindings.LDKMessageSendEvent_SendTxSignatures_get_msg(ptr);
270                         org.ldk.structs.TxSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxSignatures(null, msg); }
271                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
272                         this.msg = msg_hu_conv;
273                 }
274         }
275         /** A MessageSendEvent of type SendTxInitRbf */
276         public class MessageSendEvent_SendTxInitRbf : MessageSendEvent {
277                 /**
278                  * The node_id of the node which should receive this message
279                  */
280                 public byte[] node_id;
281                 /**
282                  * The message which should be sent.
283                  */
284                 public TxInitRbf msg;
285                 internal MessageSendEvent_SendTxInitRbf(long ptr) : base(null, ptr) {
286                         this.node_id = bindings.LDKMessageSendEvent_SendTxInitRbf_get_node_id(ptr);
287                         long msg = bindings.LDKMessageSendEvent_SendTxInitRbf_get_msg(ptr);
288                         org.ldk.structs.TxInitRbf msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxInitRbf(null, msg); }
289                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
290                         this.msg = msg_hu_conv;
291                 }
292         }
293         /** A MessageSendEvent of type SendTxAckRbf */
294         public class MessageSendEvent_SendTxAckRbf : MessageSendEvent {
295                 /**
296                  * The node_id of the node which should receive this message
297                  */
298                 public byte[] node_id;
299                 /**
300                  * The message which should be sent.
301                  */
302                 public TxAckRbf msg;
303                 internal MessageSendEvent_SendTxAckRbf(long ptr) : base(null, ptr) {
304                         this.node_id = bindings.LDKMessageSendEvent_SendTxAckRbf_get_node_id(ptr);
305                         long msg = bindings.LDKMessageSendEvent_SendTxAckRbf_get_msg(ptr);
306                         org.ldk.structs.TxAckRbf msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAckRbf(null, msg); }
307                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
308                         this.msg = msg_hu_conv;
309                 }
310         }
311         /** A MessageSendEvent of type SendTxAbort */
312         public class MessageSendEvent_SendTxAbort : MessageSendEvent {
313                 /**
314                  * The node_id of the node which should receive this message
315                  */
316                 public byte[] node_id;
317                 /**
318                  * The message which should be sent.
319                  */
320                 public TxAddInput msg;
321                 internal MessageSendEvent_SendTxAbort(long ptr) : base(null, ptr) {
322                         this.node_id = bindings.LDKMessageSendEvent_SendTxAbort_get_node_id(ptr);
323                         long msg = bindings.LDKMessageSendEvent_SendTxAbort_get_msg(ptr);
324                         org.ldk.structs.TxAddInput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAddInput(null, msg); }
325                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
326                         this.msg = msg_hu_conv;
327                 }
328         }
329         /** A MessageSendEvent of type SendChannelReady */
330         public class MessageSendEvent_SendChannelReady : MessageSendEvent {
331                 /**
332                  * The node_id of the node which should receive these message(s)
333                  */
334                 public byte[] node_id;
335                 /**
336                  * The channel_ready message which should be sent.
337                  */
338                 public ChannelReady msg;
339                 internal MessageSendEvent_SendChannelReady(long ptr) : base(null, ptr) {
340                         this.node_id = bindings.LDKMessageSendEvent_SendChannelReady_get_node_id(ptr);
341                         long msg = bindings.LDKMessageSendEvent_SendChannelReady_get_msg(ptr);
342                         org.ldk.structs.ChannelReady msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReady(null, msg); }
343                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
344                         this.msg = msg_hu_conv;
345                 }
346         }
347         /** A MessageSendEvent of type SendAnnouncementSignatures */
348         public class MessageSendEvent_SendAnnouncementSignatures : MessageSendEvent {
349                 /**
350                  * The node_id of the node which should receive these message(s)
351                  */
352                 public byte[] node_id;
353                 /**
354                  * The announcement_signatures message which should be sent.
355                  */
356                 public AnnouncementSignatures msg;
357                 internal MessageSendEvent_SendAnnouncementSignatures(long ptr) : base(null, ptr) {
358                         this.node_id = bindings.LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id(ptr);
359                         long msg = bindings.LDKMessageSendEvent_SendAnnouncementSignatures_get_msg(ptr);
360                         org.ldk.structs.AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, msg); }
361                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
362                         this.msg = msg_hu_conv;
363                 }
364         }
365         /** A MessageSendEvent of type UpdateHTLCs */
366         public class MessageSendEvent_UpdateHTLCs : MessageSendEvent {
367                 /**
368                  * The node_id of the node which should receive these message(s)
369                  */
370                 public byte[] node_id;
371                 /**
372                  * The update messages which should be sent. ALL messages in the struct should be sent!
373                  */
374                 public CommitmentUpdate updates;
375                 internal MessageSendEvent_UpdateHTLCs(long ptr) : base(null, ptr) {
376                         this.node_id = bindings.LDKMessageSendEvent_UpdateHTLCs_get_node_id(ptr);
377                         long updates = bindings.LDKMessageSendEvent_UpdateHTLCs_get_updates(ptr);
378                         org.ldk.structs.CommitmentUpdate updates_hu_conv = null; if (updates < 0 || updates > 4096) { updates_hu_conv = new org.ldk.structs.CommitmentUpdate(null, updates); }
379                         if (updates_hu_conv != null) { updates_hu_conv.ptrs_to.AddLast(this); };
380                         this.updates = updates_hu_conv;
381                 }
382         }
383         /** A MessageSendEvent of type SendRevokeAndACK */
384         public class MessageSendEvent_SendRevokeAndACK : MessageSendEvent {
385                 /**
386                  * The node_id of the node which should receive this message
387                  */
388                 public byte[] node_id;
389                 /**
390                  * The message which should be sent.
391                  */
392                 public RevokeAndACK msg;
393                 internal MessageSendEvent_SendRevokeAndACK(long ptr) : base(null, ptr) {
394                         this.node_id = bindings.LDKMessageSendEvent_SendRevokeAndACK_get_node_id(ptr);
395                         long msg = bindings.LDKMessageSendEvent_SendRevokeAndACK_get_msg(ptr);
396                         org.ldk.structs.RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.RevokeAndACK(null, msg); }
397                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
398                         this.msg = msg_hu_conv;
399                 }
400         }
401         /** A MessageSendEvent of type SendClosingSigned */
402         public class MessageSendEvent_SendClosingSigned : MessageSendEvent {
403                 /**
404                  * The node_id of the node which should receive this message
405                  */
406                 public byte[] node_id;
407                 /**
408                  * The message which should be sent.
409                  */
410                 public ClosingSigned msg;
411                 internal MessageSendEvent_SendClosingSigned(long ptr) : base(null, ptr) {
412                         this.node_id = bindings.LDKMessageSendEvent_SendClosingSigned_get_node_id(ptr);
413                         long msg = bindings.LDKMessageSendEvent_SendClosingSigned_get_msg(ptr);
414                         org.ldk.structs.ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ClosingSigned(null, msg); }
415                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
416                         this.msg = msg_hu_conv;
417                 }
418         }
419         /** A MessageSendEvent of type SendShutdown */
420         public class MessageSendEvent_SendShutdown : MessageSendEvent {
421                 /**
422                  * The node_id of the node which should receive this message
423                  */
424                 public byte[] node_id;
425                 /**
426                  * The message which should be sent.
427                  */
428                 public Shutdown msg;
429                 internal MessageSendEvent_SendShutdown(long ptr) : base(null, ptr) {
430                         this.node_id = bindings.LDKMessageSendEvent_SendShutdown_get_node_id(ptr);
431                         long msg = bindings.LDKMessageSendEvent_SendShutdown_get_msg(ptr);
432                         org.ldk.structs.Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Shutdown(null, msg); }
433                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
434                         this.msg = msg_hu_conv;
435                 }
436         }
437         /** A MessageSendEvent of type SendChannelReestablish */
438         public class MessageSendEvent_SendChannelReestablish : MessageSendEvent {
439                 /**
440                  * The node_id of the node which should receive this message
441                  */
442                 public byte[] node_id;
443                 /**
444                  * The message which should be sent.
445                  */
446                 public ChannelReestablish msg;
447                 internal MessageSendEvent_SendChannelReestablish(long ptr) : base(null, ptr) {
448                         this.node_id = bindings.LDKMessageSendEvent_SendChannelReestablish_get_node_id(ptr);
449                         long msg = bindings.LDKMessageSendEvent_SendChannelReestablish_get_msg(ptr);
450                         org.ldk.structs.ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReestablish(null, msg); }
451                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
452                         this.msg = msg_hu_conv;
453                 }
454         }
455         /** A MessageSendEvent of type SendChannelAnnouncement */
456         public class MessageSendEvent_SendChannelAnnouncement : MessageSendEvent {
457                 /**
458                  * The node_id of the node which should receive this message
459                  */
460                 public byte[] node_id;
461                 /**
462                  * The channel_announcement which should be sent.
463                  */
464                 public ChannelAnnouncement msg;
465                 /**
466                  * The followup channel_update which should be sent.
467                  */
468                 public ChannelUpdate update_msg;
469                 internal MessageSendEvent_SendChannelAnnouncement(long ptr) : base(null, ptr) {
470                         this.node_id = bindings.LDKMessageSendEvent_SendChannelAnnouncement_get_node_id(ptr);
471                         long msg = bindings.LDKMessageSendEvent_SendChannelAnnouncement_get_msg(ptr);
472                         org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); }
473                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
474                         this.msg = msg_hu_conv;
475                         long update_msg = bindings.LDKMessageSendEvent_SendChannelAnnouncement_get_update_msg(ptr);
476                         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); }
477                         if (update_msg_hu_conv != null) { update_msg_hu_conv.ptrs_to.AddLast(this); };
478                         this.update_msg = update_msg_hu_conv;
479                 }
480         }
481         /** A MessageSendEvent of type BroadcastChannelAnnouncement */
482         public class MessageSendEvent_BroadcastChannelAnnouncement : MessageSendEvent {
483                 /**
484                  * The channel_announcement which should be sent.
485                  */
486                 public ChannelAnnouncement msg;
487                 /**
488                  * The followup channel_update which should be sent.
489                  * 
490                  * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
491                  */
492                 public ChannelUpdate update_msg;
493                 internal MessageSendEvent_BroadcastChannelAnnouncement(long ptr) : base(null, ptr) {
494                         long msg = bindings.LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg(ptr);
495                         org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); }
496                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
497                         this.msg = msg_hu_conv;
498                         long update_msg = bindings.LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg(ptr);
499                         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); }
500                         if (update_msg_hu_conv != null) { update_msg_hu_conv.ptrs_to.AddLast(this); };
501                         this.update_msg = update_msg_hu_conv;
502                 }
503         }
504         /** A MessageSendEvent of type BroadcastChannelUpdate */
505         public class MessageSendEvent_BroadcastChannelUpdate : MessageSendEvent {
506                 /**
507                  * The channel_update which should be sent.
508                  */
509                 public ChannelUpdate msg;
510                 internal MessageSendEvent_BroadcastChannelUpdate(long ptr) : base(null, ptr) {
511                         long msg = bindings.LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(ptr);
512                         org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); }
513                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
514                         this.msg = msg_hu_conv;
515                 }
516         }
517         /** A MessageSendEvent of type BroadcastNodeAnnouncement */
518         public class MessageSendEvent_BroadcastNodeAnnouncement : MessageSendEvent {
519                 /**
520                  * The node_announcement which should be sent.
521                  */
522                 public NodeAnnouncement msg;
523                 internal MessageSendEvent_BroadcastNodeAnnouncement(long ptr) : base(null, ptr) {
524                         long msg = bindings.LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg(ptr);
525                         org.ldk.structs.NodeAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.NodeAnnouncement(null, msg); }
526                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
527                         this.msg = msg_hu_conv;
528                 }
529         }
530         /** A MessageSendEvent of type SendChannelUpdate */
531         public class MessageSendEvent_SendChannelUpdate : MessageSendEvent {
532                 /**
533                  * The node_id of the node which should receive this message
534                  */
535                 public byte[] node_id;
536                 /**
537                  * The channel_update which should be sent.
538                  */
539                 public ChannelUpdate msg;
540                 internal MessageSendEvent_SendChannelUpdate(long ptr) : base(null, ptr) {
541                         this.node_id = bindings.LDKMessageSendEvent_SendChannelUpdate_get_node_id(ptr);
542                         long msg = bindings.LDKMessageSendEvent_SendChannelUpdate_get_msg(ptr);
543                         org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); }
544                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
545                         this.msg = msg_hu_conv;
546                 }
547         }
548         /** A MessageSendEvent of type HandleError */
549         public class MessageSendEvent_HandleError : MessageSendEvent {
550                 /**
551                  * The node_id of the node which should receive this message
552                  */
553                 public byte[] node_id;
554                 /**
555                  * The action which should be taken.
556                  */
557                 public ErrorAction action;
558                 internal MessageSendEvent_HandleError(long ptr) : base(null, ptr) {
559                         this.node_id = bindings.LDKMessageSendEvent_HandleError_get_node_id(ptr);
560                         long action = bindings.LDKMessageSendEvent_HandleError_get_action(ptr);
561                         org.ldk.structs.ErrorAction action_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(action);
562                         if (action_hu_conv != null) { action_hu_conv.ptrs_to.AddLast(this); };
563                         this.action = action_hu_conv;
564                 }
565         }
566         /** A MessageSendEvent of type SendChannelRangeQuery */
567         public class MessageSendEvent_SendChannelRangeQuery : MessageSendEvent {
568                 /**
569                  * The node_id of this message recipient
570                  */
571                 public byte[] node_id;
572                 /**
573                  * The query_channel_range which should be sent.
574                  */
575                 public QueryChannelRange msg;
576                 internal MessageSendEvent_SendChannelRangeQuery(long ptr) : base(null, ptr) {
577                         this.node_id = bindings.LDKMessageSendEvent_SendChannelRangeQuery_get_node_id(ptr);
578                         long msg = bindings.LDKMessageSendEvent_SendChannelRangeQuery_get_msg(ptr);
579                         org.ldk.structs.QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryChannelRange(null, msg); }
580                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
581                         this.msg = msg_hu_conv;
582                 }
583         }
584         /** A MessageSendEvent of type SendShortIdsQuery */
585         public class MessageSendEvent_SendShortIdsQuery : MessageSendEvent {
586                 /**
587                  * The node_id of this message recipient
588                  */
589                 public byte[] node_id;
590                 /**
591                  * The query_short_channel_ids which should be sent.
592                  */
593                 public QueryShortChannelIds msg;
594                 internal MessageSendEvent_SendShortIdsQuery(long ptr) : base(null, ptr) {
595                         this.node_id = bindings.LDKMessageSendEvent_SendShortIdsQuery_get_node_id(ptr);
596                         long msg = bindings.LDKMessageSendEvent_SendShortIdsQuery_get_msg(ptr);
597                         org.ldk.structs.QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, msg); }
598                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
599                         this.msg = msg_hu_conv;
600                 }
601         }
602         /** A MessageSendEvent of type SendReplyChannelRange */
603         public class MessageSendEvent_SendReplyChannelRange : MessageSendEvent {
604                 /**
605                  * The node_id of this message recipient
606                  */
607                 public byte[] node_id;
608                 /**
609                  * The reply_channel_range which should be sent.
610                  */
611                 public ReplyChannelRange msg;
612                 internal MessageSendEvent_SendReplyChannelRange(long ptr) : base(null, ptr) {
613                         this.node_id = bindings.LDKMessageSendEvent_SendReplyChannelRange_get_node_id(ptr);
614                         long msg = bindings.LDKMessageSendEvent_SendReplyChannelRange_get_msg(ptr);
615                         org.ldk.structs.ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ReplyChannelRange(null, msg); }
616                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
617                         this.msg = msg_hu_conv;
618                 }
619         }
620         /** A MessageSendEvent of type SendGossipTimestampFilter */
621         public class MessageSendEvent_SendGossipTimestampFilter : MessageSendEvent {
622                 /**
623                  * The node_id of this message recipient
624                  */
625                 public byte[] node_id;
626                 /**
627                  * The gossip_timestamp_filter which should be sent.
628                  */
629                 public GossipTimestampFilter msg;
630                 internal MessageSendEvent_SendGossipTimestampFilter(long ptr) : base(null, ptr) {
631                         this.node_id = bindings.LDKMessageSendEvent_SendGossipTimestampFilter_get_node_id(ptr);
632                         long msg = bindings.LDKMessageSendEvent_SendGossipTimestampFilter_get_msg(ptr);
633                         org.ldk.structs.GossipTimestampFilter msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.GossipTimestampFilter(null, msg); }
634                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
635                         this.msg = msg_hu_conv;
636                 }
637         }
638         internal long clone_ptr() {
639                 long ret = bindings.MessageSendEvent_clone_ptr(this.ptr);
640                 GC.KeepAlive(this);
641                 return ret;
642         }
643
644         /**
645          * Creates a copy of the MessageSendEvent
646          */
647         public MessageSendEvent clone() {
648                 long ret = bindings.MessageSendEvent_clone(this.ptr);
649                 GC.KeepAlive(this);
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(this); };
653                 return ret_hu_conv;
654         }
655
656         /**
657          * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
658          */
659         public static MessageSendEvent send_accept_channel(byte[] node_id, org.ldk.structs.AcceptChannel msg) {
660                 long ret = bindings.MessageSendEvent_send_accept_channel(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 SendAcceptChannelV2-variant MessageSendEvent
672          */
673         public static MessageSendEvent send_accept_channel_v2(byte[] node_id, org.ldk.structs.AcceptChannelV2 msg) {
674                 long ret = bindings.MessageSendEvent_send_accept_channel_v2(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 SendOpenChannel-variant MessageSendEvent
686          */
687         public static MessageSendEvent send_open_channel(byte[] node_id, org.ldk.structs.OpenChannel msg) {
688                 long ret = bindings.MessageSendEvent_send_open_channel(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 SendOpenChannelV2-variant MessageSendEvent
700          */
701         public static MessageSendEvent send_open_channel_v2(byte[] node_id, org.ldk.structs.OpenChannelV2 msg) {
702                 long ret = bindings.MessageSendEvent_send_open_channel_v2(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          * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
714          */
715         public static MessageSendEvent send_funding_created(byte[] node_id, org.ldk.structs.FundingCreated msg) {
716                 long ret = bindings.MessageSendEvent_send_funding_created(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
717                 GC.KeepAlive(node_id);
718                 GC.KeepAlive(msg);
719                 if (ret >= 0 && ret <= 4096) { return null; }
720                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
721                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
722                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
723                 return ret_hu_conv;
724         }
725
726         /**
727          * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
728          */
729         public static MessageSendEvent send_funding_signed(byte[] node_id, org.ldk.structs.FundingSigned msg) {
730                 long ret = bindings.MessageSendEvent_send_funding_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
731                 GC.KeepAlive(node_id);
732                 GC.KeepAlive(msg);
733                 if (ret >= 0 && ret <= 4096) { return null; }
734                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
735                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
736                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
737                 return ret_hu_conv;
738         }
739
740         /**
741          * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
742          */
743         public static MessageSendEvent send_tx_add_input(byte[] node_id, org.ldk.structs.TxAddInput msg) {
744                 long ret = bindings.MessageSendEvent_send_tx_add_input(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
745                 GC.KeepAlive(node_id);
746                 GC.KeepAlive(msg);
747                 if (ret >= 0 && ret <= 4096) { return null; }
748                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
749                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
750                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
751                 return ret_hu_conv;
752         }
753
754         /**
755          * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
756          */
757         public static MessageSendEvent send_tx_add_output(byte[] node_id, org.ldk.structs.TxAddOutput msg) {
758                 long ret = bindings.MessageSendEvent_send_tx_add_output(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
759                 GC.KeepAlive(node_id);
760                 GC.KeepAlive(msg);
761                 if (ret >= 0 && ret <= 4096) { return null; }
762                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
763                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
764                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
765                 return ret_hu_conv;
766         }
767
768         /**
769          * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
770          */
771         public static MessageSendEvent send_tx_remove_input(byte[] node_id, org.ldk.structs.TxRemoveInput msg) {
772                 long ret = bindings.MessageSendEvent_send_tx_remove_input(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
773                 GC.KeepAlive(node_id);
774                 GC.KeepAlive(msg);
775                 if (ret >= 0 && ret <= 4096) { return null; }
776                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
777                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
778                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
779                 return ret_hu_conv;
780         }
781
782         /**
783          * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
784          */
785         public static MessageSendEvent send_tx_remove_output(byte[] node_id, org.ldk.structs.TxRemoveOutput msg) {
786                 long ret = bindings.MessageSendEvent_send_tx_remove_output(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
787                 GC.KeepAlive(node_id);
788                 GC.KeepAlive(msg);
789                 if (ret >= 0 && ret <= 4096) { return null; }
790                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
791                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
792                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
793                 return ret_hu_conv;
794         }
795
796         /**
797          * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
798          */
799         public static MessageSendEvent send_tx_complete(byte[] node_id, org.ldk.structs.TxComplete msg) {
800                 long ret = bindings.MessageSendEvent_send_tx_complete(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
801                 GC.KeepAlive(node_id);
802                 GC.KeepAlive(msg);
803                 if (ret >= 0 && ret <= 4096) { return null; }
804                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
805                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
806                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
807                 return ret_hu_conv;
808         }
809
810         /**
811          * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent
812          */
813         public static MessageSendEvent send_tx_signatures(byte[] node_id, org.ldk.structs.TxSignatures msg) {
814                 long ret = bindings.MessageSendEvent_send_tx_signatures(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
815                 GC.KeepAlive(node_id);
816                 GC.KeepAlive(msg);
817                 if (ret >= 0 && ret <= 4096) { return null; }
818                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
819                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
820                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
821                 return ret_hu_conv;
822         }
823
824         /**
825          * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
826          */
827         public static MessageSendEvent send_tx_init_rbf(byte[] node_id, org.ldk.structs.TxInitRbf msg) {
828                 long ret = bindings.MessageSendEvent_send_tx_init_rbf(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
829                 GC.KeepAlive(node_id);
830                 GC.KeepAlive(msg);
831                 if (ret >= 0 && ret <= 4096) { return null; }
832                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
833                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
834                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
835                 return ret_hu_conv;
836         }
837
838         /**
839          * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
840          */
841         public static MessageSendEvent send_tx_ack_rbf(byte[] node_id, org.ldk.structs.TxAckRbf msg) {
842                 long ret = bindings.MessageSendEvent_send_tx_ack_rbf(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
843                 GC.KeepAlive(node_id);
844                 GC.KeepAlive(msg);
845                 if (ret >= 0 && ret <= 4096) { return null; }
846                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
847                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
848                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
849                 return ret_hu_conv;
850         }
851
852         /**
853          * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
854          */
855         public static MessageSendEvent send_tx_abort(byte[] node_id, org.ldk.structs.TxAddInput msg) {
856                 long ret = bindings.MessageSendEvent_send_tx_abort(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
857                 GC.KeepAlive(node_id);
858                 GC.KeepAlive(msg);
859                 if (ret >= 0 && ret <= 4096) { return null; }
860                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
861                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
862                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
863                 return ret_hu_conv;
864         }
865
866         /**
867          * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
868          */
869         public static MessageSendEvent send_channel_ready(byte[] node_id, org.ldk.structs.ChannelReady msg) {
870                 long ret = bindings.MessageSendEvent_send_channel_ready(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
871                 GC.KeepAlive(node_id);
872                 GC.KeepAlive(msg);
873                 if (ret >= 0 && ret <= 4096) { return null; }
874                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
875                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
876                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
877                 return ret_hu_conv;
878         }
879
880         /**
881          * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
882          */
883         public static MessageSendEvent send_announcement_signatures(byte[] node_id, org.ldk.structs.AnnouncementSignatures msg) {
884                 long ret = bindings.MessageSendEvent_send_announcement_signatures(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
885                 GC.KeepAlive(node_id);
886                 GC.KeepAlive(msg);
887                 if (ret >= 0 && ret <= 4096) { return null; }
888                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
889                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
890                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
891                 return ret_hu_conv;
892         }
893
894         /**
895          * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
896          */
897         public static MessageSendEvent update_htlcs(byte[] node_id, org.ldk.structs.CommitmentUpdate updates) {
898                 long ret = bindings.MessageSendEvent_update_htlcs(InternalUtils.check_arr_len(node_id, 33), updates == null ? 0 : updates.ptr);
899                 GC.KeepAlive(node_id);
900                 GC.KeepAlive(updates);
901                 if (ret >= 0 && ret <= 4096) { return null; }
902                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
903                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
904                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(updates); };
905                 return ret_hu_conv;
906         }
907
908         /**
909          * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
910          */
911         public static MessageSendEvent send_revoke_and_ack(byte[] node_id, org.ldk.structs.RevokeAndACK msg) {
912                 long ret = bindings.MessageSendEvent_send_revoke_and_ack(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
913                 GC.KeepAlive(node_id);
914                 GC.KeepAlive(msg);
915                 if (ret >= 0 && ret <= 4096) { return null; }
916                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
917                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
918                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
919                 return ret_hu_conv;
920         }
921
922         /**
923          * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
924          */
925         public static MessageSendEvent send_closing_signed(byte[] node_id, org.ldk.structs.ClosingSigned msg) {
926                 long ret = bindings.MessageSendEvent_send_closing_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
927                 GC.KeepAlive(node_id);
928                 GC.KeepAlive(msg);
929                 if (ret >= 0 && ret <= 4096) { return null; }
930                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
931                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
932                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
933                 return ret_hu_conv;
934         }
935
936         /**
937          * Utility method to constructs a new SendShutdown-variant MessageSendEvent
938          */
939         public static MessageSendEvent send_shutdown(byte[] node_id, org.ldk.structs.Shutdown msg) {
940                 long ret = bindings.MessageSendEvent_send_shutdown(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
941                 GC.KeepAlive(node_id);
942                 GC.KeepAlive(msg);
943                 if (ret >= 0 && ret <= 4096) { return null; }
944                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
945                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
946                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
947                 return ret_hu_conv;
948         }
949
950         /**
951          * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
952          */
953         public static MessageSendEvent send_channel_reestablish(byte[] node_id, org.ldk.structs.ChannelReestablish msg) {
954                 long ret = bindings.MessageSendEvent_send_channel_reestablish(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
955                 GC.KeepAlive(node_id);
956                 GC.KeepAlive(msg);
957                 if (ret >= 0 && ret <= 4096) { return null; }
958                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
959                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
960                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
961                 return ret_hu_conv;
962         }
963
964         /**
965          * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
966          */
967         public static MessageSendEvent send_channel_announcement(byte[] node_id, org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) {
968                 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);
969                 GC.KeepAlive(node_id);
970                 GC.KeepAlive(msg);
971                 GC.KeepAlive(update_msg);
972                 if (ret >= 0 && ret <= 4096) { return null; }
973                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
974                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
975                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
976                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_msg); };
977                 return ret_hu_conv;
978         }
979
980         /**
981          * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
982          */
983         public static MessageSendEvent broadcast_channel_announcement(org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) {
984                 long ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : msg.ptr, update_msg == null ? 0 : update_msg.ptr);
985                 GC.KeepAlive(msg);
986                 GC.KeepAlive(update_msg);
987                 if (ret >= 0 && ret <= 4096) { return null; }
988                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
989                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
990                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
991                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_msg); };
992                 return ret_hu_conv;
993         }
994
995         /**
996          * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
997          */
998         public static MessageSendEvent broadcast_channel_update(org.ldk.structs.ChannelUpdate msg) {
999                 long ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr);
1000                 GC.KeepAlive(msg);
1001                 if (ret >= 0 && ret <= 4096) { return null; }
1002                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1003                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1004                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1005                 return ret_hu_conv;
1006         }
1007
1008         /**
1009          * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
1010          */
1011         public static MessageSendEvent broadcast_node_announcement(org.ldk.structs.NodeAnnouncement msg) {
1012                 long ret = bindings.MessageSendEvent_broadcast_node_announcement(msg == null ? 0 : msg.ptr);
1013                 GC.KeepAlive(msg);
1014                 if (ret >= 0 && ret <= 4096) { return null; }
1015                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1016                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1017                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1018                 return ret_hu_conv;
1019         }
1020
1021         /**
1022          * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
1023          */
1024         public static MessageSendEvent send_channel_update(byte[] node_id, org.ldk.structs.ChannelUpdate msg) {
1025                 long ret = bindings.MessageSendEvent_send_channel_update(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1026                 GC.KeepAlive(node_id);
1027                 GC.KeepAlive(msg);
1028                 if (ret >= 0 && ret <= 4096) { return null; }
1029                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1030                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1031                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1032                 return ret_hu_conv;
1033         }
1034
1035         /**
1036          * Utility method to constructs a new HandleError-variant MessageSendEvent
1037          */
1038         public static MessageSendEvent handle_error(byte[] node_id, org.ldk.structs.ErrorAction action) {
1039                 long ret = bindings.MessageSendEvent_handle_error(InternalUtils.check_arr_len(node_id, 33), action.ptr);
1040                 GC.KeepAlive(node_id);
1041                 GC.KeepAlive(action);
1042                 if (ret >= 0 && ret <= 4096) { return null; }
1043                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1044                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1045                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(action); };
1046                 return ret_hu_conv;
1047         }
1048
1049         /**
1050          * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
1051          */
1052         public static MessageSendEvent send_channel_range_query(byte[] node_id, org.ldk.structs.QueryChannelRange msg) {
1053                 long ret = bindings.MessageSendEvent_send_channel_range_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1054                 GC.KeepAlive(node_id);
1055                 GC.KeepAlive(msg);
1056                 if (ret >= 0 && ret <= 4096) { return null; }
1057                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1058                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1059                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1060                 return ret_hu_conv;
1061         }
1062
1063         /**
1064          * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
1065          */
1066         public static MessageSendEvent send_short_ids_query(byte[] node_id, org.ldk.structs.QueryShortChannelIds msg) {
1067                 long ret = bindings.MessageSendEvent_send_short_ids_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1068                 GC.KeepAlive(node_id);
1069                 GC.KeepAlive(msg);
1070                 if (ret >= 0 && ret <= 4096) { return null; }
1071                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1072                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1073                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1074                 return ret_hu_conv;
1075         }
1076
1077         /**
1078          * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
1079          */
1080         public static MessageSendEvent send_reply_channel_range(byte[] node_id, org.ldk.structs.ReplyChannelRange msg) {
1081                 long ret = bindings.MessageSendEvent_send_reply_channel_range(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1082                 GC.KeepAlive(node_id);
1083                 GC.KeepAlive(msg);
1084                 if (ret >= 0 && ret <= 4096) { return null; }
1085                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1086                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1087                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1088                 return ret_hu_conv;
1089         }
1090
1091         /**
1092          * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
1093          */
1094         public static MessageSendEvent send_gossip_timestamp_filter(byte[] node_id, org.ldk.structs.GossipTimestampFilter msg) {
1095                 long ret = bindings.MessageSendEvent_send_gossip_timestamp_filter(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1096                 GC.KeepAlive(node_id);
1097                 GC.KeepAlive(msg);
1098                 if (ret >= 0 && ret <= 4096) { return null; }
1099                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1100                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1101                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1102                 return ret_hu_conv;
1103         }
1104
1105 }
1106 } } }