[Java] Update auto-generated Java bindings to LDK 0.0.121
[ldk-java] / src / main / java / org / ldk / structs / MessageSendEvent.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
9
10
11 /**
12  * An event generated by ChannelManager which indicates a message should be sent to a peer (or
13  * broadcast to most peers).
14  * These events are handled by PeerManager::process_events if you are using a PeerManager.
15  */
16 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
17 public class MessageSendEvent extends CommonBase {
18         private MessageSendEvent(Object _dummy, long ptr) { super(ptr); }
19         @Override @SuppressWarnings("deprecation")
20         protected void finalize() throws Throwable {
21                 super.finalize();
22                 if (ptr != 0) { bindings.MessageSendEvent_free(ptr); }
23         }
24         static MessageSendEvent constr_from_ptr(long ptr) {
25                 bindings.LDKMessageSendEvent raw_val = bindings.LDKMessageSendEvent_ref_from_ptr(ptr);
26                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendAcceptChannel.class) {
27                         return new SendAcceptChannel(ptr, (bindings.LDKMessageSendEvent.SendAcceptChannel)raw_val);
28                 }
29                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendAcceptChannelV2.class) {
30                         return new SendAcceptChannelV2(ptr, (bindings.LDKMessageSendEvent.SendAcceptChannelV2)raw_val);
31                 }
32                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendOpenChannel.class) {
33                         return new SendOpenChannel(ptr, (bindings.LDKMessageSendEvent.SendOpenChannel)raw_val);
34                 }
35                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendOpenChannelV2.class) {
36                         return new SendOpenChannelV2(ptr, (bindings.LDKMessageSendEvent.SendOpenChannelV2)raw_val);
37                 }
38                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendFundingCreated.class) {
39                         return new SendFundingCreated(ptr, (bindings.LDKMessageSendEvent.SendFundingCreated)raw_val);
40                 }
41                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendFundingSigned.class) {
42                         return new SendFundingSigned(ptr, (bindings.LDKMessageSendEvent.SendFundingSigned)raw_val);
43                 }
44                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendStfu.class) {
45                         return new SendStfu(ptr, (bindings.LDKMessageSendEvent.SendStfu)raw_val);
46                 }
47                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendSplice.class) {
48                         return new SendSplice(ptr, (bindings.LDKMessageSendEvent.SendSplice)raw_val);
49                 }
50                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendSpliceAck.class) {
51                         return new SendSpliceAck(ptr, (bindings.LDKMessageSendEvent.SendSpliceAck)raw_val);
52                 }
53                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendSpliceLocked.class) {
54                         return new SendSpliceLocked(ptr, (bindings.LDKMessageSendEvent.SendSpliceLocked)raw_val);
55                 }
56                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxAddInput.class) {
57                         return new SendTxAddInput(ptr, (bindings.LDKMessageSendEvent.SendTxAddInput)raw_val);
58                 }
59                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxAddOutput.class) {
60                         return new SendTxAddOutput(ptr, (bindings.LDKMessageSendEvent.SendTxAddOutput)raw_val);
61                 }
62                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxRemoveInput.class) {
63                         return new SendTxRemoveInput(ptr, (bindings.LDKMessageSendEvent.SendTxRemoveInput)raw_val);
64                 }
65                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxRemoveOutput.class) {
66                         return new SendTxRemoveOutput(ptr, (bindings.LDKMessageSendEvent.SendTxRemoveOutput)raw_val);
67                 }
68                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxComplete.class) {
69                         return new SendTxComplete(ptr, (bindings.LDKMessageSendEvent.SendTxComplete)raw_val);
70                 }
71                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxSignatures.class) {
72                         return new SendTxSignatures(ptr, (bindings.LDKMessageSendEvent.SendTxSignatures)raw_val);
73                 }
74                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxInitRbf.class) {
75                         return new SendTxInitRbf(ptr, (bindings.LDKMessageSendEvent.SendTxInitRbf)raw_val);
76                 }
77                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxAckRbf.class) {
78                         return new SendTxAckRbf(ptr, (bindings.LDKMessageSendEvent.SendTxAckRbf)raw_val);
79                 }
80                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxAbort.class) {
81                         return new SendTxAbort(ptr, (bindings.LDKMessageSendEvent.SendTxAbort)raw_val);
82                 }
83                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelReady.class) {
84                         return new SendChannelReady(ptr, (bindings.LDKMessageSendEvent.SendChannelReady)raw_val);
85                 }
86                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendAnnouncementSignatures.class) {
87                         return new SendAnnouncementSignatures(ptr, (bindings.LDKMessageSendEvent.SendAnnouncementSignatures)raw_val);
88                 }
89                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.UpdateHTLCs.class) {
90                         return new UpdateHTLCs(ptr, (bindings.LDKMessageSendEvent.UpdateHTLCs)raw_val);
91                 }
92                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendRevokeAndACK.class) {
93                         return new SendRevokeAndACK(ptr, (bindings.LDKMessageSendEvent.SendRevokeAndACK)raw_val);
94                 }
95                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendClosingSigned.class) {
96                         return new SendClosingSigned(ptr, (bindings.LDKMessageSendEvent.SendClosingSigned)raw_val);
97                 }
98                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendShutdown.class) {
99                         return new SendShutdown(ptr, (bindings.LDKMessageSendEvent.SendShutdown)raw_val);
100                 }
101                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelReestablish.class) {
102                         return new SendChannelReestablish(ptr, (bindings.LDKMessageSendEvent.SendChannelReestablish)raw_val);
103                 }
104                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelAnnouncement.class) {
105                         return new SendChannelAnnouncement(ptr, (bindings.LDKMessageSendEvent.SendChannelAnnouncement)raw_val);
106                 }
107                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement.class) {
108                         return new BroadcastChannelAnnouncement(ptr, (bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement)raw_val);
109                 }
110                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastChannelUpdate.class) {
111                         return new BroadcastChannelUpdate(ptr, (bindings.LDKMessageSendEvent.BroadcastChannelUpdate)raw_val);
112                 }
113                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement.class) {
114                         return new BroadcastNodeAnnouncement(ptr, (bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement)raw_val);
115                 }
116                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelUpdate.class) {
117                         return new SendChannelUpdate(ptr, (bindings.LDKMessageSendEvent.SendChannelUpdate)raw_val);
118                 }
119                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.HandleError.class) {
120                         return new HandleError(ptr, (bindings.LDKMessageSendEvent.HandleError)raw_val);
121                 }
122                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelRangeQuery.class) {
123                         return new SendChannelRangeQuery(ptr, (bindings.LDKMessageSendEvent.SendChannelRangeQuery)raw_val);
124                 }
125                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendShortIdsQuery.class) {
126                         return new SendShortIdsQuery(ptr, (bindings.LDKMessageSendEvent.SendShortIdsQuery)raw_val);
127                 }
128                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendReplyChannelRange.class) {
129                         return new SendReplyChannelRange(ptr, (bindings.LDKMessageSendEvent.SendReplyChannelRange)raw_val);
130                 }
131                 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendGossipTimestampFilter.class) {
132                         return new SendGossipTimestampFilter(ptr, (bindings.LDKMessageSendEvent.SendGossipTimestampFilter)raw_val);
133                 }
134                 assert false; return null; // Unreachable without extending the (internal) bindings interface
135         }
136
137         /**
138          * Used to indicate that we've accepted a channel open and should send the accept_channel
139          * message provided to the given peer.
140          */
141         public final static class SendAcceptChannel extends MessageSendEvent {
142                 /**
143                  * The node_id of the node which should receive this message
144                 */
145                 public final byte[] node_id;
146                 /**
147                  * The message which should be sent.
148                 */
149                 public final org.ldk.structs.AcceptChannel msg;
150                 private SendAcceptChannel(long ptr, bindings.LDKMessageSendEvent.SendAcceptChannel obj) {
151                         super(null, ptr);
152                         this.node_id = obj.node_id;
153                         long msg = obj.msg;
154                         org.ldk.structs.AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannel(null, msg); }
155                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
156                         this.msg = msg_hu_conv;
157                 }
158         }
159         /**
160          * Used to indicate that we've accepted a V2 channel open and should send the accept_channel2
161          * message provided to the given peer.
162          */
163         public final static class SendAcceptChannelV2 extends MessageSendEvent {
164                 /**
165                  * The node_id of the node which should receive this message
166                 */
167                 public final byte[] node_id;
168                 /**
169                  * The message which should be sent.
170                 */
171                 public final org.ldk.structs.AcceptChannelV2 msg;
172                 private SendAcceptChannelV2(long ptr, bindings.LDKMessageSendEvent.SendAcceptChannelV2 obj) {
173                         super(null, ptr);
174                         this.node_id = obj.node_id;
175                         long msg = obj.msg;
176                         org.ldk.structs.AcceptChannelV2 msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannelV2(null, msg); }
177                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
178                         this.msg = msg_hu_conv;
179                 }
180         }
181         /**
182          * Used to indicate that we've initiated a channel open and should send the open_channel
183          * message provided to the given peer.
184          */
185         public final static class SendOpenChannel extends MessageSendEvent {
186                 /**
187                  * The node_id of the node which should receive this message
188                 */
189                 public final byte[] node_id;
190                 /**
191                  * The message which should be sent.
192                 */
193                 public final org.ldk.structs.OpenChannel msg;
194                 private SendOpenChannel(long ptr, bindings.LDKMessageSendEvent.SendOpenChannel obj) {
195                         super(null, ptr);
196                         this.node_id = obj.node_id;
197                         long msg = obj.msg;
198                         org.ldk.structs.OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannel(null, msg); }
199                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
200                         this.msg = msg_hu_conv;
201                 }
202         }
203         /**
204          * Used to indicate that we've initiated a V2 channel open and should send the open_channel2
205          * message provided to the given peer.
206          */
207         public final static class SendOpenChannelV2 extends MessageSendEvent {
208                 /**
209                  * The node_id of the node which should receive this message
210                 */
211                 public final byte[] node_id;
212                 /**
213                  * The message which should be sent.
214                 */
215                 public final org.ldk.structs.OpenChannelV2 msg;
216                 private SendOpenChannelV2(long ptr, bindings.LDKMessageSendEvent.SendOpenChannelV2 obj) {
217                         super(null, ptr);
218                         this.node_id = obj.node_id;
219                         long msg = obj.msg;
220                         org.ldk.structs.OpenChannelV2 msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannelV2(null, msg); }
221                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
222                         this.msg = msg_hu_conv;
223                 }
224         }
225         /**
226          * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
227          */
228         public final static class SendFundingCreated extends MessageSendEvent {
229                 /**
230                  * The node_id of the node which should receive this message
231                 */
232                 public final byte[] node_id;
233                 /**
234                  * The message which should be sent.
235                 */
236                 public final org.ldk.structs.FundingCreated msg;
237                 private SendFundingCreated(long ptr, bindings.LDKMessageSendEvent.SendFundingCreated obj) {
238                         super(null, ptr);
239                         this.node_id = obj.node_id;
240                         long msg = obj.msg;
241                         org.ldk.structs.FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingCreated(null, msg); }
242                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
243                         this.msg = msg_hu_conv;
244                 }
245         }
246         /**
247          * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
248          */
249         public final static class SendFundingSigned extends MessageSendEvent {
250                 /**
251                  * The node_id of the node which should receive this message
252                 */
253                 public final byte[] node_id;
254                 /**
255                  * The message which should be sent.
256                 */
257                 public final org.ldk.structs.FundingSigned msg;
258                 private SendFundingSigned(long ptr, bindings.LDKMessageSendEvent.SendFundingSigned obj) {
259                         super(null, ptr);
260                         this.node_id = obj.node_id;
261                         long msg = obj.msg;
262                         org.ldk.structs.FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingSigned(null, msg); }
263                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
264                         this.msg = msg_hu_conv;
265                 }
266         }
267         /**
268          * Used to indicate that a stfu message should be sent to the peer with the given node id.
269          */
270         public final static class SendStfu extends MessageSendEvent {
271                 /**
272                  * The node_id of the node which should receive this message
273                 */
274                 public final byte[] node_id;
275                 /**
276                  * The message which should be sent.
277                 */
278                 public final org.ldk.structs.Stfu msg;
279                 private SendStfu(long ptr, bindings.LDKMessageSendEvent.SendStfu obj) {
280                         super(null, ptr);
281                         this.node_id = obj.node_id;
282                         long msg = obj.msg;
283                         org.ldk.structs.Stfu msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Stfu(null, msg); }
284                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
285                         this.msg = msg_hu_conv;
286                 }
287         }
288         /**
289          * Used to indicate that a splice message should be sent to the peer with the given node id.
290          */
291         public final static class SendSplice extends MessageSendEvent {
292                 /**
293                  * The node_id of the node which should receive this message
294                 */
295                 public final byte[] node_id;
296                 /**
297                  * The message which should be sent.
298                 */
299                 public final org.ldk.structs.Splice msg;
300                 private SendSplice(long ptr, bindings.LDKMessageSendEvent.SendSplice obj) {
301                         super(null, ptr);
302                         this.node_id = obj.node_id;
303                         long msg = obj.msg;
304                         org.ldk.structs.Splice msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Splice(null, msg); }
305                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
306                         this.msg = msg_hu_conv;
307                 }
308         }
309         /**
310          * Used to indicate that a splice_ack message should be sent to the peer with the given node id.
311          */
312         public final static class SendSpliceAck extends MessageSendEvent {
313                 /**
314                  * The node_id of the node which should receive this message
315                 */
316                 public final byte[] node_id;
317                 /**
318                  * The message which should be sent.
319                 */
320                 public final org.ldk.structs.SpliceAck msg;
321                 private SendSpliceAck(long ptr, bindings.LDKMessageSendEvent.SendSpliceAck obj) {
322                         super(null, ptr);
323                         this.node_id = obj.node_id;
324                         long msg = obj.msg;
325                         org.ldk.structs.SpliceAck msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.SpliceAck(null, msg); }
326                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
327                         this.msg = msg_hu_conv;
328                 }
329         }
330         /**
331          * Used to indicate that a splice_locked message should be sent to the peer with the given node id.
332          */
333         public final static class SendSpliceLocked extends MessageSendEvent {
334                 /**
335                  * The node_id of the node which should receive this message
336                 */
337                 public final byte[] node_id;
338                 /**
339                  * The message which should be sent.
340                 */
341                 public final org.ldk.structs.SpliceLocked msg;
342                 private SendSpliceLocked(long ptr, bindings.LDKMessageSendEvent.SendSpliceLocked obj) {
343                         super(null, ptr);
344                         this.node_id = obj.node_id;
345                         long msg = obj.msg;
346                         org.ldk.structs.SpliceLocked msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.SpliceLocked(null, msg); }
347                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
348                         this.msg = msg_hu_conv;
349                 }
350         }
351         /**
352          * Used to indicate that a tx_add_input message should be sent to the peer with the given node_id.
353          */
354         public final static class SendTxAddInput extends MessageSendEvent {
355                 /**
356                  * The node_id of the node which should receive this message
357                 */
358                 public final byte[] node_id;
359                 /**
360                  * The message which should be sent.
361                 */
362                 public final org.ldk.structs.TxAddInput msg;
363                 private SendTxAddInput(long ptr, bindings.LDKMessageSendEvent.SendTxAddInput obj) {
364                         super(null, ptr);
365                         this.node_id = obj.node_id;
366                         long msg = obj.msg;
367                         org.ldk.structs.TxAddInput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAddInput(null, msg); }
368                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
369                         this.msg = msg_hu_conv;
370                 }
371         }
372         /**
373          * Used to indicate that a tx_add_output message should be sent to the peer with the given node_id.
374          */
375         public final static class SendTxAddOutput extends MessageSendEvent {
376                 /**
377                  * The node_id of the node which should receive this message
378                 */
379                 public final byte[] node_id;
380                 /**
381                  * The message which should be sent.
382                 */
383                 public final org.ldk.structs.TxAddOutput msg;
384                 private SendTxAddOutput(long ptr, bindings.LDKMessageSendEvent.SendTxAddOutput obj) {
385                         super(null, ptr);
386                         this.node_id = obj.node_id;
387                         long msg = obj.msg;
388                         org.ldk.structs.TxAddOutput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAddOutput(null, msg); }
389                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
390                         this.msg = msg_hu_conv;
391                 }
392         }
393         /**
394          * Used to indicate that a tx_remove_input message should be sent to the peer with the given node_id.
395          */
396         public final static class SendTxRemoveInput extends MessageSendEvent {
397                 /**
398                  * The node_id of the node which should receive this message
399                 */
400                 public final byte[] node_id;
401                 /**
402                  * The message which should be sent.
403                 */
404                 public final org.ldk.structs.TxRemoveInput msg;
405                 private SendTxRemoveInput(long ptr, bindings.LDKMessageSendEvent.SendTxRemoveInput obj) {
406                         super(null, ptr);
407                         this.node_id = obj.node_id;
408                         long msg = obj.msg;
409                         org.ldk.structs.TxRemoveInput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxRemoveInput(null, msg); }
410                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
411                         this.msg = msg_hu_conv;
412                 }
413         }
414         /**
415          * Used to indicate that a tx_remove_output message should be sent to the peer with the given node_id.
416          */
417         public final static class SendTxRemoveOutput extends MessageSendEvent {
418                 /**
419                  * The node_id of the node which should receive this message
420                 */
421                 public final byte[] node_id;
422                 /**
423                  * The message which should be sent.
424                 */
425                 public final org.ldk.structs.TxRemoveOutput msg;
426                 private SendTxRemoveOutput(long ptr, bindings.LDKMessageSendEvent.SendTxRemoveOutput obj) {
427                         super(null, ptr);
428                         this.node_id = obj.node_id;
429                         long msg = obj.msg;
430                         org.ldk.structs.TxRemoveOutput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxRemoveOutput(null, msg); }
431                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
432                         this.msg = msg_hu_conv;
433                 }
434         }
435         /**
436          * Used to indicate that a tx_complete message should be sent to the peer with the given node_id.
437          */
438         public final static class SendTxComplete extends MessageSendEvent {
439                 /**
440                  * The node_id of the node which should receive this message
441                 */
442                 public final byte[] node_id;
443                 /**
444                  * The message which should be sent.
445                 */
446                 public final org.ldk.structs.TxComplete msg;
447                 private SendTxComplete(long ptr, bindings.LDKMessageSendEvent.SendTxComplete obj) {
448                         super(null, ptr);
449                         this.node_id = obj.node_id;
450                         long msg = obj.msg;
451                         org.ldk.structs.TxComplete msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxComplete(null, msg); }
452                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
453                         this.msg = msg_hu_conv;
454                 }
455         }
456         /**
457          * Used to indicate that a tx_signatures message should be sent to the peer with the given node_id.
458          */
459         public final static class SendTxSignatures extends MessageSendEvent {
460                 /**
461                  * The node_id of the node which should receive this message
462                 */
463                 public final byte[] node_id;
464                 /**
465                  * The message which should be sent.
466                 */
467                 public final org.ldk.structs.TxSignatures msg;
468                 private SendTxSignatures(long ptr, bindings.LDKMessageSendEvent.SendTxSignatures obj) {
469                         super(null, ptr);
470                         this.node_id = obj.node_id;
471                         long msg = obj.msg;
472                         org.ldk.structs.TxSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxSignatures(null, msg); }
473                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
474                         this.msg = msg_hu_conv;
475                 }
476         }
477         /**
478          * Used to indicate that a tx_init_rbf message should be sent to the peer with the given node_id.
479          */
480         public final static class SendTxInitRbf extends MessageSendEvent {
481                 /**
482                  * The node_id of the node which should receive this message
483                 */
484                 public final byte[] node_id;
485                 /**
486                  * The message which should be sent.
487                 */
488                 public final org.ldk.structs.TxInitRbf msg;
489                 private SendTxInitRbf(long ptr, bindings.LDKMessageSendEvent.SendTxInitRbf obj) {
490                         super(null, ptr);
491                         this.node_id = obj.node_id;
492                         long msg = obj.msg;
493                         org.ldk.structs.TxInitRbf msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxInitRbf(null, msg); }
494                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
495                         this.msg = msg_hu_conv;
496                 }
497         }
498         /**
499          * Used to indicate that a tx_ack_rbf message should be sent to the peer with the given node_id.
500          */
501         public final static class SendTxAckRbf extends MessageSendEvent {
502                 /**
503                  * The node_id of the node which should receive this message
504                 */
505                 public final byte[] node_id;
506                 /**
507                  * The message which should be sent.
508                 */
509                 public final org.ldk.structs.TxAckRbf msg;
510                 private SendTxAckRbf(long ptr, bindings.LDKMessageSendEvent.SendTxAckRbf obj) {
511                         super(null, ptr);
512                         this.node_id = obj.node_id;
513                         long msg = obj.msg;
514                         org.ldk.structs.TxAckRbf msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAckRbf(null, msg); }
515                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
516                         this.msg = msg_hu_conv;
517                 }
518         }
519         /**
520          * Used to indicate that a tx_abort message should be sent to the peer with the given node_id.
521          */
522         public final static class SendTxAbort extends MessageSendEvent {
523                 /**
524                  * The node_id of the node which should receive this message
525                 */
526                 public final byte[] node_id;
527                 /**
528                  * The message which should be sent.
529                 */
530                 public final org.ldk.structs.TxAbort msg;
531                 private SendTxAbort(long ptr, bindings.LDKMessageSendEvent.SendTxAbort obj) {
532                         super(null, ptr);
533                         this.node_id = obj.node_id;
534                         long msg = obj.msg;
535                         org.ldk.structs.TxAbort msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAbort(null, msg); }
536                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
537                         this.msg = msg_hu_conv;
538                 }
539         }
540         /**
541          * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
542          */
543         public final static class SendChannelReady extends MessageSendEvent {
544                 /**
545                  * The node_id of the node which should receive these message(s)
546                 */
547                 public final byte[] node_id;
548                 /**
549                  * The channel_ready message which should be sent.
550                 */
551                 public final org.ldk.structs.ChannelReady msg;
552                 private SendChannelReady(long ptr, bindings.LDKMessageSendEvent.SendChannelReady obj) {
553                         super(null, ptr);
554                         this.node_id = obj.node_id;
555                         long msg = obj.msg;
556                         org.ldk.structs.ChannelReady msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReady(null, msg); }
557                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
558                         this.msg = msg_hu_conv;
559                 }
560         }
561         /**
562          * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
563          */
564         public final static class SendAnnouncementSignatures extends MessageSendEvent {
565                 /**
566                  * The node_id of the node which should receive these message(s)
567                 */
568                 public final byte[] node_id;
569                 /**
570                  * The announcement_signatures message which should be sent.
571                 */
572                 public final org.ldk.structs.AnnouncementSignatures msg;
573                 private SendAnnouncementSignatures(long ptr, bindings.LDKMessageSendEvent.SendAnnouncementSignatures obj) {
574                         super(null, ptr);
575                         this.node_id = obj.node_id;
576                         long msg = obj.msg;
577                         org.ldk.structs.AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, msg); }
578                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
579                         this.msg = msg_hu_conv;
580                 }
581         }
582         /**
583          * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
584          * message should be sent to the peer with the given node_id.
585          */
586         public final static class UpdateHTLCs extends MessageSendEvent {
587                 /**
588                  * The node_id of the node which should receive these message(s)
589                 */
590                 public final byte[] node_id;
591                 /**
592                  * The update messages which should be sent. ALL messages in the struct should be sent!
593                 */
594                 public final org.ldk.structs.CommitmentUpdate updates;
595                 private UpdateHTLCs(long ptr, bindings.LDKMessageSendEvent.UpdateHTLCs obj) {
596                         super(null, ptr);
597                         this.node_id = obj.node_id;
598                         long updates = obj.updates;
599                         org.ldk.structs.CommitmentUpdate updates_hu_conv = null; if (updates < 0 || updates > 4096) { updates_hu_conv = new org.ldk.structs.CommitmentUpdate(null, updates); }
600                         if (updates_hu_conv != null) { updates_hu_conv.ptrs_to.add(this); };
601                         this.updates = updates_hu_conv;
602                 }
603         }
604         /**
605          * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
606          */
607         public final static class SendRevokeAndACK extends MessageSendEvent {
608                 /**
609                  * The node_id of the node which should receive this message
610                 */
611                 public final byte[] node_id;
612                 /**
613                  * The message which should be sent.
614                 */
615                 public final org.ldk.structs.RevokeAndACK msg;
616                 private SendRevokeAndACK(long ptr, bindings.LDKMessageSendEvent.SendRevokeAndACK obj) {
617                         super(null, ptr);
618                         this.node_id = obj.node_id;
619                         long msg = obj.msg;
620                         org.ldk.structs.RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.RevokeAndACK(null, msg); }
621                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
622                         this.msg = msg_hu_conv;
623                 }
624         }
625         /**
626          * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
627          */
628         public final static class SendClosingSigned extends MessageSendEvent {
629                 /**
630                  * The node_id of the node which should receive this message
631                 */
632                 public final byte[] node_id;
633                 /**
634                  * The message which should be sent.
635                 */
636                 public final org.ldk.structs.ClosingSigned msg;
637                 private SendClosingSigned(long ptr, bindings.LDKMessageSendEvent.SendClosingSigned obj) {
638                         super(null, ptr);
639                         this.node_id = obj.node_id;
640                         long msg = obj.msg;
641                         org.ldk.structs.ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ClosingSigned(null, msg); }
642                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
643                         this.msg = msg_hu_conv;
644                 }
645         }
646         /**
647          * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
648          */
649         public final static class SendShutdown extends MessageSendEvent {
650                 /**
651                  * The node_id of the node which should receive this message
652                 */
653                 public final byte[] node_id;
654                 /**
655                  * The message which should be sent.
656                 */
657                 public final org.ldk.structs.Shutdown msg;
658                 private SendShutdown(long ptr, bindings.LDKMessageSendEvent.SendShutdown obj) {
659                         super(null, ptr);
660                         this.node_id = obj.node_id;
661                         long msg = obj.msg;
662                         org.ldk.structs.Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Shutdown(null, msg); }
663                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
664                         this.msg = msg_hu_conv;
665                 }
666         }
667         /**
668          * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
669          */
670         public final static class SendChannelReestablish extends MessageSendEvent {
671                 /**
672                  * The node_id of the node which should receive this message
673                 */
674                 public final byte[] node_id;
675                 /**
676                  * The message which should be sent.
677                 */
678                 public final org.ldk.structs.ChannelReestablish msg;
679                 private SendChannelReestablish(long ptr, bindings.LDKMessageSendEvent.SendChannelReestablish obj) {
680                         super(null, ptr);
681                         this.node_id = obj.node_id;
682                         long msg = obj.msg;
683                         org.ldk.structs.ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReestablish(null, msg); }
684                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
685                         this.msg = msg_hu_conv;
686                 }
687         }
688         /**
689          * Used to send a channel_announcement and channel_update to a specific peer, likely on
690          * initial connection to ensure our peers know about our channels.
691          */
692         public final static class SendChannelAnnouncement extends MessageSendEvent {
693                 /**
694                  * The node_id of the node which should receive this message
695                 */
696                 public final byte[] node_id;
697                 /**
698                  * The channel_announcement which should be sent.
699                 */
700                 public final org.ldk.structs.ChannelAnnouncement msg;
701                 /**
702                  * The followup channel_update which should be sent.
703                 */
704                 public final org.ldk.structs.ChannelUpdate update_msg;
705                 private SendChannelAnnouncement(long ptr, bindings.LDKMessageSendEvent.SendChannelAnnouncement obj) {
706                         super(null, ptr);
707                         this.node_id = obj.node_id;
708                         long msg = obj.msg;
709                         org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); }
710                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
711                         this.msg = msg_hu_conv;
712                         long update_msg = obj.update_msg;
713                         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); }
714                         if (update_msg_hu_conv != null) { update_msg_hu_conv.ptrs_to.add(this); };
715                         this.update_msg = update_msg_hu_conv;
716                 }
717         }
718         /**
719          * Used to indicate that a channel_announcement and channel_update should be broadcast to all
720          * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
721          * 
722          * Note that after doing so, you very likely (unless you did so very recently) want to
723          * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
724          * ensures that any nodes which see our channel_announcement also have a relevant
725          * node_announcement, including relevant feature flags which may be important for routing
726          * through or to us.
727          * 
728          * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
729          */
730         public final static class BroadcastChannelAnnouncement extends MessageSendEvent {
731                 /**
732                  * The channel_announcement which should be sent.
733                 */
734                 public final org.ldk.structs.ChannelAnnouncement msg;
735                 /**
736                  * The followup channel_update which should be sent.
737                  * 
738                  * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
739                 */
740                 @Nullable public final org.ldk.structs.ChannelUpdate update_msg;
741                 private BroadcastChannelAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement obj) {
742                         super(null, ptr);
743                         long msg = obj.msg;
744                         org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); }
745                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
746                         this.msg = msg_hu_conv;
747                         long update_msg = obj.update_msg;
748                         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); }
749                         if (update_msg_hu_conv != null) { update_msg_hu_conv.ptrs_to.add(this); };
750                         this.update_msg = update_msg_hu_conv;
751                 }
752         }
753         /**
754          * Used to indicate that a channel_update should be broadcast to all peers.
755          */
756         public final static class BroadcastChannelUpdate extends MessageSendEvent {
757                 /**
758                  * The channel_update which should be sent.
759                 */
760                 public final org.ldk.structs.ChannelUpdate msg;
761                 private BroadcastChannelUpdate(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelUpdate obj) {
762                         super(null, ptr);
763                         long msg = obj.msg;
764                         org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); }
765                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
766                         this.msg = msg_hu_conv;
767                 }
768         }
769         /**
770          * Used to indicate that a node_announcement should be broadcast to all peers.
771          */
772         public final static class BroadcastNodeAnnouncement extends MessageSendEvent {
773                 /**
774                  * The node_announcement which should be sent.
775                 */
776                 public final org.ldk.structs.NodeAnnouncement msg;
777                 private BroadcastNodeAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement obj) {
778                         super(null, ptr);
779                         long msg = obj.msg;
780                         org.ldk.structs.NodeAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.NodeAnnouncement(null, msg); }
781                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
782                         this.msg = msg_hu_conv;
783                 }
784         }
785         /**
786          * Used to indicate that a channel_update should be sent to a single peer.
787          * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
788          * private channel and we shouldn't be informing all of our peers of channel parameters.
789          */
790         public final static class SendChannelUpdate extends MessageSendEvent {
791                 /**
792                  * The node_id of the node which should receive this message
793                 */
794                 public final byte[] node_id;
795                 /**
796                  * The channel_update which should be sent.
797                 */
798                 public final org.ldk.structs.ChannelUpdate msg;
799                 private SendChannelUpdate(long ptr, bindings.LDKMessageSendEvent.SendChannelUpdate obj) {
800                         super(null, ptr);
801                         this.node_id = obj.node_id;
802                         long msg = obj.msg;
803                         org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); }
804                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
805                         this.msg = msg_hu_conv;
806                 }
807         }
808         /**
809          * Broadcast an error downstream to be handled
810          */
811         public final static class HandleError extends MessageSendEvent {
812                 /**
813                  * The node_id of the node which should receive this message
814                 */
815                 public final byte[] node_id;
816                 /**
817                  * The action which should be taken.
818                 */
819                 public final org.ldk.structs.ErrorAction action;
820                 private HandleError(long ptr, bindings.LDKMessageSendEvent.HandleError obj) {
821                         super(null, ptr);
822                         this.node_id = obj.node_id;
823                         long action = obj.action;
824                         org.ldk.structs.ErrorAction action_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(action);
825                         if (action_hu_conv != null) { action_hu_conv.ptrs_to.add(this); };
826                         this.action = action_hu_conv;
827                 }
828         }
829         /**
830          * Query a peer for channels with funding transaction UTXOs in a block range.
831          */
832         public final static class SendChannelRangeQuery extends MessageSendEvent {
833                 /**
834                  * The node_id of this message recipient
835                 */
836                 public final byte[] node_id;
837                 /**
838                  * The query_channel_range which should be sent.
839                 */
840                 public final org.ldk.structs.QueryChannelRange msg;
841                 private SendChannelRangeQuery(long ptr, bindings.LDKMessageSendEvent.SendChannelRangeQuery obj) {
842                         super(null, ptr);
843                         this.node_id = obj.node_id;
844                         long msg = obj.msg;
845                         org.ldk.structs.QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryChannelRange(null, msg); }
846                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
847                         this.msg = msg_hu_conv;
848                 }
849         }
850         /**
851          * Request routing gossip messages from a peer for a list of channels identified by
852          * their short_channel_ids.
853          */
854         public final static class SendShortIdsQuery extends MessageSendEvent {
855                 /**
856                  * The node_id of this message recipient
857                 */
858                 public final byte[] node_id;
859                 /**
860                  * The query_short_channel_ids which should be sent.
861                 */
862                 public final org.ldk.structs.QueryShortChannelIds msg;
863                 private SendShortIdsQuery(long ptr, bindings.LDKMessageSendEvent.SendShortIdsQuery obj) {
864                         super(null, ptr);
865                         this.node_id = obj.node_id;
866                         long msg = obj.msg;
867                         org.ldk.structs.QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, msg); }
868                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
869                         this.msg = msg_hu_conv;
870                 }
871         }
872         /**
873          * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
874          * emitted during processing of the query.
875          */
876         public final static class SendReplyChannelRange extends MessageSendEvent {
877                 /**
878                  * The node_id of this message recipient
879                 */
880                 public final byte[] node_id;
881                 /**
882                  * The reply_channel_range which should be sent.
883                 */
884                 public final org.ldk.structs.ReplyChannelRange msg;
885                 private SendReplyChannelRange(long ptr, bindings.LDKMessageSendEvent.SendReplyChannelRange obj) {
886                         super(null, ptr);
887                         this.node_id = obj.node_id;
888                         long msg = obj.msg;
889                         org.ldk.structs.ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ReplyChannelRange(null, msg); }
890                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
891                         this.msg = msg_hu_conv;
892                 }
893         }
894         /**
895          * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
896          * enable receiving gossip messages from the peer.
897          */
898         public final static class SendGossipTimestampFilter extends MessageSendEvent {
899                 /**
900                  * The node_id of this message recipient
901                 */
902                 public final byte[] node_id;
903                 /**
904                  * The gossip_timestamp_filter which should be sent.
905                 */
906                 public final org.ldk.structs.GossipTimestampFilter msg;
907                 private SendGossipTimestampFilter(long ptr, bindings.LDKMessageSendEvent.SendGossipTimestampFilter obj) {
908                         super(null, ptr);
909                         this.node_id = obj.node_id;
910                         long msg = obj.msg;
911                         org.ldk.structs.GossipTimestampFilter msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.GossipTimestampFilter(null, msg); }
912                         if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
913                         this.msg = msg_hu_conv;
914                 }
915         }
916         long clone_ptr() {
917                 long ret = bindings.MessageSendEvent_clone_ptr(this.ptr);
918                 Reference.reachabilityFence(this);
919                 return ret;
920         }
921
922         /**
923          * Creates a copy of the MessageSendEvent
924          */
925         public MessageSendEvent clone() {
926                 long ret = bindings.MessageSendEvent_clone(this.ptr);
927                 Reference.reachabilityFence(this);
928                 if (ret >= 0 && ret <= 4096) { return null; }
929                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
930                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
931                 return ret_hu_conv;
932         }
933
934         /**
935          * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
936          */
937         public static MessageSendEvent send_accept_channel(byte[] node_id, org.ldk.structs.AcceptChannel msg) {
938                 long ret = bindings.MessageSendEvent_send_accept_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
939                 Reference.reachabilityFence(node_id);
940                 Reference.reachabilityFence(msg);
941                 if (ret >= 0 && ret <= 4096) { return null; }
942                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
943                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
944                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
945                 return ret_hu_conv;
946         }
947
948         /**
949          * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
950          */
951         public static MessageSendEvent send_accept_channel_v2(byte[] node_id, org.ldk.structs.AcceptChannelV2 msg) {
952                 long ret = bindings.MessageSendEvent_send_accept_channel_v2(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
953                 Reference.reachabilityFence(node_id);
954                 Reference.reachabilityFence(msg);
955                 if (ret >= 0 && ret <= 4096) { return null; }
956                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
957                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
958                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
959                 return ret_hu_conv;
960         }
961
962         /**
963          * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
964          */
965         public static MessageSendEvent send_open_channel(byte[] node_id, org.ldk.structs.OpenChannel msg) {
966                 long ret = bindings.MessageSendEvent_send_open_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
967                 Reference.reachabilityFence(node_id);
968                 Reference.reachabilityFence(msg);
969                 if (ret >= 0 && ret <= 4096) { return null; }
970                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
971                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
972                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
973                 return ret_hu_conv;
974         }
975
976         /**
977          * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
978          */
979         public static MessageSendEvent send_open_channel_v2(byte[] node_id, org.ldk.structs.OpenChannelV2 msg) {
980                 long ret = bindings.MessageSendEvent_send_open_channel_v2(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
981                 Reference.reachabilityFence(node_id);
982                 Reference.reachabilityFence(msg);
983                 if (ret >= 0 && ret <= 4096) { return null; }
984                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
985                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
986                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
987                 return ret_hu_conv;
988         }
989
990         /**
991          * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
992          */
993         public static MessageSendEvent send_funding_created(byte[] node_id, org.ldk.structs.FundingCreated msg) {
994                 long ret = bindings.MessageSendEvent_send_funding_created(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
995                 Reference.reachabilityFence(node_id);
996                 Reference.reachabilityFence(msg);
997                 if (ret >= 0 && ret <= 4096) { return null; }
998                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
999                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1000                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1001                 return ret_hu_conv;
1002         }
1003
1004         /**
1005          * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
1006          */
1007         public static MessageSendEvent send_funding_signed(byte[] node_id, org.ldk.structs.FundingSigned msg) {
1008                 long ret = bindings.MessageSendEvent_send_funding_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1009                 Reference.reachabilityFence(node_id);
1010                 Reference.reachabilityFence(msg);
1011                 if (ret >= 0 && ret <= 4096) { return null; }
1012                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1013                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1014                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1015                 return ret_hu_conv;
1016         }
1017
1018         /**
1019          * Utility method to constructs a new SendStfu-variant MessageSendEvent
1020          */
1021         public static MessageSendEvent send_stfu(byte[] node_id, org.ldk.structs.Stfu msg) {
1022                 long ret = bindings.MessageSendEvent_send_stfu(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1023                 Reference.reachabilityFence(node_id);
1024                 Reference.reachabilityFence(msg);
1025                 if (ret >= 0 && ret <= 4096) { return null; }
1026                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1027                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1028                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1029                 return ret_hu_conv;
1030         }
1031
1032         /**
1033          * Utility method to constructs a new SendSplice-variant MessageSendEvent
1034          */
1035         public static MessageSendEvent send_splice(byte[] node_id, org.ldk.structs.Splice msg) {
1036                 long ret = bindings.MessageSendEvent_send_splice(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1037                 Reference.reachabilityFence(node_id);
1038                 Reference.reachabilityFence(msg);
1039                 if (ret >= 0 && ret <= 4096) { return null; }
1040                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1041                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1042                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1043                 return ret_hu_conv;
1044         }
1045
1046         /**
1047          * Utility method to constructs a new SendSpliceAck-variant MessageSendEvent
1048          */
1049         public static MessageSendEvent send_splice_ack(byte[] node_id, org.ldk.structs.SpliceAck msg) {
1050                 long ret = bindings.MessageSendEvent_send_splice_ack(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1051                 Reference.reachabilityFence(node_id);
1052                 Reference.reachabilityFence(msg);
1053                 if (ret >= 0 && ret <= 4096) { return null; }
1054                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1055                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1056                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1057                 return ret_hu_conv;
1058         }
1059
1060         /**
1061          * Utility method to constructs a new SendSpliceLocked-variant MessageSendEvent
1062          */
1063         public static MessageSendEvent send_splice_locked(byte[] node_id, org.ldk.structs.SpliceLocked msg) {
1064                 long ret = bindings.MessageSendEvent_send_splice_locked(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1065                 Reference.reachabilityFence(node_id);
1066                 Reference.reachabilityFence(msg);
1067                 if (ret >= 0 && ret <= 4096) { return null; }
1068                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1069                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1070                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1071                 return ret_hu_conv;
1072         }
1073
1074         /**
1075          * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
1076          */
1077         public static MessageSendEvent send_tx_add_input(byte[] node_id, org.ldk.structs.TxAddInput msg) {
1078                 long ret = bindings.MessageSendEvent_send_tx_add_input(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1079                 Reference.reachabilityFence(node_id);
1080                 Reference.reachabilityFence(msg);
1081                 if (ret >= 0 && ret <= 4096) { return null; }
1082                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1083                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1084                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1085                 return ret_hu_conv;
1086         }
1087
1088         /**
1089          * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
1090          */
1091         public static MessageSendEvent send_tx_add_output(byte[] node_id, org.ldk.structs.TxAddOutput msg) {
1092                 long ret = bindings.MessageSendEvent_send_tx_add_output(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1093                 Reference.reachabilityFence(node_id);
1094                 Reference.reachabilityFence(msg);
1095                 if (ret >= 0 && ret <= 4096) { return null; }
1096                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1097                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1098                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1099                 return ret_hu_conv;
1100         }
1101
1102         /**
1103          * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
1104          */
1105         public static MessageSendEvent send_tx_remove_input(byte[] node_id, org.ldk.structs.TxRemoveInput msg) {
1106                 long ret = bindings.MessageSendEvent_send_tx_remove_input(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1107                 Reference.reachabilityFence(node_id);
1108                 Reference.reachabilityFence(msg);
1109                 if (ret >= 0 && ret <= 4096) { return null; }
1110                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1111                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1112                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1113                 return ret_hu_conv;
1114         }
1115
1116         /**
1117          * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
1118          */
1119         public static MessageSendEvent send_tx_remove_output(byte[] node_id, org.ldk.structs.TxRemoveOutput msg) {
1120                 long ret = bindings.MessageSendEvent_send_tx_remove_output(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1121                 Reference.reachabilityFence(node_id);
1122                 Reference.reachabilityFence(msg);
1123                 if (ret >= 0 && ret <= 4096) { return null; }
1124                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1125                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1126                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1127                 return ret_hu_conv;
1128         }
1129
1130         /**
1131          * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
1132          */
1133         public static MessageSendEvent send_tx_complete(byte[] node_id, org.ldk.structs.TxComplete msg) {
1134                 long ret = bindings.MessageSendEvent_send_tx_complete(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1135                 Reference.reachabilityFence(node_id);
1136                 Reference.reachabilityFence(msg);
1137                 if (ret >= 0 && ret <= 4096) { return null; }
1138                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1139                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1140                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1141                 return ret_hu_conv;
1142         }
1143
1144         /**
1145          * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent
1146          */
1147         public static MessageSendEvent send_tx_signatures(byte[] node_id, org.ldk.structs.TxSignatures msg) {
1148                 long ret = bindings.MessageSendEvent_send_tx_signatures(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1149                 Reference.reachabilityFence(node_id);
1150                 Reference.reachabilityFence(msg);
1151                 if (ret >= 0 && ret <= 4096) { return null; }
1152                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1153                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1154                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1155                 return ret_hu_conv;
1156         }
1157
1158         /**
1159          * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
1160          */
1161         public static MessageSendEvent send_tx_init_rbf(byte[] node_id, org.ldk.structs.TxInitRbf msg) {
1162                 long ret = bindings.MessageSendEvent_send_tx_init_rbf(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1163                 Reference.reachabilityFence(node_id);
1164                 Reference.reachabilityFence(msg);
1165                 if (ret >= 0 && ret <= 4096) { return null; }
1166                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1167                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1168                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1169                 return ret_hu_conv;
1170         }
1171
1172         /**
1173          * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
1174          */
1175         public static MessageSendEvent send_tx_ack_rbf(byte[] node_id, org.ldk.structs.TxAckRbf msg) {
1176                 long ret = bindings.MessageSendEvent_send_tx_ack_rbf(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1177                 Reference.reachabilityFence(node_id);
1178                 Reference.reachabilityFence(msg);
1179                 if (ret >= 0 && ret <= 4096) { return null; }
1180                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1181                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1182                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1183                 return ret_hu_conv;
1184         }
1185
1186         /**
1187          * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
1188          */
1189         public static MessageSendEvent send_tx_abort(byte[] node_id, org.ldk.structs.TxAbort msg) {
1190                 long ret = bindings.MessageSendEvent_send_tx_abort(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1191                 Reference.reachabilityFence(node_id);
1192                 Reference.reachabilityFence(msg);
1193                 if (ret >= 0 && ret <= 4096) { return null; }
1194                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1195                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1196                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1197                 return ret_hu_conv;
1198         }
1199
1200         /**
1201          * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
1202          */
1203         public static MessageSendEvent send_channel_ready(byte[] node_id, org.ldk.structs.ChannelReady msg) {
1204                 long ret = bindings.MessageSendEvent_send_channel_ready(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1205                 Reference.reachabilityFence(node_id);
1206                 Reference.reachabilityFence(msg);
1207                 if (ret >= 0 && ret <= 4096) { return null; }
1208                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1209                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1210                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1211                 return ret_hu_conv;
1212         }
1213
1214         /**
1215          * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
1216          */
1217         public static MessageSendEvent send_announcement_signatures(byte[] node_id, org.ldk.structs.AnnouncementSignatures msg) {
1218                 long ret = bindings.MessageSendEvent_send_announcement_signatures(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1219                 Reference.reachabilityFence(node_id);
1220                 Reference.reachabilityFence(msg);
1221                 if (ret >= 0 && ret <= 4096) { return null; }
1222                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1223                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1224                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1225                 return ret_hu_conv;
1226         }
1227
1228         /**
1229          * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
1230          */
1231         public static MessageSendEvent update_htlcs(byte[] node_id, org.ldk.structs.CommitmentUpdate updates) {
1232                 long ret = bindings.MessageSendEvent_update_htlcs(InternalUtils.check_arr_len(node_id, 33), updates == null ? 0 : updates.ptr);
1233                 Reference.reachabilityFence(node_id);
1234                 Reference.reachabilityFence(updates);
1235                 if (ret >= 0 && ret <= 4096) { return null; }
1236                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1237                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1238                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(updates); };
1239                 return ret_hu_conv;
1240         }
1241
1242         /**
1243          * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
1244          */
1245         public static MessageSendEvent send_revoke_and_ack(byte[] node_id, org.ldk.structs.RevokeAndACK msg) {
1246                 long ret = bindings.MessageSendEvent_send_revoke_and_ack(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1247                 Reference.reachabilityFence(node_id);
1248                 Reference.reachabilityFence(msg);
1249                 if (ret >= 0 && ret <= 4096) { return null; }
1250                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1251                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1252                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1253                 return ret_hu_conv;
1254         }
1255
1256         /**
1257          * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
1258          */
1259         public static MessageSendEvent send_closing_signed(byte[] node_id, org.ldk.structs.ClosingSigned msg) {
1260                 long ret = bindings.MessageSendEvent_send_closing_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1261                 Reference.reachabilityFence(node_id);
1262                 Reference.reachabilityFence(msg);
1263                 if (ret >= 0 && ret <= 4096) { return null; }
1264                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1265                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1266                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1267                 return ret_hu_conv;
1268         }
1269
1270         /**
1271          * Utility method to constructs a new SendShutdown-variant MessageSendEvent
1272          */
1273         public static MessageSendEvent send_shutdown(byte[] node_id, org.ldk.structs.Shutdown msg) {
1274                 long ret = bindings.MessageSendEvent_send_shutdown(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1275                 Reference.reachabilityFence(node_id);
1276                 Reference.reachabilityFence(msg);
1277                 if (ret >= 0 && ret <= 4096) { return null; }
1278                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1279                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1280                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1281                 return ret_hu_conv;
1282         }
1283
1284         /**
1285          * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
1286          */
1287         public static MessageSendEvent send_channel_reestablish(byte[] node_id, org.ldk.structs.ChannelReestablish msg) {
1288                 long ret = bindings.MessageSendEvent_send_channel_reestablish(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1289                 Reference.reachabilityFence(node_id);
1290                 Reference.reachabilityFence(msg);
1291                 if (ret >= 0 && ret <= 4096) { return null; }
1292                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1293                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1294                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1295                 return ret_hu_conv;
1296         }
1297
1298         /**
1299          * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
1300          */
1301         public static MessageSendEvent send_channel_announcement(byte[] node_id, org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) {
1302                 long ret = bindings.MessageSendEvent_send_channel_announcement(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr, update_msg == null ? 0 : update_msg.ptr);
1303                 Reference.reachabilityFence(node_id);
1304                 Reference.reachabilityFence(msg);
1305                 Reference.reachabilityFence(update_msg);
1306                 if (ret >= 0 && ret <= 4096) { return null; }
1307                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1308                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1309                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1310                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(update_msg); };
1311                 return ret_hu_conv;
1312         }
1313
1314         /**
1315          * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
1316          */
1317         public static MessageSendEvent broadcast_channel_announcement(org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) {
1318                 long ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : msg.ptr, update_msg == null ? 0 : update_msg.ptr);
1319                 Reference.reachabilityFence(msg);
1320                 Reference.reachabilityFence(update_msg);
1321                 if (ret >= 0 && ret <= 4096) { return null; }
1322                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1323                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1324                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1325                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(update_msg); };
1326                 return ret_hu_conv;
1327         }
1328
1329         /**
1330          * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
1331          */
1332         public static MessageSendEvent broadcast_channel_update(org.ldk.structs.ChannelUpdate msg) {
1333                 long ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr);
1334                 Reference.reachabilityFence(msg);
1335                 if (ret >= 0 && ret <= 4096) { return null; }
1336                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1337                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1338                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1339                 return ret_hu_conv;
1340         }
1341
1342         /**
1343          * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
1344          */
1345         public static MessageSendEvent broadcast_node_announcement(org.ldk.structs.NodeAnnouncement msg) {
1346                 long ret = bindings.MessageSendEvent_broadcast_node_announcement(msg == null ? 0 : msg.ptr);
1347                 Reference.reachabilityFence(msg);
1348                 if (ret >= 0 && ret <= 4096) { return null; }
1349                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1350                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1351                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1352                 return ret_hu_conv;
1353         }
1354
1355         /**
1356          * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
1357          */
1358         public static MessageSendEvent send_channel_update(byte[] node_id, org.ldk.structs.ChannelUpdate msg) {
1359                 long ret = bindings.MessageSendEvent_send_channel_update(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1360                 Reference.reachabilityFence(node_id);
1361                 Reference.reachabilityFence(msg);
1362                 if (ret >= 0 && ret <= 4096) { return null; }
1363                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1364                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1365                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1366                 return ret_hu_conv;
1367         }
1368
1369         /**
1370          * Utility method to constructs a new HandleError-variant MessageSendEvent
1371          */
1372         public static MessageSendEvent handle_error(byte[] node_id, org.ldk.structs.ErrorAction action) {
1373                 long ret = bindings.MessageSendEvent_handle_error(InternalUtils.check_arr_len(node_id, 33), action.ptr);
1374                 Reference.reachabilityFence(node_id);
1375                 Reference.reachabilityFence(action);
1376                 if (ret >= 0 && ret <= 4096) { return null; }
1377                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1378                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1379                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(action); };
1380                 return ret_hu_conv;
1381         }
1382
1383         /**
1384          * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
1385          */
1386         public static MessageSendEvent send_channel_range_query(byte[] node_id, org.ldk.structs.QueryChannelRange msg) {
1387                 long ret = bindings.MessageSendEvent_send_channel_range_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1388                 Reference.reachabilityFence(node_id);
1389                 Reference.reachabilityFence(msg);
1390                 if (ret >= 0 && ret <= 4096) { return null; }
1391                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1392                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1393                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1394                 return ret_hu_conv;
1395         }
1396
1397         /**
1398          * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
1399          */
1400         public static MessageSendEvent send_short_ids_query(byte[] node_id, org.ldk.structs.QueryShortChannelIds msg) {
1401                 long ret = bindings.MessageSendEvent_send_short_ids_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1402                 Reference.reachabilityFence(node_id);
1403                 Reference.reachabilityFence(msg);
1404                 if (ret >= 0 && ret <= 4096) { return null; }
1405                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1406                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1407                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1408                 return ret_hu_conv;
1409         }
1410
1411         /**
1412          * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
1413          */
1414         public static MessageSendEvent send_reply_channel_range(byte[] node_id, org.ldk.structs.ReplyChannelRange msg) {
1415                 long ret = bindings.MessageSendEvent_send_reply_channel_range(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1416                 Reference.reachabilityFence(node_id);
1417                 Reference.reachabilityFence(msg);
1418                 if (ret >= 0 && ret <= 4096) { return null; }
1419                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1420                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1421                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1422                 return ret_hu_conv;
1423         }
1424
1425         /**
1426          * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
1427          */
1428         public static MessageSendEvent send_gossip_timestamp_filter(byte[] node_id, org.ldk.structs.GossipTimestampFilter msg) {
1429                 long ret = bindings.MessageSendEvent_send_gossip_timestamp_filter(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1430                 Reference.reachabilityFence(node_id);
1431                 Reference.reachabilityFence(msg);
1432                 if (ret >= 0 && ret <= 4096) { return null; }
1433                 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1434                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1435                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1436                 return ret_hu_conv;
1437         }
1438
1439 }