[C#] Update 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_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_SendStfu(ptr);
29                         case 7: return new MessageSendEvent_SendSplice(ptr);
30                         case 8: return new MessageSendEvent_SendSpliceAck(ptr);
31                         case 9: return new MessageSendEvent_SendSpliceLocked(ptr);
32                         case 10: return new MessageSendEvent_SendTxAddInput(ptr);
33                         case 11: return new MessageSendEvent_SendTxAddOutput(ptr);
34                         case 12: return new MessageSendEvent_SendTxRemoveInput(ptr);
35                         case 13: return new MessageSendEvent_SendTxRemoveOutput(ptr);
36                         case 14: return new MessageSendEvent_SendTxComplete(ptr);
37                         case 15: return new MessageSendEvent_SendTxSignatures(ptr);
38                         case 16: return new MessageSendEvent_SendTxInitRbf(ptr);
39                         case 17: return new MessageSendEvent_SendTxAckRbf(ptr);
40                         case 18: return new MessageSendEvent_SendTxAbort(ptr);
41                         case 19: return new MessageSendEvent_SendChannelReady(ptr);
42                         case 20: return new MessageSendEvent_SendAnnouncementSignatures(ptr);
43                         case 21: return new MessageSendEvent_UpdateHTLCs(ptr);
44                         case 22: return new MessageSendEvent_SendRevokeAndACK(ptr);
45                         case 23: return new MessageSendEvent_SendClosingSigned(ptr);
46                         case 24: return new MessageSendEvent_SendShutdown(ptr);
47                         case 25: return new MessageSendEvent_SendChannelReestablish(ptr);
48                         case 26: return new MessageSendEvent_SendChannelAnnouncement(ptr);
49                         case 27: return new MessageSendEvent_BroadcastChannelAnnouncement(ptr);
50                         case 28: return new MessageSendEvent_BroadcastChannelUpdate(ptr);
51                         case 29: return new MessageSendEvent_BroadcastNodeAnnouncement(ptr);
52                         case 30: return new MessageSendEvent_SendChannelUpdate(ptr);
53                         case 31: return new MessageSendEvent_HandleError(ptr);
54                         case 32: return new MessageSendEvent_SendChannelRangeQuery(ptr);
55                         case 33: return new MessageSendEvent_SendShortIdsQuery(ptr);
56                         case 34: return new MessageSendEvent_SendReplyChannelRange(ptr);
57                         case 35: return new MessageSendEvent_SendGossipTimestampFilter(ptr);
58                         default:
59                                 throw new ArgumentException("Impossible enum variant");
60                 }
61         }
62
63         /** A MessageSendEvent of type SendAcceptChannel */
64         public class MessageSendEvent_SendAcceptChannel : MessageSendEvent {
65                 /**
66                  * The node_id of the node which should receive this message
67                  */
68                 public byte[] node_id;
69                 /**
70                  * The message which should be sent.
71                  */
72                 public AcceptChannel msg;
73                 internal MessageSendEvent_SendAcceptChannel(long ptr) : base(null, ptr) {
74                         long node_id = bindings.LDKMessageSendEvent_SendAcceptChannel_get_node_id(ptr);
75                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
76                         this.node_id = node_id_conv;
77                         long msg = bindings.LDKMessageSendEvent_SendAcceptChannel_get_msg(ptr);
78                         org.ldk.structs.AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannel(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 SendAcceptChannelV2 */
84         public class MessageSendEvent_SendAcceptChannelV2 : 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 AcceptChannelV2 msg;
93                 internal MessageSendEvent_SendAcceptChannelV2(long ptr) : base(null, ptr) {
94                         long node_id = bindings.LDKMessageSendEvent_SendAcceptChannelV2_get_node_id(ptr);
95                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
96                         this.node_id = node_id_conv;
97                         long msg = bindings.LDKMessageSendEvent_SendAcceptChannelV2_get_msg(ptr);
98                         org.ldk.structs.AcceptChannelV2 msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannelV2(null, msg); }
99                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
100                         this.msg = msg_hu_conv;
101                 }
102         }
103         /** A MessageSendEvent of type SendOpenChannel */
104         public class MessageSendEvent_SendOpenChannel : MessageSendEvent {
105                 /**
106                  * The node_id of the node which should receive this message
107                  */
108                 public byte[] node_id;
109                 /**
110                  * The message which should be sent.
111                  */
112                 public OpenChannel msg;
113                 internal MessageSendEvent_SendOpenChannel(long ptr) : base(null, ptr) {
114                         long node_id = bindings.LDKMessageSendEvent_SendOpenChannel_get_node_id(ptr);
115                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
116                         this.node_id = node_id_conv;
117                         long msg = bindings.LDKMessageSendEvent_SendOpenChannel_get_msg(ptr);
118                         org.ldk.structs.OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannel(null, msg); }
119                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
120                         this.msg = msg_hu_conv;
121                 }
122         }
123         /** A MessageSendEvent of type SendOpenChannelV2 */
124         public class MessageSendEvent_SendOpenChannelV2 : MessageSendEvent {
125                 /**
126                  * The node_id of the node which should receive this message
127                  */
128                 public byte[] node_id;
129                 /**
130                  * The message which should be sent.
131                  */
132                 public OpenChannelV2 msg;
133                 internal MessageSendEvent_SendOpenChannelV2(long ptr) : base(null, ptr) {
134                         long node_id = bindings.LDKMessageSendEvent_SendOpenChannelV2_get_node_id(ptr);
135                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
136                         this.node_id = node_id_conv;
137                         long msg = bindings.LDKMessageSendEvent_SendOpenChannelV2_get_msg(ptr);
138                         org.ldk.structs.OpenChannelV2 msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannelV2(null, msg); }
139                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
140                         this.msg = msg_hu_conv;
141                 }
142         }
143         /** A MessageSendEvent of type SendFundingCreated */
144         public class MessageSendEvent_SendFundingCreated : MessageSendEvent {
145                 /**
146                  * The node_id of the node which should receive this message
147                  */
148                 public byte[] node_id;
149                 /**
150                  * The message which should be sent.
151                  */
152                 public FundingCreated msg;
153                 internal MessageSendEvent_SendFundingCreated(long ptr) : base(null, ptr) {
154                         long node_id = bindings.LDKMessageSendEvent_SendFundingCreated_get_node_id(ptr);
155                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
156                         this.node_id = node_id_conv;
157                         long msg = bindings.LDKMessageSendEvent_SendFundingCreated_get_msg(ptr);
158                         org.ldk.structs.FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingCreated(null, msg); }
159                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
160                         this.msg = msg_hu_conv;
161                 }
162         }
163         /** A MessageSendEvent of type SendFundingSigned */
164         public class MessageSendEvent_SendFundingSigned : MessageSendEvent {
165                 /**
166                  * The node_id of the node which should receive this message
167                  */
168                 public byte[] node_id;
169                 /**
170                  * The message which should be sent.
171                  */
172                 public FundingSigned msg;
173                 internal MessageSendEvent_SendFundingSigned(long ptr) : base(null, ptr) {
174                         long node_id = bindings.LDKMessageSendEvent_SendFundingSigned_get_node_id(ptr);
175                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
176                         this.node_id = node_id_conv;
177                         long msg = bindings.LDKMessageSendEvent_SendFundingSigned_get_msg(ptr);
178                         org.ldk.structs.FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingSigned(null, msg); }
179                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
180                         this.msg = msg_hu_conv;
181                 }
182         }
183         /** A MessageSendEvent of type SendStfu */
184         public class MessageSendEvent_SendStfu : MessageSendEvent {
185                 /**
186                  * The node_id of the node which should receive this message
187                  */
188                 public byte[] node_id;
189                 /**
190                  * The message which should be sent.
191                  */
192                 public Stfu msg;
193                 internal MessageSendEvent_SendStfu(long ptr) : base(null, ptr) {
194                         long node_id = bindings.LDKMessageSendEvent_SendStfu_get_node_id(ptr);
195                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
196                         this.node_id = node_id_conv;
197                         long msg = bindings.LDKMessageSendEvent_SendStfu_get_msg(ptr);
198                         org.ldk.structs.Stfu msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Stfu(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 SendSplice */
204         public class MessageSendEvent_SendSplice : 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 Splice msg;
213                 internal MessageSendEvent_SendSplice(long ptr) : base(null, ptr) {
214                         long node_id = bindings.LDKMessageSendEvent_SendSplice_get_node_id(ptr);
215                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
216                         this.node_id = node_id_conv;
217                         long msg = bindings.LDKMessageSendEvent_SendSplice_get_msg(ptr);
218                         org.ldk.structs.Splice msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Splice(null, msg); }
219                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
220                         this.msg = msg_hu_conv;
221                 }
222         }
223         /** A MessageSendEvent of type SendSpliceAck */
224         public class MessageSendEvent_SendSpliceAck : MessageSendEvent {
225                 /**
226                  * The node_id of the node which should receive this message
227                  */
228                 public byte[] node_id;
229                 /**
230                  * The message which should be sent.
231                  */
232                 public SpliceAck msg;
233                 internal MessageSendEvent_SendSpliceAck(long ptr) : base(null, ptr) {
234                         long node_id = bindings.LDKMessageSendEvent_SendSpliceAck_get_node_id(ptr);
235                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
236                         this.node_id = node_id_conv;
237                         long msg = bindings.LDKMessageSendEvent_SendSpliceAck_get_msg(ptr);
238                         org.ldk.structs.SpliceAck msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.SpliceAck(null, msg); }
239                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
240                         this.msg = msg_hu_conv;
241                 }
242         }
243         /** A MessageSendEvent of type SendSpliceLocked */
244         public class MessageSendEvent_SendSpliceLocked : MessageSendEvent {
245                 /**
246                  * The node_id of the node which should receive this message
247                  */
248                 public byte[] node_id;
249                 /**
250                  * The message which should be sent.
251                  */
252                 public SpliceLocked msg;
253                 internal MessageSendEvent_SendSpliceLocked(long ptr) : base(null, ptr) {
254                         long node_id = bindings.LDKMessageSendEvent_SendSpliceLocked_get_node_id(ptr);
255                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
256                         this.node_id = node_id_conv;
257                         long msg = bindings.LDKMessageSendEvent_SendSpliceLocked_get_msg(ptr);
258                         org.ldk.structs.SpliceLocked msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.SpliceLocked(null, msg); }
259                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
260                         this.msg = msg_hu_conv;
261                 }
262         }
263         /** A MessageSendEvent of type SendTxAddInput */
264         public class MessageSendEvent_SendTxAddInput : MessageSendEvent {
265                 /**
266                  * The node_id of the node which should receive this message
267                  */
268                 public byte[] node_id;
269                 /**
270                  * The message which should be sent.
271                  */
272                 public TxAddInput msg;
273                 internal MessageSendEvent_SendTxAddInput(long ptr) : base(null, ptr) {
274                         long node_id = bindings.LDKMessageSendEvent_SendTxAddInput_get_node_id(ptr);
275                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
276                         this.node_id = node_id_conv;
277                         long msg = bindings.LDKMessageSendEvent_SendTxAddInput_get_msg(ptr);
278                         org.ldk.structs.TxAddInput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAddInput(null, msg); }
279                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
280                         this.msg = msg_hu_conv;
281                 }
282         }
283         /** A MessageSendEvent of type SendTxAddOutput */
284         public class MessageSendEvent_SendTxAddOutput : MessageSendEvent {
285                 /**
286                  * The node_id of the node which should receive this message
287                  */
288                 public byte[] node_id;
289                 /**
290                  * The message which should be sent.
291                  */
292                 public TxAddOutput msg;
293                 internal MessageSendEvent_SendTxAddOutput(long ptr) : base(null, ptr) {
294                         long node_id = bindings.LDKMessageSendEvent_SendTxAddOutput_get_node_id(ptr);
295                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
296                         this.node_id = node_id_conv;
297                         long msg = bindings.LDKMessageSendEvent_SendTxAddOutput_get_msg(ptr);
298                         org.ldk.structs.TxAddOutput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAddOutput(null, msg); }
299                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
300                         this.msg = msg_hu_conv;
301                 }
302         }
303         /** A MessageSendEvent of type SendTxRemoveInput */
304         public class MessageSendEvent_SendTxRemoveInput : MessageSendEvent {
305                 /**
306                  * The node_id of the node which should receive this message
307                  */
308                 public byte[] node_id;
309                 /**
310                  * The message which should be sent.
311                  */
312                 public TxRemoveInput msg;
313                 internal MessageSendEvent_SendTxRemoveInput(long ptr) : base(null, ptr) {
314                         long node_id = bindings.LDKMessageSendEvent_SendTxRemoveInput_get_node_id(ptr);
315                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
316                         this.node_id = node_id_conv;
317                         long msg = bindings.LDKMessageSendEvent_SendTxRemoveInput_get_msg(ptr);
318                         org.ldk.structs.TxRemoveInput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxRemoveInput(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 SendTxRemoveOutput */
324         public class MessageSendEvent_SendTxRemoveOutput : MessageSendEvent {
325                 /**
326                  * The node_id of the node which should receive this message
327                  */
328                 public byte[] node_id;
329                 /**
330                  * The message which should be sent.
331                  */
332                 public TxRemoveOutput msg;
333                 internal MessageSendEvent_SendTxRemoveOutput(long ptr) : base(null, ptr) {
334                         long node_id = bindings.LDKMessageSendEvent_SendTxRemoveOutput_get_node_id(ptr);
335                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
336                         this.node_id = node_id_conv;
337                         long msg = bindings.LDKMessageSendEvent_SendTxRemoveOutput_get_msg(ptr);
338                         org.ldk.structs.TxRemoveOutput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxRemoveOutput(null, msg); }
339                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
340                         this.msg = msg_hu_conv;
341                 }
342         }
343         /** A MessageSendEvent of type SendTxComplete */
344         public class MessageSendEvent_SendTxComplete : MessageSendEvent {
345                 /**
346                  * The node_id of the node which should receive this message
347                  */
348                 public byte[] node_id;
349                 /**
350                  * The message which should be sent.
351                  */
352                 public TxComplete msg;
353                 internal MessageSendEvent_SendTxComplete(long ptr) : base(null, ptr) {
354                         long node_id = bindings.LDKMessageSendEvent_SendTxComplete_get_node_id(ptr);
355                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
356                         this.node_id = node_id_conv;
357                         long msg = bindings.LDKMessageSendEvent_SendTxComplete_get_msg(ptr);
358                         org.ldk.structs.TxComplete msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxComplete(null, msg); }
359                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
360                         this.msg = msg_hu_conv;
361                 }
362         }
363         /** A MessageSendEvent of type SendTxSignatures */
364         public class MessageSendEvent_SendTxSignatures : MessageSendEvent {
365                 /**
366                  * The node_id of the node which should receive this message
367                  */
368                 public byte[] node_id;
369                 /**
370                  * The message which should be sent.
371                  */
372                 public TxSignatures msg;
373                 internal MessageSendEvent_SendTxSignatures(long ptr) : base(null, ptr) {
374                         long node_id = bindings.LDKMessageSendEvent_SendTxSignatures_get_node_id(ptr);
375                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
376                         this.node_id = node_id_conv;
377                         long msg = bindings.LDKMessageSendEvent_SendTxSignatures_get_msg(ptr);
378                         org.ldk.structs.TxSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxSignatures(null, msg); }
379                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
380                         this.msg = msg_hu_conv;
381                 }
382         }
383         /** A MessageSendEvent of type SendTxInitRbf */
384         public class MessageSendEvent_SendTxInitRbf : 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 TxInitRbf msg;
393                 internal MessageSendEvent_SendTxInitRbf(long ptr) : base(null, ptr) {
394                         long node_id = bindings.LDKMessageSendEvent_SendTxInitRbf_get_node_id(ptr);
395                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
396                         this.node_id = node_id_conv;
397                         long msg = bindings.LDKMessageSendEvent_SendTxInitRbf_get_msg(ptr);
398                         org.ldk.structs.TxInitRbf msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxInitRbf(null, msg); }
399                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
400                         this.msg = msg_hu_conv;
401                 }
402         }
403         /** A MessageSendEvent of type SendTxAckRbf */
404         public class MessageSendEvent_SendTxAckRbf : MessageSendEvent {
405                 /**
406                  * The node_id of the node which should receive this message
407                  */
408                 public byte[] node_id;
409                 /**
410                  * The message which should be sent.
411                  */
412                 public TxAckRbf msg;
413                 internal MessageSendEvent_SendTxAckRbf(long ptr) : base(null, ptr) {
414                         long node_id = bindings.LDKMessageSendEvent_SendTxAckRbf_get_node_id(ptr);
415                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
416                         this.node_id = node_id_conv;
417                         long msg = bindings.LDKMessageSendEvent_SendTxAckRbf_get_msg(ptr);
418                         org.ldk.structs.TxAckRbf msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAckRbf(null, msg); }
419                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
420                         this.msg = msg_hu_conv;
421                 }
422         }
423         /** A MessageSendEvent of type SendTxAbort */
424         public class MessageSendEvent_SendTxAbort : MessageSendEvent {
425                 /**
426                  * The node_id of the node which should receive this message
427                  */
428                 public byte[] node_id;
429                 /**
430                  * The message which should be sent.
431                  */
432                 public TxAbort msg;
433                 internal MessageSendEvent_SendTxAbort(long ptr) : base(null, ptr) {
434                         long node_id = bindings.LDKMessageSendEvent_SendTxAbort_get_node_id(ptr);
435                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
436                         this.node_id = node_id_conv;
437                         long msg = bindings.LDKMessageSendEvent_SendTxAbort_get_msg(ptr);
438                         org.ldk.structs.TxAbort msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAbort(null, msg); }
439                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
440                         this.msg = msg_hu_conv;
441                 }
442         }
443         /** A MessageSendEvent of type SendChannelReady */
444         public class MessageSendEvent_SendChannelReady : MessageSendEvent {
445                 /**
446                  * The node_id of the node which should receive these message(s)
447                  */
448                 public byte[] node_id;
449                 /**
450                  * The channel_ready message which should be sent.
451                  */
452                 public ChannelReady msg;
453                 internal MessageSendEvent_SendChannelReady(long ptr) : base(null, ptr) {
454                         long node_id = bindings.LDKMessageSendEvent_SendChannelReady_get_node_id(ptr);
455                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
456                         this.node_id = node_id_conv;
457                         long msg = bindings.LDKMessageSendEvent_SendChannelReady_get_msg(ptr);
458                         org.ldk.structs.ChannelReady msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReady(null, msg); }
459                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
460                         this.msg = msg_hu_conv;
461                 }
462         }
463         /** A MessageSendEvent of type SendAnnouncementSignatures */
464         public class MessageSendEvent_SendAnnouncementSignatures : MessageSendEvent {
465                 /**
466                  * The node_id of the node which should receive these message(s)
467                  */
468                 public byte[] node_id;
469                 /**
470                  * The announcement_signatures message which should be sent.
471                  */
472                 public AnnouncementSignatures msg;
473                 internal MessageSendEvent_SendAnnouncementSignatures(long ptr) : base(null, ptr) {
474                         long node_id = bindings.LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id(ptr);
475                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
476                         this.node_id = node_id_conv;
477                         long msg = bindings.LDKMessageSendEvent_SendAnnouncementSignatures_get_msg(ptr);
478                         org.ldk.structs.AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, msg); }
479                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
480                         this.msg = msg_hu_conv;
481                 }
482         }
483         /** A MessageSendEvent of type UpdateHTLCs */
484         public class MessageSendEvent_UpdateHTLCs : MessageSendEvent {
485                 /**
486                  * The node_id of the node which should receive these message(s)
487                  */
488                 public byte[] node_id;
489                 /**
490                  * The update messages which should be sent. ALL messages in the struct should be sent!
491                  */
492                 public CommitmentUpdate updates;
493                 internal MessageSendEvent_UpdateHTLCs(long ptr) : base(null, ptr) {
494                         long node_id = bindings.LDKMessageSendEvent_UpdateHTLCs_get_node_id(ptr);
495                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
496                         this.node_id = node_id_conv;
497                         long updates = bindings.LDKMessageSendEvent_UpdateHTLCs_get_updates(ptr);
498                         org.ldk.structs.CommitmentUpdate updates_hu_conv = null; if (updates < 0 || updates > 4096) { updates_hu_conv = new org.ldk.structs.CommitmentUpdate(null, updates); }
499                         if (updates_hu_conv != null) { updates_hu_conv.ptrs_to.AddLast(this); };
500                         this.updates = updates_hu_conv;
501                 }
502         }
503         /** A MessageSendEvent of type SendRevokeAndACK */
504         public class MessageSendEvent_SendRevokeAndACK : MessageSendEvent {
505                 /**
506                  * The node_id of the node which should receive this message
507                  */
508                 public byte[] node_id;
509                 /**
510                  * The message which should be sent.
511                  */
512                 public RevokeAndACK msg;
513                 internal MessageSendEvent_SendRevokeAndACK(long ptr) : base(null, ptr) {
514                         long node_id = bindings.LDKMessageSendEvent_SendRevokeAndACK_get_node_id(ptr);
515                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
516                         this.node_id = node_id_conv;
517                         long msg = bindings.LDKMessageSendEvent_SendRevokeAndACK_get_msg(ptr);
518                         org.ldk.structs.RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.RevokeAndACK(null, msg); }
519                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
520                         this.msg = msg_hu_conv;
521                 }
522         }
523         /** A MessageSendEvent of type SendClosingSigned */
524         public class MessageSendEvent_SendClosingSigned : MessageSendEvent {
525                 /**
526                  * The node_id of the node which should receive this message
527                  */
528                 public byte[] node_id;
529                 /**
530                  * The message which should be sent.
531                  */
532                 public ClosingSigned msg;
533                 internal MessageSendEvent_SendClosingSigned(long ptr) : base(null, ptr) {
534                         long node_id = bindings.LDKMessageSendEvent_SendClosingSigned_get_node_id(ptr);
535                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
536                         this.node_id = node_id_conv;
537                         long msg = bindings.LDKMessageSendEvent_SendClosingSigned_get_msg(ptr);
538                         org.ldk.structs.ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ClosingSigned(null, msg); }
539                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
540                         this.msg = msg_hu_conv;
541                 }
542         }
543         /** A MessageSendEvent of type SendShutdown */
544         public class MessageSendEvent_SendShutdown : MessageSendEvent {
545                 /**
546                  * The node_id of the node which should receive this message
547                  */
548                 public byte[] node_id;
549                 /**
550                  * The message which should be sent.
551                  */
552                 public Shutdown msg;
553                 internal MessageSendEvent_SendShutdown(long ptr) : base(null, ptr) {
554                         long node_id = bindings.LDKMessageSendEvent_SendShutdown_get_node_id(ptr);
555                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
556                         this.node_id = node_id_conv;
557                         long msg = bindings.LDKMessageSendEvent_SendShutdown_get_msg(ptr);
558                         org.ldk.structs.Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Shutdown(null, msg); }
559                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
560                         this.msg = msg_hu_conv;
561                 }
562         }
563         /** A MessageSendEvent of type SendChannelReestablish */
564         public class MessageSendEvent_SendChannelReestablish : MessageSendEvent {
565                 /**
566                  * The node_id of the node which should receive this message
567                  */
568                 public byte[] node_id;
569                 /**
570                  * The message which should be sent.
571                  */
572                 public ChannelReestablish msg;
573                 internal MessageSendEvent_SendChannelReestablish(long ptr) : base(null, ptr) {
574                         long node_id = bindings.LDKMessageSendEvent_SendChannelReestablish_get_node_id(ptr);
575                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
576                         this.node_id = node_id_conv;
577                         long msg = bindings.LDKMessageSendEvent_SendChannelReestablish_get_msg(ptr);
578                         org.ldk.structs.ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReestablish(null, msg); }
579                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
580                         this.msg = msg_hu_conv;
581                 }
582         }
583         /** A MessageSendEvent of type SendChannelAnnouncement */
584         public class MessageSendEvent_SendChannelAnnouncement : MessageSendEvent {
585                 /**
586                  * The node_id of the node which should receive this message
587                  */
588                 public byte[] node_id;
589                 /**
590                  * The channel_announcement which should be sent.
591                  */
592                 public ChannelAnnouncement msg;
593                 /**
594                  * The followup channel_update which should be sent.
595                  */
596                 public ChannelUpdate update_msg;
597                 internal MessageSendEvent_SendChannelAnnouncement(long ptr) : base(null, ptr) {
598                         long node_id = bindings.LDKMessageSendEvent_SendChannelAnnouncement_get_node_id(ptr);
599                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
600                         this.node_id = node_id_conv;
601                         long msg = bindings.LDKMessageSendEvent_SendChannelAnnouncement_get_msg(ptr);
602                         org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); }
603                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
604                         this.msg = msg_hu_conv;
605                         long update_msg = bindings.LDKMessageSendEvent_SendChannelAnnouncement_get_update_msg(ptr);
606                         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); }
607                         if (update_msg_hu_conv != null) { update_msg_hu_conv.ptrs_to.AddLast(this); };
608                         this.update_msg = update_msg_hu_conv;
609                 }
610         }
611         /** A MessageSendEvent of type BroadcastChannelAnnouncement */
612         public class MessageSendEvent_BroadcastChannelAnnouncement : MessageSendEvent {
613                 /**
614                  * The channel_announcement which should be sent.
615                  */
616                 public ChannelAnnouncement msg;
617                 /**
618                  * The followup channel_update which should be sent.
619                  * 
620                  * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
621                  */
622                 public ChannelUpdate update_msg;
623                 internal MessageSendEvent_BroadcastChannelAnnouncement(long ptr) : base(null, ptr) {
624                         long msg = bindings.LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg(ptr);
625                         org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); }
626                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
627                         this.msg = msg_hu_conv;
628                         long update_msg = bindings.LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg(ptr);
629                         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); }
630                         if (update_msg_hu_conv != null) { update_msg_hu_conv.ptrs_to.AddLast(this); };
631                         this.update_msg = update_msg_hu_conv;
632                 }
633         }
634         /** A MessageSendEvent of type BroadcastChannelUpdate */
635         public class MessageSendEvent_BroadcastChannelUpdate : MessageSendEvent {
636                 /**
637                  * The channel_update which should be sent.
638                  */
639                 public ChannelUpdate msg;
640                 internal MessageSendEvent_BroadcastChannelUpdate(long ptr) : base(null, ptr) {
641                         long msg = bindings.LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(ptr);
642                         org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); }
643                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
644                         this.msg = msg_hu_conv;
645                 }
646         }
647         /** A MessageSendEvent of type BroadcastNodeAnnouncement */
648         public class MessageSendEvent_BroadcastNodeAnnouncement : MessageSendEvent {
649                 /**
650                  * The node_announcement which should be sent.
651                  */
652                 public NodeAnnouncement msg;
653                 internal MessageSendEvent_BroadcastNodeAnnouncement(long ptr) : base(null, ptr) {
654                         long msg = bindings.LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg(ptr);
655                         org.ldk.structs.NodeAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.NodeAnnouncement(null, msg); }
656                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
657                         this.msg = msg_hu_conv;
658                 }
659         }
660         /** A MessageSendEvent of type SendChannelUpdate */
661         public class MessageSendEvent_SendChannelUpdate : MessageSendEvent {
662                 /**
663                  * The node_id of the node which should receive this message
664                  */
665                 public byte[] node_id;
666                 /**
667                  * The channel_update which should be sent.
668                  */
669                 public ChannelUpdate msg;
670                 internal MessageSendEvent_SendChannelUpdate(long ptr) : base(null, ptr) {
671                         long node_id = bindings.LDKMessageSendEvent_SendChannelUpdate_get_node_id(ptr);
672                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
673                         this.node_id = node_id_conv;
674                         long msg = bindings.LDKMessageSendEvent_SendChannelUpdate_get_msg(ptr);
675                         org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); }
676                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
677                         this.msg = msg_hu_conv;
678                 }
679         }
680         /** A MessageSendEvent of type HandleError */
681         public class MessageSendEvent_HandleError : MessageSendEvent {
682                 /**
683                  * The node_id of the node which should receive this message
684                  */
685                 public byte[] node_id;
686                 /**
687                  * The action which should be taken.
688                  */
689                 public ErrorAction action;
690                 internal MessageSendEvent_HandleError(long ptr) : base(null, ptr) {
691                         long node_id = bindings.LDKMessageSendEvent_HandleError_get_node_id(ptr);
692                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
693                         this.node_id = node_id_conv;
694                         long action = bindings.LDKMessageSendEvent_HandleError_get_action(ptr);
695                         org.ldk.structs.ErrorAction action_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(action);
696                         if (action_hu_conv != null) { action_hu_conv.ptrs_to.AddLast(this); };
697                         this.action = action_hu_conv;
698                 }
699         }
700         /** A MessageSendEvent of type SendChannelRangeQuery */
701         public class MessageSendEvent_SendChannelRangeQuery : MessageSendEvent {
702                 /**
703                  * The node_id of this message recipient
704                  */
705                 public byte[] node_id;
706                 /**
707                  * The query_channel_range which should be sent.
708                  */
709                 public QueryChannelRange msg;
710                 internal MessageSendEvent_SendChannelRangeQuery(long ptr) : base(null, ptr) {
711                         long node_id = bindings.LDKMessageSendEvent_SendChannelRangeQuery_get_node_id(ptr);
712                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
713                         this.node_id = node_id_conv;
714                         long msg = bindings.LDKMessageSendEvent_SendChannelRangeQuery_get_msg(ptr);
715                         org.ldk.structs.QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryChannelRange(null, msg); }
716                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
717                         this.msg = msg_hu_conv;
718                 }
719         }
720         /** A MessageSendEvent of type SendShortIdsQuery */
721         public class MessageSendEvent_SendShortIdsQuery : MessageSendEvent {
722                 /**
723                  * The node_id of this message recipient
724                  */
725                 public byte[] node_id;
726                 /**
727                  * The query_short_channel_ids which should be sent.
728                  */
729                 public QueryShortChannelIds msg;
730                 internal MessageSendEvent_SendShortIdsQuery(long ptr) : base(null, ptr) {
731                         long node_id = bindings.LDKMessageSendEvent_SendShortIdsQuery_get_node_id(ptr);
732                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
733                         this.node_id = node_id_conv;
734                         long msg = bindings.LDKMessageSendEvent_SendShortIdsQuery_get_msg(ptr);
735                         org.ldk.structs.QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, msg); }
736                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
737                         this.msg = msg_hu_conv;
738                 }
739         }
740         /** A MessageSendEvent of type SendReplyChannelRange */
741         public class MessageSendEvent_SendReplyChannelRange : MessageSendEvent {
742                 /**
743                  * The node_id of this message recipient
744                  */
745                 public byte[] node_id;
746                 /**
747                  * The reply_channel_range which should be sent.
748                  */
749                 public ReplyChannelRange msg;
750                 internal MessageSendEvent_SendReplyChannelRange(long ptr) : base(null, ptr) {
751                         long node_id = bindings.LDKMessageSendEvent_SendReplyChannelRange_get_node_id(ptr);
752                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
753                         this.node_id = node_id_conv;
754                         long msg = bindings.LDKMessageSendEvent_SendReplyChannelRange_get_msg(ptr);
755                         org.ldk.structs.ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ReplyChannelRange(null, msg); }
756                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
757                         this.msg = msg_hu_conv;
758                 }
759         }
760         /** A MessageSendEvent of type SendGossipTimestampFilter */
761         public class MessageSendEvent_SendGossipTimestampFilter : MessageSendEvent {
762                 /**
763                  * The node_id of this message recipient
764                  */
765                 public byte[] node_id;
766                 /**
767                  * The gossip_timestamp_filter which should be sent.
768                  */
769                 public GossipTimestampFilter msg;
770                 internal MessageSendEvent_SendGossipTimestampFilter(long ptr) : base(null, ptr) {
771                         long node_id = bindings.LDKMessageSendEvent_SendGossipTimestampFilter_get_node_id(ptr);
772                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
773                         this.node_id = node_id_conv;
774                         long msg = bindings.LDKMessageSendEvent_SendGossipTimestampFilter_get_msg(ptr);
775                         org.ldk.structs.GossipTimestampFilter msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.GossipTimestampFilter(null, msg); }
776                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
777                         this.msg = msg_hu_conv;
778                 }
779         }
780         internal long clone_ptr() {
781                 long ret = bindings.MessageSendEvent_clone_ptr(this.ptr);
782                 GC.KeepAlive(this);
783                 return ret;
784         }
785
786         /**
787          * Creates a copy of the MessageSendEvent
788          */
789         public MessageSendEvent clone() {
790                 long ret = bindings.MessageSendEvent_clone(this.ptr);
791                 GC.KeepAlive(this);
792                 if (ret >= 0 && ret <= 4096) { return null; }
793                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
794                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
795                 return ret_hu_conv;
796         }
797
798         /**
799          * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
800          */
801         public static MessageSendEvent send_accept_channel(byte[] node_id, org.ldk.structs.AcceptChannel msg) {
802                 long ret = bindings.MessageSendEvent_send_accept_channel(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
803                 GC.KeepAlive(node_id);
804                 GC.KeepAlive(msg);
805                 if (ret >= 0 && ret <= 4096) { return null; }
806                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
807                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
808                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
809                 return ret_hu_conv;
810         }
811
812         /**
813          * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
814          */
815         public static MessageSendEvent send_accept_channel_v2(byte[] node_id, org.ldk.structs.AcceptChannelV2 msg) {
816                 long ret = bindings.MessageSendEvent_send_accept_channel_v2(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
817                 GC.KeepAlive(node_id);
818                 GC.KeepAlive(msg);
819                 if (ret >= 0 && ret <= 4096) { return null; }
820                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
821                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
822                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
823                 return ret_hu_conv;
824         }
825
826         /**
827          * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
828          */
829         public static MessageSendEvent send_open_channel(byte[] node_id, org.ldk.structs.OpenChannel msg) {
830                 long ret = bindings.MessageSendEvent_send_open_channel(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
831                 GC.KeepAlive(node_id);
832                 GC.KeepAlive(msg);
833                 if (ret >= 0 && ret <= 4096) { return null; }
834                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
835                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
836                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
837                 return ret_hu_conv;
838         }
839
840         /**
841          * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
842          */
843         public static MessageSendEvent send_open_channel_v2(byte[] node_id, org.ldk.structs.OpenChannelV2 msg) {
844                 long ret = bindings.MessageSendEvent_send_open_channel_v2(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
845                 GC.KeepAlive(node_id);
846                 GC.KeepAlive(msg);
847                 if (ret >= 0 && ret <= 4096) { return null; }
848                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
849                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
850                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
851                 return ret_hu_conv;
852         }
853
854         /**
855          * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
856          */
857         public static MessageSendEvent send_funding_created(byte[] node_id, org.ldk.structs.FundingCreated msg) {
858                 long ret = bindings.MessageSendEvent_send_funding_created(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
859                 GC.KeepAlive(node_id);
860                 GC.KeepAlive(msg);
861                 if (ret >= 0 && ret <= 4096) { return null; }
862                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
863                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
864                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
865                 return ret_hu_conv;
866         }
867
868         /**
869          * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
870          */
871         public static MessageSendEvent send_funding_signed(byte[] node_id, org.ldk.structs.FundingSigned msg) {
872                 long ret = bindings.MessageSendEvent_send_funding_signed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
873                 GC.KeepAlive(node_id);
874                 GC.KeepAlive(msg);
875                 if (ret >= 0 && ret <= 4096) { return null; }
876                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
877                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
878                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
879                 return ret_hu_conv;
880         }
881
882         /**
883          * Utility method to constructs a new SendStfu-variant MessageSendEvent
884          */
885         public static MessageSendEvent send_stfu(byte[] node_id, org.ldk.structs.Stfu msg) {
886                 long ret = bindings.MessageSendEvent_send_stfu(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
887                 GC.KeepAlive(node_id);
888                 GC.KeepAlive(msg);
889                 if (ret >= 0 && ret <= 4096) { return null; }
890                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
891                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
892                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
893                 return ret_hu_conv;
894         }
895
896         /**
897          * Utility method to constructs a new SendSplice-variant MessageSendEvent
898          */
899         public static MessageSendEvent send_splice(byte[] node_id, org.ldk.structs.Splice msg) {
900                 long ret = bindings.MessageSendEvent_send_splice(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
901                 GC.KeepAlive(node_id);
902                 GC.KeepAlive(msg);
903                 if (ret >= 0 && ret <= 4096) { return null; }
904                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
905                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
906                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
907                 return ret_hu_conv;
908         }
909
910         /**
911          * Utility method to constructs a new SendSpliceAck-variant MessageSendEvent
912          */
913         public static MessageSendEvent send_splice_ack(byte[] node_id, org.ldk.structs.SpliceAck msg) {
914                 long ret = bindings.MessageSendEvent_send_splice_ack(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
915                 GC.KeepAlive(node_id);
916                 GC.KeepAlive(msg);
917                 if (ret >= 0 && ret <= 4096) { return null; }
918                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
919                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
920                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
921                 return ret_hu_conv;
922         }
923
924         /**
925          * Utility method to constructs a new SendSpliceLocked-variant MessageSendEvent
926          */
927         public static MessageSendEvent send_splice_locked(byte[] node_id, org.ldk.structs.SpliceLocked msg) {
928                 long ret = bindings.MessageSendEvent_send_splice_locked(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
929                 GC.KeepAlive(node_id);
930                 GC.KeepAlive(msg);
931                 if (ret >= 0 && ret <= 4096) { return null; }
932                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
933                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
934                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
935                 return ret_hu_conv;
936         }
937
938         /**
939          * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
940          */
941         public static MessageSendEvent send_tx_add_input(byte[] node_id, org.ldk.structs.TxAddInput msg) {
942                 long ret = bindings.MessageSendEvent_send_tx_add_input(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
943                 GC.KeepAlive(node_id);
944                 GC.KeepAlive(msg);
945                 if (ret >= 0 && ret <= 4096) { return null; }
946                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
947                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
948                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
949                 return ret_hu_conv;
950         }
951
952         /**
953          * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
954          */
955         public static MessageSendEvent send_tx_add_output(byte[] node_id, org.ldk.structs.TxAddOutput msg) {
956                 long ret = bindings.MessageSendEvent_send_tx_add_output(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
957                 GC.KeepAlive(node_id);
958                 GC.KeepAlive(msg);
959                 if (ret >= 0 && ret <= 4096) { return null; }
960                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
961                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
962                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
963                 return ret_hu_conv;
964         }
965
966         /**
967          * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
968          */
969         public static MessageSendEvent send_tx_remove_input(byte[] node_id, org.ldk.structs.TxRemoveInput msg) {
970                 long ret = bindings.MessageSendEvent_send_tx_remove_input(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
971                 GC.KeepAlive(node_id);
972                 GC.KeepAlive(msg);
973                 if (ret >= 0 && ret <= 4096) { return null; }
974                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
975                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
976                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
977                 return ret_hu_conv;
978         }
979
980         /**
981          * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
982          */
983         public static MessageSendEvent send_tx_remove_output(byte[] node_id, org.ldk.structs.TxRemoveOutput msg) {
984                 long ret = bindings.MessageSendEvent_send_tx_remove_output(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
985                 GC.KeepAlive(node_id);
986                 GC.KeepAlive(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                 return ret_hu_conv;
992         }
993
994         /**
995          * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
996          */
997         public static MessageSendEvent send_tx_complete(byte[] node_id, org.ldk.structs.TxComplete msg) {
998                 long ret = bindings.MessageSendEvent_send_tx_complete(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
999                 GC.KeepAlive(node_id);
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 SendTxSignatures-variant MessageSendEvent
1010          */
1011         public static MessageSendEvent send_tx_signatures(byte[] node_id, org.ldk.structs.TxSignatures msg) {
1012                 long ret = bindings.MessageSendEvent_send_tx_signatures(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1013                 GC.KeepAlive(node_id);
1014                 GC.KeepAlive(msg);
1015                 if (ret >= 0 && ret <= 4096) { return null; }
1016                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1017                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1018                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1019                 return ret_hu_conv;
1020         }
1021
1022         /**
1023          * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
1024          */
1025         public static MessageSendEvent send_tx_init_rbf(byte[] node_id, org.ldk.structs.TxInitRbf msg) {
1026                 long ret = bindings.MessageSendEvent_send_tx_init_rbf(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1027                 GC.KeepAlive(node_id);
1028                 GC.KeepAlive(msg);
1029                 if (ret >= 0 && ret <= 4096) { return null; }
1030                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1031                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1032                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1033                 return ret_hu_conv;
1034         }
1035
1036         /**
1037          * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
1038          */
1039         public static MessageSendEvent send_tx_ack_rbf(byte[] node_id, org.ldk.structs.TxAckRbf msg) {
1040                 long ret = bindings.MessageSendEvent_send_tx_ack_rbf(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1041                 GC.KeepAlive(node_id);
1042                 GC.KeepAlive(msg);
1043                 if (ret >= 0 && ret <= 4096) { return null; }
1044                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1045                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1046                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1047                 return ret_hu_conv;
1048         }
1049
1050         /**
1051          * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
1052          */
1053         public static MessageSendEvent send_tx_abort(byte[] node_id, org.ldk.structs.TxAbort msg) {
1054                 long ret = bindings.MessageSendEvent_send_tx_abort(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1055                 GC.KeepAlive(node_id);
1056                 GC.KeepAlive(msg);
1057                 if (ret >= 0 && ret <= 4096) { return null; }
1058                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1059                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1060                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1061                 return ret_hu_conv;
1062         }
1063
1064         /**
1065          * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
1066          */
1067         public static MessageSendEvent send_channel_ready(byte[] node_id, org.ldk.structs.ChannelReady msg) {
1068                 long ret = bindings.MessageSendEvent_send_channel_ready(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1069                 GC.KeepAlive(node_id);
1070                 GC.KeepAlive(msg);
1071                 if (ret >= 0 && ret <= 4096) { return null; }
1072                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1073                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1074                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1075                 return ret_hu_conv;
1076         }
1077
1078         /**
1079          * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
1080          */
1081         public static MessageSendEvent send_announcement_signatures(byte[] node_id, org.ldk.structs.AnnouncementSignatures msg) {
1082                 long ret = bindings.MessageSendEvent_send_announcement_signatures(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1083                 GC.KeepAlive(node_id);
1084                 GC.KeepAlive(msg);
1085                 if (ret >= 0 && ret <= 4096) { return null; }
1086                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1087                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1088                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1089                 return ret_hu_conv;
1090         }
1091
1092         /**
1093          * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
1094          */
1095         public static MessageSendEvent update_htlcs(byte[] node_id, org.ldk.structs.CommitmentUpdate updates) {
1096                 long ret = bindings.MessageSendEvent_update_htlcs(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), updates == null ? 0 : updates.ptr);
1097                 GC.KeepAlive(node_id);
1098                 GC.KeepAlive(updates);
1099                 if (ret >= 0 && ret <= 4096) { return null; }
1100                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1101                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1102                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(updates); };
1103                 return ret_hu_conv;
1104         }
1105
1106         /**
1107          * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
1108          */
1109         public static MessageSendEvent send_revoke_and_ack(byte[] node_id, org.ldk.structs.RevokeAndACK msg) {
1110                 long ret = bindings.MessageSendEvent_send_revoke_and_ack(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1111                 GC.KeepAlive(node_id);
1112                 GC.KeepAlive(msg);
1113                 if (ret >= 0 && ret <= 4096) { return null; }
1114                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1115                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1116                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1117                 return ret_hu_conv;
1118         }
1119
1120         /**
1121          * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
1122          */
1123         public static MessageSendEvent send_closing_signed(byte[] node_id, org.ldk.structs.ClosingSigned msg) {
1124                 long ret = bindings.MessageSendEvent_send_closing_signed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1125                 GC.KeepAlive(node_id);
1126                 GC.KeepAlive(msg);
1127                 if (ret >= 0 && ret <= 4096) { return null; }
1128                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1129                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1130                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1131                 return ret_hu_conv;
1132         }
1133
1134         /**
1135          * Utility method to constructs a new SendShutdown-variant MessageSendEvent
1136          */
1137         public static MessageSendEvent send_shutdown(byte[] node_id, org.ldk.structs.Shutdown msg) {
1138                 long ret = bindings.MessageSendEvent_send_shutdown(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1139                 GC.KeepAlive(node_id);
1140                 GC.KeepAlive(msg);
1141                 if (ret >= 0 && ret <= 4096) { return null; }
1142                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1143                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1144                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1145                 return ret_hu_conv;
1146         }
1147
1148         /**
1149          * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
1150          */
1151         public static MessageSendEvent send_channel_reestablish(byte[] node_id, org.ldk.structs.ChannelReestablish msg) {
1152                 long ret = bindings.MessageSendEvent_send_channel_reestablish(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1153                 GC.KeepAlive(node_id);
1154                 GC.KeepAlive(msg);
1155                 if (ret >= 0 && ret <= 4096) { return null; }
1156                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1157                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1158                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1159                 return ret_hu_conv;
1160         }
1161
1162         /**
1163          * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
1164          */
1165         public static MessageSendEvent send_channel_announcement(byte[] node_id, org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) {
1166                 long ret = bindings.MessageSendEvent_send_channel_announcement(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr, update_msg == null ? 0 : update_msg.ptr);
1167                 GC.KeepAlive(node_id);
1168                 GC.KeepAlive(msg);
1169                 GC.KeepAlive(update_msg);
1170                 if (ret >= 0 && ret <= 4096) { return null; }
1171                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1172                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1173                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1174                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_msg); };
1175                 return ret_hu_conv;
1176         }
1177
1178         /**
1179          * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
1180          */
1181         public static MessageSendEvent broadcast_channel_announcement(org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) {
1182                 long ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : msg.ptr, update_msg == null ? 0 : update_msg.ptr);
1183                 GC.KeepAlive(msg);
1184                 GC.KeepAlive(update_msg);
1185                 if (ret >= 0 && ret <= 4096) { return null; }
1186                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1187                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1188                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1189                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_msg); };
1190                 return ret_hu_conv;
1191         }
1192
1193         /**
1194          * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
1195          */
1196         public static MessageSendEvent broadcast_channel_update(org.ldk.structs.ChannelUpdate msg) {
1197                 long ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr);
1198                 GC.KeepAlive(msg);
1199                 if (ret >= 0 && ret <= 4096) { return null; }
1200                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1201                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1202                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1203                 return ret_hu_conv;
1204         }
1205
1206         /**
1207          * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
1208          */
1209         public static MessageSendEvent broadcast_node_announcement(org.ldk.structs.NodeAnnouncement msg) {
1210                 long ret = bindings.MessageSendEvent_broadcast_node_announcement(msg == null ? 0 : msg.ptr);
1211                 GC.KeepAlive(msg);
1212                 if (ret >= 0 && ret <= 4096) { return null; }
1213                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1214                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1215                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1216                 return ret_hu_conv;
1217         }
1218
1219         /**
1220          * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
1221          */
1222         public static MessageSendEvent send_channel_update(byte[] node_id, org.ldk.structs.ChannelUpdate msg) {
1223                 long ret = bindings.MessageSendEvent_send_channel_update(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1224                 GC.KeepAlive(node_id);
1225                 GC.KeepAlive(msg);
1226                 if (ret >= 0 && ret <= 4096) { return null; }
1227                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1228                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1229                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1230                 return ret_hu_conv;
1231         }
1232
1233         /**
1234          * Utility method to constructs a new HandleError-variant MessageSendEvent
1235          */
1236         public static MessageSendEvent handle_error(byte[] node_id, org.ldk.structs.ErrorAction action) {
1237                 long ret = bindings.MessageSendEvent_handle_error(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), action.ptr);
1238                 GC.KeepAlive(node_id);
1239                 GC.KeepAlive(action);
1240                 if (ret >= 0 && ret <= 4096) { return null; }
1241                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1242                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1243                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(action); };
1244                 return ret_hu_conv;
1245         }
1246
1247         /**
1248          * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
1249          */
1250         public static MessageSendEvent send_channel_range_query(byte[] node_id, org.ldk.structs.QueryChannelRange msg) {
1251                 long ret = bindings.MessageSendEvent_send_channel_range_query(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1252                 GC.KeepAlive(node_id);
1253                 GC.KeepAlive(msg);
1254                 if (ret >= 0 && ret <= 4096) { return null; }
1255                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1256                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1257                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1258                 return ret_hu_conv;
1259         }
1260
1261         /**
1262          * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
1263          */
1264         public static MessageSendEvent send_short_ids_query(byte[] node_id, org.ldk.structs.QueryShortChannelIds msg) {
1265                 long ret = bindings.MessageSendEvent_send_short_ids_query(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1266                 GC.KeepAlive(node_id);
1267                 GC.KeepAlive(msg);
1268                 if (ret >= 0 && ret <= 4096) { return null; }
1269                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1270                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1271                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1272                 return ret_hu_conv;
1273         }
1274
1275         /**
1276          * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
1277          */
1278         public static MessageSendEvent send_reply_channel_range(byte[] node_id, org.ldk.structs.ReplyChannelRange msg) {
1279                 long ret = bindings.MessageSendEvent_send_reply_channel_range(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1280                 GC.KeepAlive(node_id);
1281                 GC.KeepAlive(msg);
1282                 if (ret >= 0 && ret <= 4096) { return null; }
1283                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1284                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1285                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1286                 return ret_hu_conv;
1287         }
1288
1289         /**
1290          * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
1291          */
1292         public static MessageSendEvent send_gossip_timestamp_filter(byte[] node_id, org.ldk.structs.GossipTimestampFilter msg) {
1293                 long ret = bindings.MessageSendEvent_send_gossip_timestamp_filter(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1294                 GC.KeepAlive(node_id);
1295                 GC.KeepAlive(msg);
1296                 if (ret >= 0 && ret <= 4096) { return null; }
1297                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1298                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1299                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1300                 return ret_hu_conv;
1301         }
1302
1303 }
1304 } } }