1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
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.
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 {
22 if (ptr != 0) { bindings.MessageSendEvent_free(ptr); }
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);
29 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendAcceptChannelV2.class) {
30 return new SendAcceptChannelV2(ptr, (bindings.LDKMessageSendEvent.SendAcceptChannelV2)raw_val);
32 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendOpenChannel.class) {
33 return new SendOpenChannel(ptr, (bindings.LDKMessageSendEvent.SendOpenChannel)raw_val);
35 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendOpenChannelV2.class) {
36 return new SendOpenChannelV2(ptr, (bindings.LDKMessageSendEvent.SendOpenChannelV2)raw_val);
38 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendFundingCreated.class) {
39 return new SendFundingCreated(ptr, (bindings.LDKMessageSendEvent.SendFundingCreated)raw_val);
41 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendFundingSigned.class) {
42 return new SendFundingSigned(ptr, (bindings.LDKMessageSendEvent.SendFundingSigned)raw_val);
44 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxAddInput.class) {
45 return new SendTxAddInput(ptr, (bindings.LDKMessageSendEvent.SendTxAddInput)raw_val);
47 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxAddOutput.class) {
48 return new SendTxAddOutput(ptr, (bindings.LDKMessageSendEvent.SendTxAddOutput)raw_val);
50 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxRemoveInput.class) {
51 return new SendTxRemoveInput(ptr, (bindings.LDKMessageSendEvent.SendTxRemoveInput)raw_val);
53 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxRemoveOutput.class) {
54 return new SendTxRemoveOutput(ptr, (bindings.LDKMessageSendEvent.SendTxRemoveOutput)raw_val);
56 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxComplete.class) {
57 return new SendTxComplete(ptr, (bindings.LDKMessageSendEvent.SendTxComplete)raw_val);
59 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxSignatures.class) {
60 return new SendTxSignatures(ptr, (bindings.LDKMessageSendEvent.SendTxSignatures)raw_val);
62 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxInitRbf.class) {
63 return new SendTxInitRbf(ptr, (bindings.LDKMessageSendEvent.SendTxInitRbf)raw_val);
65 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxAckRbf.class) {
66 return new SendTxAckRbf(ptr, (bindings.LDKMessageSendEvent.SendTxAckRbf)raw_val);
68 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxAbort.class) {
69 return new SendTxAbort(ptr, (bindings.LDKMessageSendEvent.SendTxAbort)raw_val);
71 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelReady.class) {
72 return new SendChannelReady(ptr, (bindings.LDKMessageSendEvent.SendChannelReady)raw_val);
74 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendAnnouncementSignatures.class) {
75 return new SendAnnouncementSignatures(ptr, (bindings.LDKMessageSendEvent.SendAnnouncementSignatures)raw_val);
77 if (raw_val.getClass() == bindings.LDKMessageSendEvent.UpdateHTLCs.class) {
78 return new UpdateHTLCs(ptr, (bindings.LDKMessageSendEvent.UpdateHTLCs)raw_val);
80 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendRevokeAndACK.class) {
81 return new SendRevokeAndACK(ptr, (bindings.LDKMessageSendEvent.SendRevokeAndACK)raw_val);
83 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendClosingSigned.class) {
84 return new SendClosingSigned(ptr, (bindings.LDKMessageSendEvent.SendClosingSigned)raw_val);
86 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendShutdown.class) {
87 return new SendShutdown(ptr, (bindings.LDKMessageSendEvent.SendShutdown)raw_val);
89 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelReestablish.class) {
90 return new SendChannelReestablish(ptr, (bindings.LDKMessageSendEvent.SendChannelReestablish)raw_val);
92 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelAnnouncement.class) {
93 return new SendChannelAnnouncement(ptr, (bindings.LDKMessageSendEvent.SendChannelAnnouncement)raw_val);
95 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement.class) {
96 return new BroadcastChannelAnnouncement(ptr, (bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement)raw_val);
98 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastChannelUpdate.class) {
99 return new BroadcastChannelUpdate(ptr, (bindings.LDKMessageSendEvent.BroadcastChannelUpdate)raw_val);
101 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement.class) {
102 return new BroadcastNodeAnnouncement(ptr, (bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement)raw_val);
104 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelUpdate.class) {
105 return new SendChannelUpdate(ptr, (bindings.LDKMessageSendEvent.SendChannelUpdate)raw_val);
107 if (raw_val.getClass() == bindings.LDKMessageSendEvent.HandleError.class) {
108 return new HandleError(ptr, (bindings.LDKMessageSendEvent.HandleError)raw_val);
110 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelRangeQuery.class) {
111 return new SendChannelRangeQuery(ptr, (bindings.LDKMessageSendEvent.SendChannelRangeQuery)raw_val);
113 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendShortIdsQuery.class) {
114 return new SendShortIdsQuery(ptr, (bindings.LDKMessageSendEvent.SendShortIdsQuery)raw_val);
116 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendReplyChannelRange.class) {
117 return new SendReplyChannelRange(ptr, (bindings.LDKMessageSendEvent.SendReplyChannelRange)raw_val);
119 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendGossipTimestampFilter.class) {
120 return new SendGossipTimestampFilter(ptr, (bindings.LDKMessageSendEvent.SendGossipTimestampFilter)raw_val);
122 assert false; return null; // Unreachable without extending the (internal) bindings interface
126 * Used to indicate that we've accepted a channel open and should send the accept_channel
127 * message provided to the given peer.
129 public final static class SendAcceptChannel extends MessageSendEvent {
131 * The node_id of the node which should receive this message
133 public final byte[] node_id;
135 * The message which should be sent.
137 public final org.ldk.structs.AcceptChannel msg;
138 private SendAcceptChannel(long ptr, bindings.LDKMessageSendEvent.SendAcceptChannel obj) {
140 this.node_id = obj.node_id;
142 org.ldk.structs.AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannel(null, msg); }
143 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
144 this.msg = msg_hu_conv;
148 * Used to indicate that we've accepted a V2 channel open and should send the accept_channel2
149 * message provided to the given peer.
151 public final static class SendAcceptChannelV2 extends MessageSendEvent {
153 * The node_id of the node which should receive this message
155 public final byte[] node_id;
157 * The message which should be sent.
159 public final org.ldk.structs.AcceptChannelV2 msg;
160 private SendAcceptChannelV2(long ptr, bindings.LDKMessageSendEvent.SendAcceptChannelV2 obj) {
162 this.node_id = obj.node_id;
164 org.ldk.structs.AcceptChannelV2 msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannelV2(null, msg); }
165 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
166 this.msg = msg_hu_conv;
170 * Used to indicate that we've initiated a channel open and should send the open_channel
171 * message provided to the given peer.
173 public final static class SendOpenChannel extends MessageSendEvent {
175 * The node_id of the node which should receive this message
177 public final byte[] node_id;
179 * The message which should be sent.
181 public final org.ldk.structs.OpenChannel msg;
182 private SendOpenChannel(long ptr, bindings.LDKMessageSendEvent.SendOpenChannel obj) {
184 this.node_id = obj.node_id;
186 org.ldk.structs.OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannel(null, msg); }
187 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
188 this.msg = msg_hu_conv;
192 * Used to indicate that we've initiated a V2 channel open and should send the open_channel2
193 * message provided to the given peer.
195 public final static class SendOpenChannelV2 extends MessageSendEvent {
197 * The node_id of the node which should receive this message
199 public final byte[] node_id;
201 * The message which should be sent.
203 public final org.ldk.structs.OpenChannelV2 msg;
204 private SendOpenChannelV2(long ptr, bindings.LDKMessageSendEvent.SendOpenChannelV2 obj) {
206 this.node_id = obj.node_id;
208 org.ldk.structs.OpenChannelV2 msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannelV2(null, msg); }
209 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
210 this.msg = msg_hu_conv;
214 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
216 public final static class SendFundingCreated extends MessageSendEvent {
218 * The node_id of the node which should receive this message
220 public final byte[] node_id;
222 * The message which should be sent.
224 public final org.ldk.structs.FundingCreated msg;
225 private SendFundingCreated(long ptr, bindings.LDKMessageSendEvent.SendFundingCreated obj) {
227 this.node_id = obj.node_id;
229 org.ldk.structs.FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingCreated(null, msg); }
230 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
231 this.msg = msg_hu_conv;
235 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
237 public final static class SendFundingSigned extends MessageSendEvent {
239 * The node_id of the node which should receive this message
241 public final byte[] node_id;
243 * The message which should be sent.
245 public final org.ldk.structs.FundingSigned msg;
246 private SendFundingSigned(long ptr, bindings.LDKMessageSendEvent.SendFundingSigned obj) {
248 this.node_id = obj.node_id;
250 org.ldk.structs.FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingSigned(null, msg); }
251 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
252 this.msg = msg_hu_conv;
256 * Used to indicate that a tx_add_input message should be sent to the peer with the given node_id.
258 public final static class SendTxAddInput extends MessageSendEvent {
260 * The node_id of the node which should receive this message
262 public final byte[] node_id;
264 * The message which should be sent.
266 public final org.ldk.structs.TxAddInput msg;
267 private SendTxAddInput(long ptr, bindings.LDKMessageSendEvent.SendTxAddInput obj) {
269 this.node_id = obj.node_id;
271 org.ldk.structs.TxAddInput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAddInput(null, msg); }
272 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
273 this.msg = msg_hu_conv;
277 * Used to indicate that a tx_add_output message should be sent to the peer with the given node_id.
279 public final static class SendTxAddOutput extends MessageSendEvent {
281 * The node_id of the node which should receive this message
283 public final byte[] node_id;
285 * The message which should be sent.
287 public final org.ldk.structs.TxAddOutput msg;
288 private SendTxAddOutput(long ptr, bindings.LDKMessageSendEvent.SendTxAddOutput obj) {
290 this.node_id = obj.node_id;
292 org.ldk.structs.TxAddOutput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAddOutput(null, msg); }
293 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
294 this.msg = msg_hu_conv;
298 * Used to indicate that a tx_remove_input message should be sent to the peer with the given node_id.
300 public final static class SendTxRemoveInput extends MessageSendEvent {
302 * The node_id of the node which should receive this message
304 public final byte[] node_id;
306 * The message which should be sent.
308 public final org.ldk.structs.TxRemoveInput msg;
309 private SendTxRemoveInput(long ptr, bindings.LDKMessageSendEvent.SendTxRemoveInput obj) {
311 this.node_id = obj.node_id;
313 org.ldk.structs.TxRemoveInput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxRemoveInput(null, msg); }
314 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
315 this.msg = msg_hu_conv;
319 * Used to indicate that a tx_remove_output message should be sent to the peer with the given node_id.
321 public final static class SendTxRemoveOutput extends MessageSendEvent {
323 * The node_id of the node which should receive this message
325 public final byte[] node_id;
327 * The message which should be sent.
329 public final org.ldk.structs.TxRemoveOutput msg;
330 private SendTxRemoveOutput(long ptr, bindings.LDKMessageSendEvent.SendTxRemoveOutput obj) {
332 this.node_id = obj.node_id;
334 org.ldk.structs.TxRemoveOutput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxRemoveOutput(null, msg); }
335 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
336 this.msg = msg_hu_conv;
340 * Used to indicate that a tx_complete message should be sent to the peer with the given node_id.
342 public final static class SendTxComplete extends MessageSendEvent {
344 * The node_id of the node which should receive this message
346 public final byte[] node_id;
348 * The message which should be sent.
350 public final org.ldk.structs.TxComplete msg;
351 private SendTxComplete(long ptr, bindings.LDKMessageSendEvent.SendTxComplete obj) {
353 this.node_id = obj.node_id;
355 org.ldk.structs.TxComplete msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxComplete(null, msg); }
356 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
357 this.msg = msg_hu_conv;
361 * Used to indicate that a tx_signatures message should be sent to the peer with the given node_id.
363 public final static class SendTxSignatures extends MessageSendEvent {
365 * The node_id of the node which should receive this message
367 public final byte[] node_id;
369 * The message which should be sent.
371 public final org.ldk.structs.TxSignatures msg;
372 private SendTxSignatures(long ptr, bindings.LDKMessageSendEvent.SendTxSignatures obj) {
374 this.node_id = obj.node_id;
376 org.ldk.structs.TxSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxSignatures(null, msg); }
377 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
378 this.msg = msg_hu_conv;
382 * Used to indicate that a tx_init_rbf message should be sent to the peer with the given node_id.
384 public final static class SendTxInitRbf extends MessageSendEvent {
386 * The node_id of the node which should receive this message
388 public final byte[] node_id;
390 * The message which should be sent.
392 public final org.ldk.structs.TxInitRbf msg;
393 private SendTxInitRbf(long ptr, bindings.LDKMessageSendEvent.SendTxInitRbf obj) {
395 this.node_id = obj.node_id;
397 org.ldk.structs.TxInitRbf msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxInitRbf(null, msg); }
398 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
399 this.msg = msg_hu_conv;
403 * Used to indicate that a tx_ack_rbf message should be sent to the peer with the given node_id.
405 public final static class SendTxAckRbf extends MessageSendEvent {
407 * The node_id of the node which should receive this message
409 public final byte[] node_id;
411 * The message which should be sent.
413 public final org.ldk.structs.TxAckRbf msg;
414 private SendTxAckRbf(long ptr, bindings.LDKMessageSendEvent.SendTxAckRbf obj) {
416 this.node_id = obj.node_id;
418 org.ldk.structs.TxAckRbf msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAckRbf(null, msg); }
419 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
420 this.msg = msg_hu_conv;
424 * Used to indicate that a tx_abort message should be sent to the peer with the given node_id.
426 public final static class SendTxAbort extends MessageSendEvent {
428 * The node_id of the node which should receive this message
430 public final byte[] node_id;
432 * The message which should be sent.
434 public final org.ldk.structs.TxAbort msg;
435 private SendTxAbort(long ptr, bindings.LDKMessageSendEvent.SendTxAbort obj) {
437 this.node_id = obj.node_id;
439 org.ldk.structs.TxAbort msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAbort(null, msg); }
440 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
441 this.msg = msg_hu_conv;
445 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
447 public final static class SendChannelReady extends MessageSendEvent {
449 * The node_id of the node which should receive these message(s)
451 public final byte[] node_id;
453 * The channel_ready message which should be sent.
455 public final org.ldk.structs.ChannelReady msg;
456 private SendChannelReady(long ptr, bindings.LDKMessageSendEvent.SendChannelReady obj) {
458 this.node_id = obj.node_id;
460 org.ldk.structs.ChannelReady msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReady(null, msg); }
461 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
462 this.msg = msg_hu_conv;
466 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
468 public final static class SendAnnouncementSignatures extends MessageSendEvent {
470 * The node_id of the node which should receive these message(s)
472 public final byte[] node_id;
474 * The announcement_signatures message which should be sent.
476 public final org.ldk.structs.AnnouncementSignatures msg;
477 private SendAnnouncementSignatures(long ptr, bindings.LDKMessageSendEvent.SendAnnouncementSignatures obj) {
479 this.node_id = obj.node_id;
481 org.ldk.structs.AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, msg); }
482 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
483 this.msg = msg_hu_conv;
487 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
488 * message should be sent to the peer with the given node_id.
490 public final static class UpdateHTLCs extends MessageSendEvent {
492 * The node_id of the node which should receive these message(s)
494 public final byte[] node_id;
496 * The update messages which should be sent. ALL messages in the struct should be sent!
498 public final org.ldk.structs.CommitmentUpdate updates;
499 private UpdateHTLCs(long ptr, bindings.LDKMessageSendEvent.UpdateHTLCs obj) {
501 this.node_id = obj.node_id;
502 long updates = obj.updates;
503 org.ldk.structs.CommitmentUpdate updates_hu_conv = null; if (updates < 0 || updates > 4096) { updates_hu_conv = new org.ldk.structs.CommitmentUpdate(null, updates); }
504 if (updates_hu_conv != null) { updates_hu_conv.ptrs_to.add(this); };
505 this.updates = updates_hu_conv;
509 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
511 public final static class SendRevokeAndACK extends MessageSendEvent {
513 * The node_id of the node which should receive this message
515 public final byte[] node_id;
517 * The message which should be sent.
519 public final org.ldk.structs.RevokeAndACK msg;
520 private SendRevokeAndACK(long ptr, bindings.LDKMessageSendEvent.SendRevokeAndACK obj) {
522 this.node_id = obj.node_id;
524 org.ldk.structs.RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.RevokeAndACK(null, msg); }
525 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
526 this.msg = msg_hu_conv;
530 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
532 public final static class SendClosingSigned extends MessageSendEvent {
534 * The node_id of the node which should receive this message
536 public final byte[] node_id;
538 * The message which should be sent.
540 public final org.ldk.structs.ClosingSigned msg;
541 private SendClosingSigned(long ptr, bindings.LDKMessageSendEvent.SendClosingSigned obj) {
543 this.node_id = obj.node_id;
545 org.ldk.structs.ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ClosingSigned(null, msg); }
546 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
547 this.msg = msg_hu_conv;
551 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
553 public final static class SendShutdown extends MessageSendEvent {
555 * The node_id of the node which should receive this message
557 public final byte[] node_id;
559 * The message which should be sent.
561 public final org.ldk.structs.Shutdown msg;
562 private SendShutdown(long ptr, bindings.LDKMessageSendEvent.SendShutdown obj) {
564 this.node_id = obj.node_id;
566 org.ldk.structs.Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Shutdown(null, msg); }
567 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
568 this.msg = msg_hu_conv;
572 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
574 public final static class SendChannelReestablish extends MessageSendEvent {
576 * The node_id of the node which should receive this message
578 public final byte[] node_id;
580 * The message which should be sent.
582 public final org.ldk.structs.ChannelReestablish msg;
583 private SendChannelReestablish(long ptr, bindings.LDKMessageSendEvent.SendChannelReestablish obj) {
585 this.node_id = obj.node_id;
587 org.ldk.structs.ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReestablish(null, msg); }
588 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
589 this.msg = msg_hu_conv;
593 * Used to send a channel_announcement and channel_update to a specific peer, likely on
594 * initial connection to ensure our peers know about our channels.
596 public final static class SendChannelAnnouncement extends MessageSendEvent {
598 * The node_id of the node which should receive this message
600 public final byte[] node_id;
602 * The channel_announcement which should be sent.
604 public final org.ldk.structs.ChannelAnnouncement msg;
606 * The followup channel_update which should be sent.
608 public final org.ldk.structs.ChannelUpdate update_msg;
609 private SendChannelAnnouncement(long ptr, bindings.LDKMessageSendEvent.SendChannelAnnouncement obj) {
611 this.node_id = obj.node_id;
613 org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); }
614 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
615 this.msg = msg_hu_conv;
616 long update_msg = obj.update_msg;
617 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); }
618 if (update_msg_hu_conv != null) { update_msg_hu_conv.ptrs_to.add(this); };
619 this.update_msg = update_msg_hu_conv;
623 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
624 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
626 * Note that after doing so, you very likely (unless you did so very recently) want to
627 * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
628 * ensures that any nodes which see our channel_announcement also have a relevant
629 * node_announcement, including relevant feature flags which may be important for routing
632 * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
634 public final static class BroadcastChannelAnnouncement extends MessageSendEvent {
636 * The channel_announcement which should be sent.
638 public final org.ldk.structs.ChannelAnnouncement msg;
640 * The followup channel_update which should be sent.
642 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
644 @Nullable public final org.ldk.structs.ChannelUpdate update_msg;
645 private BroadcastChannelAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement obj) {
648 org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); }
649 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
650 this.msg = msg_hu_conv;
651 long update_msg = obj.update_msg;
652 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); }
653 if (update_msg_hu_conv != null) { update_msg_hu_conv.ptrs_to.add(this); };
654 this.update_msg = update_msg_hu_conv;
658 * Used to indicate that a channel_update should be broadcast to all peers.
660 public final static class BroadcastChannelUpdate extends MessageSendEvent {
662 * The channel_update which should be sent.
664 public final org.ldk.structs.ChannelUpdate msg;
665 private BroadcastChannelUpdate(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelUpdate obj) {
668 org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); }
669 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
670 this.msg = msg_hu_conv;
674 * Used to indicate that a node_announcement should be broadcast to all peers.
676 public final static class BroadcastNodeAnnouncement extends MessageSendEvent {
678 * The node_announcement which should be sent.
680 public final org.ldk.structs.NodeAnnouncement msg;
681 private BroadcastNodeAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement obj) {
684 org.ldk.structs.NodeAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.NodeAnnouncement(null, msg); }
685 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
686 this.msg = msg_hu_conv;
690 * Used to indicate that a channel_update should be sent to a single peer.
691 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
692 * private channel and we shouldn't be informing all of our peers of channel parameters.
694 public final static class SendChannelUpdate extends MessageSendEvent {
696 * The node_id of the node which should receive this message
698 public final byte[] node_id;
700 * The channel_update which should be sent.
702 public final org.ldk.structs.ChannelUpdate msg;
703 private SendChannelUpdate(long ptr, bindings.LDKMessageSendEvent.SendChannelUpdate obj) {
705 this.node_id = obj.node_id;
707 org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); }
708 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
709 this.msg = msg_hu_conv;
713 * Broadcast an error downstream to be handled
715 public final static class HandleError extends MessageSendEvent {
717 * The node_id of the node which should receive this message
719 public final byte[] node_id;
721 * The action which should be taken.
723 public final org.ldk.structs.ErrorAction action;
724 private HandleError(long ptr, bindings.LDKMessageSendEvent.HandleError obj) {
726 this.node_id = obj.node_id;
727 long action = obj.action;
728 org.ldk.structs.ErrorAction action_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(action);
729 if (action_hu_conv != null) { action_hu_conv.ptrs_to.add(this); };
730 this.action = action_hu_conv;
734 * Query a peer for channels with funding transaction UTXOs in a block range.
736 public final static class SendChannelRangeQuery extends MessageSendEvent {
738 * The node_id of this message recipient
740 public final byte[] node_id;
742 * The query_channel_range which should be sent.
744 public final org.ldk.structs.QueryChannelRange msg;
745 private SendChannelRangeQuery(long ptr, bindings.LDKMessageSendEvent.SendChannelRangeQuery obj) {
747 this.node_id = obj.node_id;
749 org.ldk.structs.QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryChannelRange(null, msg); }
750 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
751 this.msg = msg_hu_conv;
755 * Request routing gossip messages from a peer for a list of channels identified by
756 * their short_channel_ids.
758 public final static class SendShortIdsQuery extends MessageSendEvent {
760 * The node_id of this message recipient
762 public final byte[] node_id;
764 * The query_short_channel_ids which should be sent.
766 public final org.ldk.structs.QueryShortChannelIds msg;
767 private SendShortIdsQuery(long ptr, bindings.LDKMessageSendEvent.SendShortIdsQuery obj) {
769 this.node_id = obj.node_id;
771 org.ldk.structs.QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, msg); }
772 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
773 this.msg = msg_hu_conv;
777 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
778 * emitted during processing of the query.
780 public final static class SendReplyChannelRange extends MessageSendEvent {
782 * The node_id of this message recipient
784 public final byte[] node_id;
786 * The reply_channel_range which should be sent.
788 public final org.ldk.structs.ReplyChannelRange msg;
789 private SendReplyChannelRange(long ptr, bindings.LDKMessageSendEvent.SendReplyChannelRange obj) {
791 this.node_id = obj.node_id;
793 org.ldk.structs.ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ReplyChannelRange(null, msg); }
794 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
795 this.msg = msg_hu_conv;
799 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
800 * enable receiving gossip messages from the peer.
802 public final static class SendGossipTimestampFilter extends MessageSendEvent {
804 * The node_id of this message recipient
806 public final byte[] node_id;
808 * The gossip_timestamp_filter which should be sent.
810 public final org.ldk.structs.GossipTimestampFilter msg;
811 private SendGossipTimestampFilter(long ptr, bindings.LDKMessageSendEvent.SendGossipTimestampFilter obj) {
813 this.node_id = obj.node_id;
815 org.ldk.structs.GossipTimestampFilter msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.GossipTimestampFilter(null, msg); }
816 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
817 this.msg = msg_hu_conv;
821 long ret = bindings.MessageSendEvent_clone_ptr(this.ptr);
822 Reference.reachabilityFence(this);
827 * Creates a copy of the MessageSendEvent
829 public MessageSendEvent clone() {
830 long ret = bindings.MessageSendEvent_clone(this.ptr);
831 Reference.reachabilityFence(this);
832 if (ret >= 0 && ret <= 4096) { return null; }
833 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
834 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
839 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
841 public static MessageSendEvent send_accept_channel(byte[] node_id, org.ldk.structs.AcceptChannel msg) {
842 long ret = bindings.MessageSendEvent_send_accept_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
843 Reference.reachabilityFence(node_id);
844 Reference.reachabilityFence(msg);
845 if (ret >= 0 && ret <= 4096) { return null; }
846 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
847 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
848 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
853 * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
855 public static MessageSendEvent send_accept_channel_v2(byte[] node_id, org.ldk.structs.AcceptChannelV2 msg) {
856 long ret = bindings.MessageSendEvent_send_accept_channel_v2(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
857 Reference.reachabilityFence(node_id);
858 Reference.reachabilityFence(msg);
859 if (ret >= 0 && ret <= 4096) { return null; }
860 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
861 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
862 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
867 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
869 public static MessageSendEvent send_open_channel(byte[] node_id, org.ldk.structs.OpenChannel msg) {
870 long ret = bindings.MessageSendEvent_send_open_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
871 Reference.reachabilityFence(node_id);
872 Reference.reachabilityFence(msg);
873 if (ret >= 0 && ret <= 4096) { return null; }
874 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
875 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
876 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
881 * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
883 public static MessageSendEvent send_open_channel_v2(byte[] node_id, org.ldk.structs.OpenChannelV2 msg) {
884 long ret = bindings.MessageSendEvent_send_open_channel_v2(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
885 Reference.reachabilityFence(node_id);
886 Reference.reachabilityFence(msg);
887 if (ret >= 0 && ret <= 4096) { return null; }
888 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
889 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
890 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
895 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
897 public static MessageSendEvent send_funding_created(byte[] node_id, org.ldk.structs.FundingCreated msg) {
898 long ret = bindings.MessageSendEvent_send_funding_created(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
899 Reference.reachabilityFence(node_id);
900 Reference.reachabilityFence(msg);
901 if (ret >= 0 && ret <= 4096) { return null; }
902 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
903 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
904 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
909 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
911 public static MessageSendEvent send_funding_signed(byte[] node_id, org.ldk.structs.FundingSigned msg) {
912 long ret = bindings.MessageSendEvent_send_funding_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
913 Reference.reachabilityFence(node_id);
914 Reference.reachabilityFence(msg);
915 if (ret >= 0 && ret <= 4096) { return null; }
916 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
917 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
918 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
923 * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
925 public static MessageSendEvent send_tx_add_input(byte[] node_id, org.ldk.structs.TxAddInput msg) {
926 long ret = bindings.MessageSendEvent_send_tx_add_input(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
927 Reference.reachabilityFence(node_id);
928 Reference.reachabilityFence(msg);
929 if (ret >= 0 && ret <= 4096) { return null; }
930 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
931 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
932 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
937 * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
939 public static MessageSendEvent send_tx_add_output(byte[] node_id, org.ldk.structs.TxAddOutput msg) {
940 long ret = bindings.MessageSendEvent_send_tx_add_output(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
941 Reference.reachabilityFence(node_id);
942 Reference.reachabilityFence(msg);
943 if (ret >= 0 && ret <= 4096) { return null; }
944 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
945 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
946 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
951 * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
953 public static MessageSendEvent send_tx_remove_input(byte[] node_id, org.ldk.structs.TxRemoveInput msg) {
954 long ret = bindings.MessageSendEvent_send_tx_remove_input(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
955 Reference.reachabilityFence(node_id);
956 Reference.reachabilityFence(msg);
957 if (ret >= 0 && ret <= 4096) { return null; }
958 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
959 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
960 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
965 * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
967 public static MessageSendEvent send_tx_remove_output(byte[] node_id, org.ldk.structs.TxRemoveOutput msg) {
968 long ret = bindings.MessageSendEvent_send_tx_remove_output(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
969 Reference.reachabilityFence(node_id);
970 Reference.reachabilityFence(msg);
971 if (ret >= 0 && ret <= 4096) { return null; }
972 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
973 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
974 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
979 * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
981 public static MessageSendEvent send_tx_complete(byte[] node_id, org.ldk.structs.TxComplete msg) {
982 long ret = bindings.MessageSendEvent_send_tx_complete(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
983 Reference.reachabilityFence(node_id);
984 Reference.reachabilityFence(msg);
985 if (ret >= 0 && ret <= 4096) { return null; }
986 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
987 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
988 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
993 * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent
995 public static MessageSendEvent send_tx_signatures(byte[] node_id, org.ldk.structs.TxSignatures msg) {
996 long ret = bindings.MessageSendEvent_send_tx_signatures(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
997 Reference.reachabilityFence(node_id);
998 Reference.reachabilityFence(msg);
999 if (ret >= 0 && ret <= 4096) { return null; }
1000 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1001 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1002 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1007 * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
1009 public static MessageSendEvent send_tx_init_rbf(byte[] node_id, org.ldk.structs.TxInitRbf msg) {
1010 long ret = bindings.MessageSendEvent_send_tx_init_rbf(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1011 Reference.reachabilityFence(node_id);
1012 Reference.reachabilityFence(msg);
1013 if (ret >= 0 && ret <= 4096) { return null; }
1014 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1015 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1016 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1021 * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
1023 public static MessageSendEvent send_tx_ack_rbf(byte[] node_id, org.ldk.structs.TxAckRbf msg) {
1024 long ret = bindings.MessageSendEvent_send_tx_ack_rbf(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1025 Reference.reachabilityFence(node_id);
1026 Reference.reachabilityFence(msg);
1027 if (ret >= 0 && ret <= 4096) { return null; }
1028 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1029 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1030 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1035 * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
1037 public static MessageSendEvent send_tx_abort(byte[] node_id, org.ldk.structs.TxAbort msg) {
1038 long ret = bindings.MessageSendEvent_send_tx_abort(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1039 Reference.reachabilityFence(node_id);
1040 Reference.reachabilityFence(msg);
1041 if (ret >= 0 && ret <= 4096) { return null; }
1042 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1043 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1044 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1049 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
1051 public static MessageSendEvent send_channel_ready(byte[] node_id, org.ldk.structs.ChannelReady msg) {
1052 long ret = bindings.MessageSendEvent_send_channel_ready(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1053 Reference.reachabilityFence(node_id);
1054 Reference.reachabilityFence(msg);
1055 if (ret >= 0 && ret <= 4096) { return null; }
1056 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1057 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1058 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1063 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
1065 public static MessageSendEvent send_announcement_signatures(byte[] node_id, org.ldk.structs.AnnouncementSignatures msg) {
1066 long ret = bindings.MessageSendEvent_send_announcement_signatures(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1067 Reference.reachabilityFence(node_id);
1068 Reference.reachabilityFence(msg);
1069 if (ret >= 0 && ret <= 4096) { return null; }
1070 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1071 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1072 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1077 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
1079 public static MessageSendEvent update_htlcs(byte[] node_id, org.ldk.structs.CommitmentUpdate updates) {
1080 long ret = bindings.MessageSendEvent_update_htlcs(InternalUtils.check_arr_len(node_id, 33), updates == null ? 0 : updates.ptr);
1081 Reference.reachabilityFence(node_id);
1082 Reference.reachabilityFence(updates);
1083 if (ret >= 0 && ret <= 4096) { return null; }
1084 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1085 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1086 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(updates); };
1091 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
1093 public static MessageSendEvent send_revoke_and_ack(byte[] node_id, org.ldk.structs.RevokeAndACK msg) {
1094 long ret = bindings.MessageSendEvent_send_revoke_and_ack(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1095 Reference.reachabilityFence(node_id);
1096 Reference.reachabilityFence(msg);
1097 if (ret >= 0 && ret <= 4096) { return null; }
1098 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1099 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1100 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1105 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
1107 public static MessageSendEvent send_closing_signed(byte[] node_id, org.ldk.structs.ClosingSigned msg) {
1108 long ret = bindings.MessageSendEvent_send_closing_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1109 Reference.reachabilityFence(node_id);
1110 Reference.reachabilityFence(msg);
1111 if (ret >= 0 && ret <= 4096) { return null; }
1112 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1113 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1114 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1119 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
1121 public static MessageSendEvent send_shutdown(byte[] node_id, org.ldk.structs.Shutdown msg) {
1122 long ret = bindings.MessageSendEvent_send_shutdown(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1123 Reference.reachabilityFence(node_id);
1124 Reference.reachabilityFence(msg);
1125 if (ret >= 0 && ret <= 4096) { return null; }
1126 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1127 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1128 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1133 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
1135 public static MessageSendEvent send_channel_reestablish(byte[] node_id, org.ldk.structs.ChannelReestablish msg) {
1136 long ret = bindings.MessageSendEvent_send_channel_reestablish(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1137 Reference.reachabilityFence(node_id);
1138 Reference.reachabilityFence(msg);
1139 if (ret >= 0 && ret <= 4096) { return null; }
1140 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1141 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1142 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1147 * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
1149 public static MessageSendEvent send_channel_announcement(byte[] node_id, org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) {
1150 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);
1151 Reference.reachabilityFence(node_id);
1152 Reference.reachabilityFence(msg);
1153 Reference.reachabilityFence(update_msg);
1154 if (ret >= 0 && ret <= 4096) { return null; }
1155 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1156 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1157 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1158 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(update_msg); };
1163 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
1165 public static MessageSendEvent broadcast_channel_announcement(org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) {
1166 long ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : msg.ptr, update_msg == null ? 0 : update_msg.ptr);
1167 Reference.reachabilityFence(msg);
1168 Reference.reachabilityFence(update_msg);
1169 if (ret >= 0 && ret <= 4096) { return null; }
1170 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1171 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1172 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1173 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(update_msg); };
1178 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
1180 public static MessageSendEvent broadcast_channel_update(org.ldk.structs.ChannelUpdate msg) {
1181 long ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr);
1182 Reference.reachabilityFence(msg);
1183 if (ret >= 0 && ret <= 4096) { return null; }
1184 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1185 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1186 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1191 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
1193 public static MessageSendEvent broadcast_node_announcement(org.ldk.structs.NodeAnnouncement msg) {
1194 long ret = bindings.MessageSendEvent_broadcast_node_announcement(msg == null ? 0 : msg.ptr);
1195 Reference.reachabilityFence(msg);
1196 if (ret >= 0 && ret <= 4096) { return null; }
1197 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1198 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1199 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1204 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
1206 public static MessageSendEvent send_channel_update(byte[] node_id, org.ldk.structs.ChannelUpdate msg) {
1207 long ret = bindings.MessageSendEvent_send_channel_update(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1208 Reference.reachabilityFence(node_id);
1209 Reference.reachabilityFence(msg);
1210 if (ret >= 0 && ret <= 4096) { return null; }
1211 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1212 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1213 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1218 * Utility method to constructs a new HandleError-variant MessageSendEvent
1220 public static MessageSendEvent handle_error(byte[] node_id, org.ldk.structs.ErrorAction action) {
1221 long ret = bindings.MessageSendEvent_handle_error(InternalUtils.check_arr_len(node_id, 33), action.ptr);
1222 Reference.reachabilityFence(node_id);
1223 Reference.reachabilityFence(action);
1224 if (ret >= 0 && ret <= 4096) { return null; }
1225 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1226 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1227 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(action); };
1232 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
1234 public static MessageSendEvent send_channel_range_query(byte[] node_id, org.ldk.structs.QueryChannelRange msg) {
1235 long ret = bindings.MessageSendEvent_send_channel_range_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1236 Reference.reachabilityFence(node_id);
1237 Reference.reachabilityFence(msg);
1238 if (ret >= 0 && ret <= 4096) { return null; }
1239 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1240 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1241 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1246 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
1248 public static MessageSendEvent send_short_ids_query(byte[] node_id, org.ldk.structs.QueryShortChannelIds msg) {
1249 long ret = bindings.MessageSendEvent_send_short_ids_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1250 Reference.reachabilityFence(node_id);
1251 Reference.reachabilityFence(msg);
1252 if (ret >= 0 && ret <= 4096) { return null; }
1253 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1254 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1255 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1260 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
1262 public static MessageSendEvent send_reply_channel_range(byte[] node_id, org.ldk.structs.ReplyChannelRange msg) {
1263 long ret = bindings.MessageSendEvent_send_reply_channel_range(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1264 Reference.reachabilityFence(node_id);
1265 Reference.reachabilityFence(msg);
1266 if (ret >= 0 && ret <= 4096) { return null; }
1267 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1268 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1269 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
1274 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
1276 public static MessageSendEvent send_gossip_timestamp_filter(byte[] node_id, org.ldk.structs.GossipTimestampFilter msg) {
1277 long ret = bindings.MessageSendEvent_send_gossip_timestamp_filter(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
1278 Reference.reachabilityFence(node_id);
1279 Reference.reachabilityFence(msg);
1280 if (ret >= 0 && ret <= 4096) { return null; }
1281 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
1282 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
1283 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };