[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_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                         long node_id = bindings.LDKMessageSendEvent_SendAcceptChannel_get_node_id(ptr);
71                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
72                         this.node_id = node_id_conv;
73                         long msg = bindings.LDKMessageSendEvent_SendAcceptChannel_get_msg(ptr);
74                         org.ldk.structs.AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannel(null, msg); }
75                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
76                         this.msg = msg_hu_conv;
77                 }
78         }
79         /** A MessageSendEvent of type SendAcceptChannelV2 */
80         public class MessageSendEvent_SendAcceptChannelV2 : MessageSendEvent {
81                 /**
82                  * The node_id of the node which should receive this message
83                  */
84                 public byte[] node_id;
85                 /**
86                  * The message which should be sent.
87                  */
88                 public AcceptChannelV2 msg;
89                 internal MessageSendEvent_SendAcceptChannelV2(long ptr) : base(null, ptr) {
90                         long node_id = bindings.LDKMessageSendEvent_SendAcceptChannelV2_get_node_id(ptr);
91                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
92                         this.node_id = node_id_conv;
93                         long msg = bindings.LDKMessageSendEvent_SendAcceptChannelV2_get_msg(ptr);
94                         org.ldk.structs.AcceptChannelV2 msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannelV2(null, msg); }
95                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
96                         this.msg = msg_hu_conv;
97                 }
98         }
99         /** A MessageSendEvent of type SendOpenChannel */
100         public class MessageSendEvent_SendOpenChannel : MessageSendEvent {
101                 /**
102                  * The node_id of the node which should receive this message
103                  */
104                 public byte[] node_id;
105                 /**
106                  * The message which should be sent.
107                  */
108                 public OpenChannel msg;
109                 internal MessageSendEvent_SendOpenChannel(long ptr) : base(null, ptr) {
110                         long node_id = bindings.LDKMessageSendEvent_SendOpenChannel_get_node_id(ptr);
111                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
112                         this.node_id = node_id_conv;
113                         long msg = bindings.LDKMessageSendEvent_SendOpenChannel_get_msg(ptr);
114                         org.ldk.structs.OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannel(null, msg); }
115                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
116                         this.msg = msg_hu_conv;
117                 }
118         }
119         /** A MessageSendEvent of type SendOpenChannelV2 */
120         public class MessageSendEvent_SendOpenChannelV2 : MessageSendEvent {
121                 /**
122                  * The node_id of the node which should receive this message
123                  */
124                 public byte[] node_id;
125                 /**
126                  * The message which should be sent.
127                  */
128                 public OpenChannelV2 msg;
129                 internal MessageSendEvent_SendOpenChannelV2(long ptr) : base(null, ptr) {
130                         long node_id = bindings.LDKMessageSendEvent_SendOpenChannelV2_get_node_id(ptr);
131                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
132                         this.node_id = node_id_conv;
133                         long msg = bindings.LDKMessageSendEvent_SendOpenChannelV2_get_msg(ptr);
134                         org.ldk.structs.OpenChannelV2 msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannelV2(null, msg); }
135                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
136                         this.msg = msg_hu_conv;
137                 }
138         }
139         /** A MessageSendEvent of type SendFundingCreated */
140         public class MessageSendEvent_SendFundingCreated : MessageSendEvent {
141                 /**
142                  * The node_id of the node which should receive this message
143                  */
144                 public byte[] node_id;
145                 /**
146                  * The message which should be sent.
147                  */
148                 public FundingCreated msg;
149                 internal MessageSendEvent_SendFundingCreated(long ptr) : base(null, ptr) {
150                         long node_id = bindings.LDKMessageSendEvent_SendFundingCreated_get_node_id(ptr);
151                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
152                         this.node_id = node_id_conv;
153                         long msg = bindings.LDKMessageSendEvent_SendFundingCreated_get_msg(ptr);
154                         org.ldk.structs.FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingCreated(null, msg); }
155                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
156                         this.msg = msg_hu_conv;
157                 }
158         }
159         /** A MessageSendEvent of type SendFundingSigned */
160         public class MessageSendEvent_SendFundingSigned : MessageSendEvent {
161                 /**
162                  * The node_id of the node which should receive this message
163                  */
164                 public byte[] node_id;
165                 /**
166                  * The message which should be sent.
167                  */
168                 public FundingSigned msg;
169                 internal MessageSendEvent_SendFundingSigned(long ptr) : base(null, ptr) {
170                         long node_id = bindings.LDKMessageSendEvent_SendFundingSigned_get_node_id(ptr);
171                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
172                         this.node_id = node_id_conv;
173                         long msg = bindings.LDKMessageSendEvent_SendFundingSigned_get_msg(ptr);
174                         org.ldk.structs.FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingSigned(null, msg); }
175                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
176                         this.msg = msg_hu_conv;
177                 }
178         }
179         /** A MessageSendEvent of type SendTxAddInput */
180         public class MessageSendEvent_SendTxAddInput : MessageSendEvent {
181                 /**
182                  * The node_id of the node which should receive this message
183                  */
184                 public byte[] node_id;
185                 /**
186                  * The message which should be sent.
187                  */
188                 public TxAddInput msg;
189                 internal MessageSendEvent_SendTxAddInput(long ptr) : base(null, ptr) {
190                         long node_id = bindings.LDKMessageSendEvent_SendTxAddInput_get_node_id(ptr);
191                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
192                         this.node_id = node_id_conv;
193                         long msg = bindings.LDKMessageSendEvent_SendTxAddInput_get_msg(ptr);
194                         org.ldk.structs.TxAddInput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAddInput(null, msg); }
195                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
196                         this.msg = msg_hu_conv;
197                 }
198         }
199         /** A MessageSendEvent of type SendTxAddOutput */
200         public class MessageSendEvent_SendTxAddOutput : MessageSendEvent {
201                 /**
202                  * The node_id of the node which should receive this message
203                  */
204                 public byte[] node_id;
205                 /**
206                  * The message which should be sent.
207                  */
208                 public TxAddOutput msg;
209                 internal MessageSendEvent_SendTxAddOutput(long ptr) : base(null, ptr) {
210                         long node_id = bindings.LDKMessageSendEvent_SendTxAddOutput_get_node_id(ptr);
211                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
212                         this.node_id = node_id_conv;
213                         long msg = bindings.LDKMessageSendEvent_SendTxAddOutput_get_msg(ptr);
214                         org.ldk.structs.TxAddOutput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAddOutput(null, msg); }
215                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
216                         this.msg = msg_hu_conv;
217                 }
218         }
219         /** A MessageSendEvent of type SendTxRemoveInput */
220         public class MessageSendEvent_SendTxRemoveInput : MessageSendEvent {
221                 /**
222                  * The node_id of the node which should receive this message
223                  */
224                 public byte[] node_id;
225                 /**
226                  * The message which should be sent.
227                  */
228                 public TxRemoveInput msg;
229                 internal MessageSendEvent_SendTxRemoveInput(long ptr) : base(null, ptr) {
230                         long node_id = bindings.LDKMessageSendEvent_SendTxRemoveInput_get_node_id(ptr);
231                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
232                         this.node_id = node_id_conv;
233                         long msg = bindings.LDKMessageSendEvent_SendTxRemoveInput_get_msg(ptr);
234                         org.ldk.structs.TxRemoveInput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxRemoveInput(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 SendTxRemoveOutput */
240         public class MessageSendEvent_SendTxRemoveOutput : 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 TxRemoveOutput msg;
249                 internal MessageSendEvent_SendTxRemoveOutput(long ptr) : base(null, ptr) {
250                         long node_id = bindings.LDKMessageSendEvent_SendTxRemoveOutput_get_node_id(ptr);
251                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
252                         this.node_id = node_id_conv;
253                         long msg = bindings.LDKMessageSendEvent_SendTxRemoveOutput_get_msg(ptr);
254                         org.ldk.structs.TxRemoveOutput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxRemoveOutput(null, msg); }
255                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
256                         this.msg = msg_hu_conv;
257                 }
258         }
259         /** A MessageSendEvent of type SendTxComplete */
260         public class MessageSendEvent_SendTxComplete : MessageSendEvent {
261                 /**
262                  * The node_id of the node which should receive this message
263                  */
264                 public byte[] node_id;
265                 /**
266                  * The message which should be sent.
267                  */
268                 public TxComplete msg;
269                 internal MessageSendEvent_SendTxComplete(long ptr) : base(null, ptr) {
270                         long node_id = bindings.LDKMessageSendEvent_SendTxComplete_get_node_id(ptr);
271                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
272                         this.node_id = node_id_conv;
273                         long msg = bindings.LDKMessageSendEvent_SendTxComplete_get_msg(ptr);
274                         org.ldk.structs.TxComplete msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxComplete(null, msg); }
275                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
276                         this.msg = msg_hu_conv;
277                 }
278         }
279         /** A MessageSendEvent of type SendTxSignatures */
280         public class MessageSendEvent_SendTxSignatures : MessageSendEvent {
281                 /**
282                  * The node_id of the node which should receive this message
283                  */
284                 public byte[] node_id;
285                 /**
286                  * The message which should be sent.
287                  */
288                 public TxSignatures msg;
289                 internal MessageSendEvent_SendTxSignatures(long ptr) : base(null, ptr) {
290                         long node_id = bindings.LDKMessageSendEvent_SendTxSignatures_get_node_id(ptr);
291                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
292                         this.node_id = node_id_conv;
293                         long msg = bindings.LDKMessageSendEvent_SendTxSignatures_get_msg(ptr);
294                         org.ldk.structs.TxSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxSignatures(null, msg); }
295                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
296                         this.msg = msg_hu_conv;
297                 }
298         }
299         /** A MessageSendEvent of type SendTxInitRbf */
300         public class MessageSendEvent_SendTxInitRbf : MessageSendEvent {
301                 /**
302                  * The node_id of the node which should receive this message
303                  */
304                 public byte[] node_id;
305                 /**
306                  * The message which should be sent.
307                  */
308                 public TxInitRbf msg;
309                 internal MessageSendEvent_SendTxInitRbf(long ptr) : base(null, ptr) {
310                         long node_id = bindings.LDKMessageSendEvent_SendTxInitRbf_get_node_id(ptr);
311                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
312                         this.node_id = node_id_conv;
313                         long msg = bindings.LDKMessageSendEvent_SendTxInitRbf_get_msg(ptr);
314                         org.ldk.structs.TxInitRbf msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxInitRbf(null, msg); }
315                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
316                         this.msg = msg_hu_conv;
317                 }
318         }
319         /** A MessageSendEvent of type SendTxAckRbf */
320         public class MessageSendEvent_SendTxAckRbf : MessageSendEvent {
321                 /**
322                  * The node_id of the node which should receive this message
323                  */
324                 public byte[] node_id;
325                 /**
326                  * The message which should be sent.
327                  */
328                 public TxAckRbf msg;
329                 internal MessageSendEvent_SendTxAckRbf(long ptr) : base(null, ptr) {
330                         long node_id = bindings.LDKMessageSendEvent_SendTxAckRbf_get_node_id(ptr);
331                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
332                         this.node_id = node_id_conv;
333                         long msg = bindings.LDKMessageSendEvent_SendTxAckRbf_get_msg(ptr);
334                         org.ldk.structs.TxAckRbf msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAckRbf(null, msg); }
335                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
336                         this.msg = msg_hu_conv;
337                 }
338         }
339         /** A MessageSendEvent of type SendTxAbort */
340         public class MessageSendEvent_SendTxAbort : MessageSendEvent {
341                 /**
342                  * The node_id of the node which should receive this message
343                  */
344                 public byte[] node_id;
345                 /**
346                  * The message which should be sent.
347                  */
348                 public TxAbort msg;
349                 internal MessageSendEvent_SendTxAbort(long ptr) : base(null, ptr) {
350                         long node_id = bindings.LDKMessageSendEvent_SendTxAbort_get_node_id(ptr);
351                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
352                         this.node_id = node_id_conv;
353                         long msg = bindings.LDKMessageSendEvent_SendTxAbort_get_msg(ptr);
354                         org.ldk.structs.TxAbort msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAbort(null, msg); }
355                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
356                         this.msg = msg_hu_conv;
357                 }
358         }
359         /** A MessageSendEvent of type SendChannelReady */
360         public class MessageSendEvent_SendChannelReady : MessageSendEvent {
361                 /**
362                  * The node_id of the node which should receive these message(s)
363                  */
364                 public byte[] node_id;
365                 /**
366                  * The channel_ready message which should be sent.
367                  */
368                 public ChannelReady msg;
369                 internal MessageSendEvent_SendChannelReady(long ptr) : base(null, ptr) {
370                         long node_id = bindings.LDKMessageSendEvent_SendChannelReady_get_node_id(ptr);
371                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
372                         this.node_id = node_id_conv;
373                         long msg = bindings.LDKMessageSendEvent_SendChannelReady_get_msg(ptr);
374                         org.ldk.structs.ChannelReady msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReady(null, msg); }
375                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
376                         this.msg = msg_hu_conv;
377                 }
378         }
379         /** A MessageSendEvent of type SendAnnouncementSignatures */
380         public class MessageSendEvent_SendAnnouncementSignatures : MessageSendEvent {
381                 /**
382                  * The node_id of the node which should receive these message(s)
383                  */
384                 public byte[] node_id;
385                 /**
386                  * The announcement_signatures message which should be sent.
387                  */
388                 public AnnouncementSignatures msg;
389                 internal MessageSendEvent_SendAnnouncementSignatures(long ptr) : base(null, ptr) {
390                         long node_id = bindings.LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id(ptr);
391                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
392                         this.node_id = node_id_conv;
393                         long msg = bindings.LDKMessageSendEvent_SendAnnouncementSignatures_get_msg(ptr);
394                         org.ldk.structs.AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, msg); }
395                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
396                         this.msg = msg_hu_conv;
397                 }
398         }
399         /** A MessageSendEvent of type UpdateHTLCs */
400         public class MessageSendEvent_UpdateHTLCs : MessageSendEvent {
401                 /**
402                  * The node_id of the node which should receive these message(s)
403                  */
404                 public byte[] node_id;
405                 /**
406                  * The update messages which should be sent. ALL messages in the struct should be sent!
407                  */
408                 public CommitmentUpdate updates;
409                 internal MessageSendEvent_UpdateHTLCs(long ptr) : base(null, ptr) {
410                         long node_id = bindings.LDKMessageSendEvent_UpdateHTLCs_get_node_id(ptr);
411                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
412                         this.node_id = node_id_conv;
413                         long updates = bindings.LDKMessageSendEvent_UpdateHTLCs_get_updates(ptr);
414                         org.ldk.structs.CommitmentUpdate updates_hu_conv = null; if (updates < 0 || updates > 4096) { updates_hu_conv = new org.ldk.structs.CommitmentUpdate(null, updates); }
415                         if (updates_hu_conv != null) { updates_hu_conv.ptrs_to.AddLast(this); };
416                         this.updates = updates_hu_conv;
417                 }
418         }
419         /** A MessageSendEvent of type SendRevokeAndACK */
420         public class MessageSendEvent_SendRevokeAndACK : 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 RevokeAndACK msg;
429                 internal MessageSendEvent_SendRevokeAndACK(long ptr) : base(null, ptr) {
430                         long node_id = bindings.LDKMessageSendEvent_SendRevokeAndACK_get_node_id(ptr);
431                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
432                         this.node_id = node_id_conv;
433                         long msg = bindings.LDKMessageSendEvent_SendRevokeAndACK_get_msg(ptr);
434                         org.ldk.structs.RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.RevokeAndACK(null, msg); }
435                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
436                         this.msg = msg_hu_conv;
437                 }
438         }
439         /** A MessageSendEvent of type SendClosingSigned */
440         public class MessageSendEvent_SendClosingSigned : MessageSendEvent {
441                 /**
442                  * The node_id of the node which should receive this message
443                  */
444                 public byte[] node_id;
445                 /**
446                  * The message which should be sent.
447                  */
448                 public ClosingSigned msg;
449                 internal MessageSendEvent_SendClosingSigned(long ptr) : base(null, ptr) {
450                         long node_id = bindings.LDKMessageSendEvent_SendClosingSigned_get_node_id(ptr);
451                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
452                         this.node_id = node_id_conv;
453                         long msg = bindings.LDKMessageSendEvent_SendClosingSigned_get_msg(ptr);
454                         org.ldk.structs.ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ClosingSigned(null, msg); }
455                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
456                         this.msg = msg_hu_conv;
457                 }
458         }
459         /** A MessageSendEvent of type SendShutdown */
460         public class MessageSendEvent_SendShutdown : MessageSendEvent {
461                 /**
462                  * The node_id of the node which should receive this message
463                  */
464                 public byte[] node_id;
465                 /**
466                  * The message which should be sent.
467                  */
468                 public Shutdown msg;
469                 internal MessageSendEvent_SendShutdown(long ptr) : base(null, ptr) {
470                         long node_id = bindings.LDKMessageSendEvent_SendShutdown_get_node_id(ptr);
471                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
472                         this.node_id = node_id_conv;
473                         long msg = bindings.LDKMessageSendEvent_SendShutdown_get_msg(ptr);
474                         org.ldk.structs.Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Shutdown(null, msg); }
475                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
476                         this.msg = msg_hu_conv;
477                 }
478         }
479         /** A MessageSendEvent of type SendChannelReestablish */
480         public class MessageSendEvent_SendChannelReestablish : MessageSendEvent {
481                 /**
482                  * The node_id of the node which should receive this message
483                  */
484                 public byte[] node_id;
485                 /**
486                  * The message which should be sent.
487                  */
488                 public ChannelReestablish msg;
489                 internal MessageSendEvent_SendChannelReestablish(long ptr) : base(null, ptr) {
490                         long node_id = bindings.LDKMessageSendEvent_SendChannelReestablish_get_node_id(ptr);
491                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
492                         this.node_id = node_id_conv;
493                         long msg = bindings.LDKMessageSendEvent_SendChannelReestablish_get_msg(ptr);
494                         org.ldk.structs.ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReestablish(null, msg); }
495                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
496                         this.msg = msg_hu_conv;
497                 }
498         }
499         /** A MessageSendEvent of type SendChannelAnnouncement */
500         public class MessageSendEvent_SendChannelAnnouncement : MessageSendEvent {
501                 /**
502                  * The node_id of the node which should receive this message
503                  */
504                 public byte[] node_id;
505                 /**
506                  * The channel_announcement which should be sent.
507                  */
508                 public ChannelAnnouncement msg;
509                 /**
510                  * The followup channel_update which should be sent.
511                  */
512                 public ChannelUpdate update_msg;
513                 internal MessageSendEvent_SendChannelAnnouncement(long ptr) : base(null, ptr) {
514                         long node_id = bindings.LDKMessageSendEvent_SendChannelAnnouncement_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_SendChannelAnnouncement_get_msg(ptr);
518                         org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); }
519                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
520                         this.msg = msg_hu_conv;
521                         long update_msg = bindings.LDKMessageSendEvent_SendChannelAnnouncement_get_update_msg(ptr);
522                         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); }
523                         if (update_msg_hu_conv != null) { update_msg_hu_conv.ptrs_to.AddLast(this); };
524                         this.update_msg = update_msg_hu_conv;
525                 }
526         }
527         /** A MessageSendEvent of type BroadcastChannelAnnouncement */
528         public class MessageSendEvent_BroadcastChannelAnnouncement : MessageSendEvent {
529                 /**
530                  * The channel_announcement which should be sent.
531                  */
532                 public ChannelAnnouncement msg;
533                 /**
534                  * The followup channel_update which should be sent.
535                  * 
536                  * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
537                  */
538                 public ChannelUpdate update_msg;
539                 internal MessageSendEvent_BroadcastChannelAnnouncement(long ptr) : base(null, ptr) {
540                         long msg = bindings.LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg(ptr);
541                         org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); }
542                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
543                         this.msg = msg_hu_conv;
544                         long update_msg = bindings.LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg(ptr);
545                         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); }
546                         if (update_msg_hu_conv != null) { update_msg_hu_conv.ptrs_to.AddLast(this); };
547                         this.update_msg = update_msg_hu_conv;
548                 }
549         }
550         /** A MessageSendEvent of type BroadcastChannelUpdate */
551         public class MessageSendEvent_BroadcastChannelUpdate : MessageSendEvent {
552                 /**
553                  * The channel_update which should be sent.
554                  */
555                 public ChannelUpdate msg;
556                 internal MessageSendEvent_BroadcastChannelUpdate(long ptr) : base(null, ptr) {
557                         long msg = bindings.LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(ptr);
558                         org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(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 BroadcastNodeAnnouncement */
564         public class MessageSendEvent_BroadcastNodeAnnouncement : MessageSendEvent {
565                 /**
566                  * The node_announcement which should be sent.
567                  */
568                 public NodeAnnouncement msg;
569                 internal MessageSendEvent_BroadcastNodeAnnouncement(long ptr) : base(null, ptr) {
570                         long msg = bindings.LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg(ptr);
571                         org.ldk.structs.NodeAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.NodeAnnouncement(null, msg); }
572                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
573                         this.msg = msg_hu_conv;
574                 }
575         }
576         /** A MessageSendEvent of type SendChannelUpdate */
577         public class MessageSendEvent_SendChannelUpdate : MessageSendEvent {
578                 /**
579                  * The node_id of the node which should receive this message
580                  */
581                 public byte[] node_id;
582                 /**
583                  * The channel_update which should be sent.
584                  */
585                 public ChannelUpdate msg;
586                 internal MessageSendEvent_SendChannelUpdate(long ptr) : base(null, ptr) {
587                         long node_id = bindings.LDKMessageSendEvent_SendChannelUpdate_get_node_id(ptr);
588                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
589                         this.node_id = node_id_conv;
590                         long msg = bindings.LDKMessageSendEvent_SendChannelUpdate_get_msg(ptr);
591                         org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); }
592                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
593                         this.msg = msg_hu_conv;
594                 }
595         }
596         /** A MessageSendEvent of type HandleError */
597         public class MessageSendEvent_HandleError : MessageSendEvent {
598                 /**
599                  * The node_id of the node which should receive this message
600                  */
601                 public byte[] node_id;
602                 /**
603                  * The action which should be taken.
604                  */
605                 public ErrorAction action;
606                 internal MessageSendEvent_HandleError(long ptr) : base(null, ptr) {
607                         long node_id = bindings.LDKMessageSendEvent_HandleError_get_node_id(ptr);
608                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
609                         this.node_id = node_id_conv;
610                         long action = bindings.LDKMessageSendEvent_HandleError_get_action(ptr);
611                         org.ldk.structs.ErrorAction action_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(action);
612                         if (action_hu_conv != null) { action_hu_conv.ptrs_to.AddLast(this); };
613                         this.action = action_hu_conv;
614                 }
615         }
616         /** A MessageSendEvent of type SendChannelRangeQuery */
617         public class MessageSendEvent_SendChannelRangeQuery : MessageSendEvent {
618                 /**
619                  * The node_id of this message recipient
620                  */
621                 public byte[] node_id;
622                 /**
623                  * The query_channel_range which should be sent.
624                  */
625                 public QueryChannelRange msg;
626                 internal MessageSendEvent_SendChannelRangeQuery(long ptr) : base(null, ptr) {
627                         long node_id = bindings.LDKMessageSendEvent_SendChannelRangeQuery_get_node_id(ptr);
628                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
629                         this.node_id = node_id_conv;
630                         long msg = bindings.LDKMessageSendEvent_SendChannelRangeQuery_get_msg(ptr);
631                         org.ldk.structs.QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryChannelRange(null, msg); }
632                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
633                         this.msg = msg_hu_conv;
634                 }
635         }
636         /** A MessageSendEvent of type SendShortIdsQuery */
637         public class MessageSendEvent_SendShortIdsQuery : MessageSendEvent {
638                 /**
639                  * The node_id of this message recipient
640                  */
641                 public byte[] node_id;
642                 /**
643                  * The query_short_channel_ids which should be sent.
644                  */
645                 public QueryShortChannelIds msg;
646                 internal MessageSendEvent_SendShortIdsQuery(long ptr) : base(null, ptr) {
647                         long node_id = bindings.LDKMessageSendEvent_SendShortIdsQuery_get_node_id(ptr);
648                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
649                         this.node_id = node_id_conv;
650                         long msg = bindings.LDKMessageSendEvent_SendShortIdsQuery_get_msg(ptr);
651                         org.ldk.structs.QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, msg); }
652                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
653                         this.msg = msg_hu_conv;
654                 }
655         }
656         /** A MessageSendEvent of type SendReplyChannelRange */
657         public class MessageSendEvent_SendReplyChannelRange : MessageSendEvent {
658                 /**
659                  * The node_id of this message recipient
660                  */
661                 public byte[] node_id;
662                 /**
663                  * The reply_channel_range which should be sent.
664                  */
665                 public ReplyChannelRange msg;
666                 internal MessageSendEvent_SendReplyChannelRange(long ptr) : base(null, ptr) {
667                         long node_id = bindings.LDKMessageSendEvent_SendReplyChannelRange_get_node_id(ptr);
668                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
669                         this.node_id = node_id_conv;
670                         long msg = bindings.LDKMessageSendEvent_SendReplyChannelRange_get_msg(ptr);
671                         org.ldk.structs.ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ReplyChannelRange(null, msg); }
672                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
673                         this.msg = msg_hu_conv;
674                 }
675         }
676         /** A MessageSendEvent of type SendGossipTimestampFilter */
677         public class MessageSendEvent_SendGossipTimestampFilter : MessageSendEvent {
678                 /**
679                  * The node_id of this message recipient
680                  */
681                 public byte[] node_id;
682                 /**
683                  * The gossip_timestamp_filter which should be sent.
684                  */
685                 public GossipTimestampFilter msg;
686                 internal MessageSendEvent_SendGossipTimestampFilter(long ptr) : base(null, ptr) {
687                         long node_id = bindings.LDKMessageSendEvent_SendGossipTimestampFilter_get_node_id(ptr);
688                         byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
689                         this.node_id = node_id_conv;
690                         long msg = bindings.LDKMessageSendEvent_SendGossipTimestampFilter_get_msg(ptr);
691                         org.ldk.structs.GossipTimestampFilter msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.GossipTimestampFilter(null, msg); }
692                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
693                         this.msg = msg_hu_conv;
694                 }
695         }
696         internal long clone_ptr() {
697                 long ret = bindings.MessageSendEvent_clone_ptr(this.ptr);
698                 GC.KeepAlive(this);
699                 return ret;
700         }
701
702         /**
703          * Creates a copy of the MessageSendEvent
704          */
705         public MessageSendEvent clone() {
706                 long ret = bindings.MessageSendEvent_clone(this.ptr);
707                 GC.KeepAlive(this);
708                 if (ret >= 0 && ret <= 4096) { return null; }
709                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
710                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
711                 return ret_hu_conv;
712         }
713
714         /**
715          * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
716          */
717         public static MessageSendEvent send_accept_channel(byte[] node_id, org.ldk.structs.AcceptChannel msg) {
718                 long ret = bindings.MessageSendEvent_send_accept_channel(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
719                 GC.KeepAlive(node_id);
720                 GC.KeepAlive(msg);
721                 if (ret >= 0 && ret <= 4096) { return null; }
722                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
723                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
724                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
725                 return ret_hu_conv;
726         }
727
728         /**
729          * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
730          */
731         public static MessageSendEvent send_accept_channel_v2(byte[] node_id, org.ldk.structs.AcceptChannelV2 msg) {
732                 long ret = bindings.MessageSendEvent_send_accept_channel_v2(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
733                 GC.KeepAlive(node_id);
734                 GC.KeepAlive(msg);
735                 if (ret >= 0 && ret <= 4096) { return null; }
736                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
737                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
738                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
739                 return ret_hu_conv;
740         }
741
742         /**
743          * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
744          */
745         public static MessageSendEvent send_open_channel(byte[] node_id, org.ldk.structs.OpenChannel msg) {
746                 long ret = bindings.MessageSendEvent_send_open_channel(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
747                 GC.KeepAlive(node_id);
748                 GC.KeepAlive(msg);
749                 if (ret >= 0 && ret <= 4096) { return null; }
750                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
751                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
752                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
753                 return ret_hu_conv;
754         }
755
756         /**
757          * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
758          */
759         public static MessageSendEvent send_open_channel_v2(byte[] node_id, org.ldk.structs.OpenChannelV2 msg) {
760                 long ret = bindings.MessageSendEvent_send_open_channel_v2(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
761                 GC.KeepAlive(node_id);
762                 GC.KeepAlive(msg);
763                 if (ret >= 0 && ret <= 4096) { return null; }
764                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
765                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
766                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
767                 return ret_hu_conv;
768         }
769
770         /**
771          * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
772          */
773         public static MessageSendEvent send_funding_created(byte[] node_id, org.ldk.structs.FundingCreated msg) {
774                 long ret = bindings.MessageSendEvent_send_funding_created(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
775                 GC.KeepAlive(node_id);
776                 GC.KeepAlive(msg);
777                 if (ret >= 0 && ret <= 4096) { return null; }
778                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
779                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
780                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
781                 return ret_hu_conv;
782         }
783
784         /**
785          * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
786          */
787         public static MessageSendEvent send_funding_signed(byte[] node_id, org.ldk.structs.FundingSigned msg) {
788                 long ret = bindings.MessageSendEvent_send_funding_signed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
789                 GC.KeepAlive(node_id);
790                 GC.KeepAlive(msg);
791                 if (ret >= 0 && ret <= 4096) { return null; }
792                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
793                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
794                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
795                 return ret_hu_conv;
796         }
797
798         /**
799          * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
800          */
801         public static MessageSendEvent send_tx_add_input(byte[] node_id, org.ldk.structs.TxAddInput msg) {
802                 long ret = bindings.MessageSendEvent_send_tx_add_input(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 SendTxAddOutput-variant MessageSendEvent
814          */
815         public static MessageSendEvent send_tx_add_output(byte[] node_id, org.ldk.structs.TxAddOutput msg) {
816                 long ret = bindings.MessageSendEvent_send_tx_add_output(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 SendTxRemoveInput-variant MessageSendEvent
828          */
829         public static MessageSendEvent send_tx_remove_input(byte[] node_id, org.ldk.structs.TxRemoveInput msg) {
830                 long ret = bindings.MessageSendEvent_send_tx_remove_input(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 SendTxRemoveOutput-variant MessageSendEvent
842          */
843         public static MessageSendEvent send_tx_remove_output(byte[] node_id, org.ldk.structs.TxRemoveOutput msg) {
844                 long ret = bindings.MessageSendEvent_send_tx_remove_output(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 SendTxComplete-variant MessageSendEvent
856          */
857         public static MessageSendEvent send_tx_complete(byte[] node_id, org.ldk.structs.TxComplete msg) {
858                 long ret = bindings.MessageSendEvent_send_tx_complete(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 SendTxSignatures-variant MessageSendEvent
870          */
871         public static MessageSendEvent send_tx_signatures(byte[] node_id, org.ldk.structs.TxSignatures msg) {
872                 long ret = bindings.MessageSendEvent_send_tx_signatures(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 SendTxInitRbf-variant MessageSendEvent
884          */
885         public static MessageSendEvent send_tx_init_rbf(byte[] node_id, org.ldk.structs.TxInitRbf msg) {
886                 long ret = bindings.MessageSendEvent_send_tx_init_rbf(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 SendTxAckRbf-variant MessageSendEvent
898          */
899         public static MessageSendEvent send_tx_ack_rbf(byte[] node_id, org.ldk.structs.TxAckRbf msg) {
900                 long ret = bindings.MessageSendEvent_send_tx_ack_rbf(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 SendTxAbort-variant MessageSendEvent
912          */
913         public static MessageSendEvent send_tx_abort(byte[] node_id, org.ldk.structs.TxAbort msg) {
914                 long ret = bindings.MessageSendEvent_send_tx_abort(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 SendChannelReady-variant MessageSendEvent
926          */
927         public static MessageSendEvent send_channel_ready(byte[] node_id, org.ldk.structs.ChannelReady msg) {
928                 long ret = bindings.MessageSendEvent_send_channel_ready(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 SendAnnouncementSignatures-variant MessageSendEvent
940          */
941         public static MessageSendEvent send_announcement_signatures(byte[] node_id, org.ldk.structs.AnnouncementSignatures msg) {
942                 long ret = bindings.MessageSendEvent_send_announcement_signatures(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 UpdateHTLCs-variant MessageSendEvent
954          */
955         public static MessageSendEvent update_htlcs(byte[] node_id, org.ldk.structs.CommitmentUpdate updates) {
956                 long ret = bindings.MessageSendEvent_update_htlcs(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), updates == null ? 0 : updates.ptr);
957                 GC.KeepAlive(node_id);
958                 GC.KeepAlive(updates);
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(updates); };
963                 return ret_hu_conv;
964         }
965
966         /**
967          * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
968          */
969         public static MessageSendEvent send_revoke_and_ack(byte[] node_id, org.ldk.structs.RevokeAndACK msg) {
970                 long ret = bindings.MessageSendEvent_send_revoke_and_ack(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 SendClosingSigned-variant MessageSendEvent
982          */
983         public static MessageSendEvent send_closing_signed(byte[] node_id, org.ldk.structs.ClosingSigned msg) {
984                 long ret = bindings.MessageSendEvent_send_closing_signed(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 SendShutdown-variant MessageSendEvent
996          */
997         public static MessageSendEvent send_shutdown(byte[] node_id, org.ldk.structs.Shutdown msg) {
998                 long ret = bindings.MessageSendEvent_send_shutdown(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 SendChannelReestablish-variant MessageSendEvent
1010          */
1011         public static MessageSendEvent send_channel_reestablish(byte[] node_id, org.ldk.structs.ChannelReestablish msg) {
1012                 long ret = bindings.MessageSendEvent_send_channel_reestablish(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 SendChannelAnnouncement-variant MessageSendEvent
1024          */
1025         public static MessageSendEvent send_channel_announcement(byte[] node_id, org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) {
1026                 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);
1027                 GC.KeepAlive(node_id);
1028                 GC.KeepAlive(msg);
1029                 GC.KeepAlive(update_msg);
1030                 if (ret >= 0 && ret <= 4096) { return null; }
1031                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1032                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1033                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1034                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_msg); };
1035                 return ret_hu_conv;
1036         }
1037
1038         /**
1039          * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
1040          */
1041         public static MessageSendEvent broadcast_channel_announcement(org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) {
1042                 long ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : msg.ptr, update_msg == null ? 0 : update_msg.ptr);
1043                 GC.KeepAlive(msg);
1044                 GC.KeepAlive(update_msg);
1045                 if (ret >= 0 && ret <= 4096) { return null; }
1046                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1047                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1048                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1049                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_msg); };
1050                 return ret_hu_conv;
1051         }
1052
1053         /**
1054          * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
1055          */
1056         public static MessageSendEvent broadcast_channel_update(org.ldk.structs.ChannelUpdate msg) {
1057                 long ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr);
1058                 GC.KeepAlive(msg);
1059                 if (ret >= 0 && ret <= 4096) { return null; }
1060                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1061                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1062                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1063                 return ret_hu_conv;
1064         }
1065
1066         /**
1067          * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
1068          */
1069         public static MessageSendEvent broadcast_node_announcement(org.ldk.structs.NodeAnnouncement msg) {
1070                 long ret = bindings.MessageSendEvent_broadcast_node_announcement(msg == null ? 0 : msg.ptr);
1071                 GC.KeepAlive(msg);
1072                 if (ret >= 0 && ret <= 4096) { return null; }
1073                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1074                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1075                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1076                 return ret_hu_conv;
1077         }
1078
1079         /**
1080          * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
1081          */
1082         public static MessageSendEvent send_channel_update(byte[] node_id, org.ldk.structs.ChannelUpdate msg) {
1083                 long ret = bindings.MessageSendEvent_send_channel_update(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1084                 GC.KeepAlive(node_id);
1085                 GC.KeepAlive(msg);
1086                 if (ret >= 0 && ret <= 4096) { return null; }
1087                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1088                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1089                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1090                 return ret_hu_conv;
1091         }
1092
1093         /**
1094          * Utility method to constructs a new HandleError-variant MessageSendEvent
1095          */
1096         public static MessageSendEvent handle_error(byte[] node_id, org.ldk.structs.ErrorAction action) {
1097                 long ret = bindings.MessageSendEvent_handle_error(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), action.ptr);
1098                 GC.KeepAlive(node_id);
1099                 GC.KeepAlive(action);
1100                 if (ret >= 0 && ret <= 4096) { return null; }
1101                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1102                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1103                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(action); };
1104                 return ret_hu_conv;
1105         }
1106
1107         /**
1108          * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
1109          */
1110         public static MessageSendEvent send_channel_range_query(byte[] node_id, org.ldk.structs.QueryChannelRange msg) {
1111                 long ret = bindings.MessageSendEvent_send_channel_range_query(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1112                 GC.KeepAlive(node_id);
1113                 GC.KeepAlive(msg);
1114                 if (ret >= 0 && ret <= 4096) { return null; }
1115                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1116                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1117                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1118                 return ret_hu_conv;
1119         }
1120
1121         /**
1122          * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
1123          */
1124         public static MessageSendEvent send_short_ids_query(byte[] node_id, org.ldk.structs.QueryShortChannelIds msg) {
1125                 long ret = bindings.MessageSendEvent_send_short_ids_query(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1126                 GC.KeepAlive(node_id);
1127                 GC.KeepAlive(msg);
1128                 if (ret >= 0 && ret <= 4096) { return null; }
1129                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1130                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1131                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1132                 return ret_hu_conv;
1133         }
1134
1135         /**
1136          * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
1137          */
1138         public static MessageSendEvent send_reply_channel_range(byte[] node_id, org.ldk.structs.ReplyChannelRange msg) {
1139                 long ret = bindings.MessageSendEvent_send_reply_channel_range(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1140                 GC.KeepAlive(node_id);
1141                 GC.KeepAlive(msg);
1142                 if (ret >= 0 && ret <= 4096) { return null; }
1143                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1144                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1145                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1146                 return ret_hu_conv;
1147         }
1148
1149         /**
1150          * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
1151          */
1152         public static MessageSendEvent send_gossip_timestamp_filter(byte[] node_id, org.ldk.structs.GossipTimestampFilter msg) {
1153                 long ret = bindings.MessageSendEvent_send_gossip_timestamp_filter(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr);
1154                 GC.KeepAlive(node_id);
1155                 GC.KeepAlive(msg);
1156                 if (ret >= 0 && ret <= 4096) { return null; }
1157                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1158                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1159                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
1160                 return ret_hu_conv;
1161         }
1162
1163 }
1164 } } }