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.SendStfu.class) {
45 return new SendStfu(ptr, (bindings.LDKMessageSendEvent.SendStfu)raw_val);
47 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendSplice.class) {
48 return new SendSplice(ptr, (bindings.LDKMessageSendEvent.SendSplice)raw_val);
50 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendSpliceAck.class) {
51 return new SendSpliceAck(ptr, (bindings.LDKMessageSendEvent.SendSpliceAck)raw_val);
53 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendSpliceLocked.class) {
54 return new SendSpliceLocked(ptr, (bindings.LDKMessageSendEvent.SendSpliceLocked)raw_val);
56 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxAddInput.class) {
57 return new SendTxAddInput(ptr, (bindings.LDKMessageSendEvent.SendTxAddInput)raw_val);
59 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxAddOutput.class) {
60 return new SendTxAddOutput(ptr, (bindings.LDKMessageSendEvent.SendTxAddOutput)raw_val);
62 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxRemoveInput.class) {
63 return new SendTxRemoveInput(ptr, (bindings.LDKMessageSendEvent.SendTxRemoveInput)raw_val);
65 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxRemoveOutput.class) {
66 return new SendTxRemoveOutput(ptr, (bindings.LDKMessageSendEvent.SendTxRemoveOutput)raw_val);
68 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxComplete.class) {
69 return new SendTxComplete(ptr, (bindings.LDKMessageSendEvent.SendTxComplete)raw_val);
71 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxSignatures.class) {
72 return new SendTxSignatures(ptr, (bindings.LDKMessageSendEvent.SendTxSignatures)raw_val);
74 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxInitRbf.class) {
75 return new SendTxInitRbf(ptr, (bindings.LDKMessageSendEvent.SendTxInitRbf)raw_val);
77 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxAckRbf.class) {
78 return new SendTxAckRbf(ptr, (bindings.LDKMessageSendEvent.SendTxAckRbf)raw_val);
80 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendTxAbort.class) {
81 return new SendTxAbort(ptr, (bindings.LDKMessageSendEvent.SendTxAbort)raw_val);
83 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelReady.class) {
84 return new SendChannelReady(ptr, (bindings.LDKMessageSendEvent.SendChannelReady)raw_val);
86 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendAnnouncementSignatures.class) {
87 return new SendAnnouncementSignatures(ptr, (bindings.LDKMessageSendEvent.SendAnnouncementSignatures)raw_val);
89 if (raw_val.getClass() == bindings.LDKMessageSendEvent.UpdateHTLCs.class) {
90 return new UpdateHTLCs(ptr, (bindings.LDKMessageSendEvent.UpdateHTLCs)raw_val);
92 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendRevokeAndACK.class) {
93 return new SendRevokeAndACK(ptr, (bindings.LDKMessageSendEvent.SendRevokeAndACK)raw_val);
95 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendClosingSigned.class) {
96 return new SendClosingSigned(ptr, (bindings.LDKMessageSendEvent.SendClosingSigned)raw_val);
98 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendShutdown.class) {
99 return new SendShutdown(ptr, (bindings.LDKMessageSendEvent.SendShutdown)raw_val);
101 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelReestablish.class) {
102 return new SendChannelReestablish(ptr, (bindings.LDKMessageSendEvent.SendChannelReestablish)raw_val);
104 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelAnnouncement.class) {
105 return new SendChannelAnnouncement(ptr, (bindings.LDKMessageSendEvent.SendChannelAnnouncement)raw_val);
107 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement.class) {
108 return new BroadcastChannelAnnouncement(ptr, (bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement)raw_val);
110 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastChannelUpdate.class) {
111 return new BroadcastChannelUpdate(ptr, (bindings.LDKMessageSendEvent.BroadcastChannelUpdate)raw_val);
113 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement.class) {
114 return new BroadcastNodeAnnouncement(ptr, (bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement)raw_val);
116 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelUpdate.class) {
117 return new SendChannelUpdate(ptr, (bindings.LDKMessageSendEvent.SendChannelUpdate)raw_val);
119 if (raw_val.getClass() == bindings.LDKMessageSendEvent.HandleError.class) {
120 return new HandleError(ptr, (bindings.LDKMessageSendEvent.HandleError)raw_val);
122 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelRangeQuery.class) {
123 return new SendChannelRangeQuery(ptr, (bindings.LDKMessageSendEvent.SendChannelRangeQuery)raw_val);
125 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendShortIdsQuery.class) {
126 return new SendShortIdsQuery(ptr, (bindings.LDKMessageSendEvent.SendShortIdsQuery)raw_val);
128 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendReplyChannelRange.class) {
129 return new SendReplyChannelRange(ptr, (bindings.LDKMessageSendEvent.SendReplyChannelRange)raw_val);
131 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendGossipTimestampFilter.class) {
132 return new SendGossipTimestampFilter(ptr, (bindings.LDKMessageSendEvent.SendGossipTimestampFilter)raw_val);
134 assert false; return null; // Unreachable without extending the (internal) bindings interface
138 * Used to indicate that we've accepted a channel open and should send the accept_channel
139 * message provided to the given peer.
141 public final static class SendAcceptChannel extends MessageSendEvent {
143 * The node_id of the node which should receive this message
145 public final byte[] node_id;
147 * The message which should be sent.
149 public final org.ldk.structs.AcceptChannel msg;
150 private SendAcceptChannel(long ptr, bindings.LDKMessageSendEvent.SendAcceptChannel obj) {
152 this.node_id = obj.node_id;
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;
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.
163 public final static class SendAcceptChannelV2 extends MessageSendEvent {
165 * The node_id of the node which should receive this message
167 public final byte[] node_id;
169 * The message which should be sent.
171 public final org.ldk.structs.AcceptChannelV2 msg;
172 private SendAcceptChannelV2(long ptr, bindings.LDKMessageSendEvent.SendAcceptChannelV2 obj) {
174 this.node_id = obj.node_id;
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;
182 * Used to indicate that we've initiated a channel open and should send the open_channel
183 * message provided to the given peer.
185 public final static class SendOpenChannel extends MessageSendEvent {
187 * The node_id of the node which should receive this message
189 public final byte[] node_id;
191 * The message which should be sent.
193 public final org.ldk.structs.OpenChannel msg;
194 private SendOpenChannel(long ptr, bindings.LDKMessageSendEvent.SendOpenChannel obj) {
196 this.node_id = obj.node_id;
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;
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.
207 public final static class SendOpenChannelV2 extends MessageSendEvent {
209 * The node_id of the node which should receive this message
211 public final byte[] node_id;
213 * The message which should be sent.
215 public final org.ldk.structs.OpenChannelV2 msg;
216 private SendOpenChannelV2(long ptr, bindings.LDKMessageSendEvent.SendOpenChannelV2 obj) {
218 this.node_id = obj.node_id;
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;
226 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
228 public final static class SendFundingCreated extends MessageSendEvent {
230 * The node_id of the node which should receive this message
232 public final byte[] node_id;
234 * The message which should be sent.
236 public final org.ldk.structs.FundingCreated msg;
237 private SendFundingCreated(long ptr, bindings.LDKMessageSendEvent.SendFundingCreated obj) {
239 this.node_id = obj.node_id;
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;
247 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
249 public final static class SendFundingSigned extends MessageSendEvent {
251 * The node_id of the node which should receive this message
253 public final byte[] node_id;
255 * The message which should be sent.
257 public final org.ldk.structs.FundingSigned msg;
258 private SendFundingSigned(long ptr, bindings.LDKMessageSendEvent.SendFundingSigned obj) {
260 this.node_id = obj.node_id;
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;
268 * Used to indicate that a stfu message should be sent to the peer with the given node id.
270 public final static class SendStfu extends MessageSendEvent {
272 * The node_id of the node which should receive this message
274 public final byte[] node_id;
276 * The message which should be sent.
278 public final org.ldk.structs.Stfu msg;
279 private SendStfu(long ptr, bindings.LDKMessageSendEvent.SendStfu obj) {
281 this.node_id = obj.node_id;
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;
289 * Used to indicate that a splice message should be sent to the peer with the given node id.
291 public final static class SendSplice extends MessageSendEvent {
293 * The node_id of the node which should receive this message
295 public final byte[] node_id;
297 * The message which should be sent.
299 public final org.ldk.structs.Splice msg;
300 private SendSplice(long ptr, bindings.LDKMessageSendEvent.SendSplice obj) {
302 this.node_id = obj.node_id;
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;
310 * Used to indicate that a splice_ack message should be sent to the peer with the given node id.
312 public final static class SendSpliceAck extends MessageSendEvent {
314 * The node_id of the node which should receive this message
316 public final byte[] node_id;
318 * The message which should be sent.
320 public final org.ldk.structs.SpliceAck msg;
321 private SendSpliceAck(long ptr, bindings.LDKMessageSendEvent.SendSpliceAck obj) {
323 this.node_id = obj.node_id;
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;
331 * Used to indicate that a splice_locked message should be sent to the peer with the given node id.
333 public final static class SendSpliceLocked extends MessageSendEvent {
335 * The node_id of the node which should receive this message
337 public final byte[] node_id;
339 * The message which should be sent.
341 public final org.ldk.structs.SpliceLocked msg;
342 private SendSpliceLocked(long ptr, bindings.LDKMessageSendEvent.SendSpliceLocked obj) {
344 this.node_id = obj.node_id;
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;
352 * Used to indicate that a tx_add_input message should be sent to the peer with the given node_id.
354 public final static class SendTxAddInput extends MessageSendEvent {
356 * The node_id of the node which should receive this message
358 public final byte[] node_id;
360 * The message which should be sent.
362 public final org.ldk.structs.TxAddInput msg;
363 private SendTxAddInput(long ptr, bindings.LDKMessageSendEvent.SendTxAddInput obj) {
365 this.node_id = obj.node_id;
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;
373 * Used to indicate that a tx_add_output message should be sent to the peer with the given node_id.
375 public final static class SendTxAddOutput extends MessageSendEvent {
377 * The node_id of the node which should receive this message
379 public final byte[] node_id;
381 * The message which should be sent.
383 public final org.ldk.structs.TxAddOutput msg;
384 private SendTxAddOutput(long ptr, bindings.LDKMessageSendEvent.SendTxAddOutput obj) {
386 this.node_id = obj.node_id;
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;
394 * Used to indicate that a tx_remove_input message should be sent to the peer with the given node_id.
396 public final static class SendTxRemoveInput extends MessageSendEvent {
398 * The node_id of the node which should receive this message
400 public final byte[] node_id;
402 * The message which should be sent.
404 public final org.ldk.structs.TxRemoveInput msg;
405 private SendTxRemoveInput(long ptr, bindings.LDKMessageSendEvent.SendTxRemoveInput obj) {
407 this.node_id = obj.node_id;
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;
415 * Used to indicate that a tx_remove_output message should be sent to the peer with the given node_id.
417 public final static class SendTxRemoveOutput extends MessageSendEvent {
419 * The node_id of the node which should receive this message
421 public final byte[] node_id;
423 * The message which should be sent.
425 public final org.ldk.structs.TxRemoveOutput msg;
426 private SendTxRemoveOutput(long ptr, bindings.LDKMessageSendEvent.SendTxRemoveOutput obj) {
428 this.node_id = obj.node_id;
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;
436 * Used to indicate that a tx_complete message should be sent to the peer with the given node_id.
438 public final static class SendTxComplete extends MessageSendEvent {
440 * The node_id of the node which should receive this message
442 public final byte[] node_id;
444 * The message which should be sent.
446 public final org.ldk.structs.TxComplete msg;
447 private SendTxComplete(long ptr, bindings.LDKMessageSendEvent.SendTxComplete obj) {
449 this.node_id = obj.node_id;
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;
457 * Used to indicate that a tx_signatures message should be sent to the peer with the given node_id.
459 public final static class SendTxSignatures extends MessageSendEvent {
461 * The node_id of the node which should receive this message
463 public final byte[] node_id;
465 * The message which should be sent.
467 public final org.ldk.structs.TxSignatures msg;
468 private SendTxSignatures(long ptr, bindings.LDKMessageSendEvent.SendTxSignatures obj) {
470 this.node_id = obj.node_id;
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;
478 * Used to indicate that a tx_init_rbf message should be sent to the peer with the given node_id.
480 public final static class SendTxInitRbf extends MessageSendEvent {
482 * The node_id of the node which should receive this message
484 public final byte[] node_id;
486 * The message which should be sent.
488 public final org.ldk.structs.TxInitRbf msg;
489 private SendTxInitRbf(long ptr, bindings.LDKMessageSendEvent.SendTxInitRbf obj) {
491 this.node_id = obj.node_id;
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;
499 * Used to indicate that a tx_ack_rbf message should be sent to the peer with the given node_id.
501 public final static class SendTxAckRbf extends MessageSendEvent {
503 * The node_id of the node which should receive this message
505 public final byte[] node_id;
507 * The message which should be sent.
509 public final org.ldk.structs.TxAckRbf msg;
510 private SendTxAckRbf(long ptr, bindings.LDKMessageSendEvent.SendTxAckRbf obj) {
512 this.node_id = obj.node_id;
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;
520 * Used to indicate that a tx_abort message should be sent to the peer with the given node_id.
522 public final static class SendTxAbort extends MessageSendEvent {
524 * The node_id of the node which should receive this message
526 public final byte[] node_id;
528 * The message which should be sent.
530 public final org.ldk.structs.TxAbort msg;
531 private SendTxAbort(long ptr, bindings.LDKMessageSendEvent.SendTxAbort obj) {
533 this.node_id = obj.node_id;
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;
541 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
543 public final static class SendChannelReady extends MessageSendEvent {
545 * The node_id of the node which should receive these message(s)
547 public final byte[] node_id;
549 * The channel_ready message which should be sent.
551 public final org.ldk.structs.ChannelReady msg;
552 private SendChannelReady(long ptr, bindings.LDKMessageSendEvent.SendChannelReady obj) {
554 this.node_id = obj.node_id;
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;
562 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
564 public final static class SendAnnouncementSignatures extends MessageSendEvent {
566 * The node_id of the node which should receive these message(s)
568 public final byte[] node_id;
570 * The announcement_signatures message which should be sent.
572 public final org.ldk.structs.AnnouncementSignatures msg;
573 private SendAnnouncementSignatures(long ptr, bindings.LDKMessageSendEvent.SendAnnouncementSignatures obj) {
575 this.node_id = obj.node_id;
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;
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.
586 public final static class UpdateHTLCs extends MessageSendEvent {
588 * The node_id of the node which should receive these message(s)
590 public final byte[] node_id;
592 * The update messages which should be sent. ALL messages in the struct should be sent!
594 public final org.ldk.structs.CommitmentUpdate updates;
595 private UpdateHTLCs(long ptr, bindings.LDKMessageSendEvent.UpdateHTLCs obj) {
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;
605 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
607 public final static class SendRevokeAndACK extends MessageSendEvent {
609 * The node_id of the node which should receive this message
611 public final byte[] node_id;
613 * The message which should be sent.
615 public final org.ldk.structs.RevokeAndACK msg;
616 private SendRevokeAndACK(long ptr, bindings.LDKMessageSendEvent.SendRevokeAndACK obj) {
618 this.node_id = obj.node_id;
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;
626 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
628 public final static class SendClosingSigned extends MessageSendEvent {
630 * The node_id of the node which should receive this message
632 public final byte[] node_id;
634 * The message which should be sent.
636 public final org.ldk.structs.ClosingSigned msg;
637 private SendClosingSigned(long ptr, bindings.LDKMessageSendEvent.SendClosingSigned obj) {
639 this.node_id = obj.node_id;
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;
647 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
649 public final static class SendShutdown extends MessageSendEvent {
651 * The node_id of the node which should receive this message
653 public final byte[] node_id;
655 * The message which should be sent.
657 public final org.ldk.structs.Shutdown msg;
658 private SendShutdown(long ptr, bindings.LDKMessageSendEvent.SendShutdown obj) {
660 this.node_id = obj.node_id;
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;
668 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
670 public final static class SendChannelReestablish extends MessageSendEvent {
672 * The node_id of the node which should receive this message
674 public final byte[] node_id;
676 * The message which should be sent.
678 public final org.ldk.structs.ChannelReestablish msg;
679 private SendChannelReestablish(long ptr, bindings.LDKMessageSendEvent.SendChannelReestablish obj) {
681 this.node_id = obj.node_id;
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;
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.
692 public final static class SendChannelAnnouncement extends MessageSendEvent {
694 * The node_id of the node which should receive this message
696 public final byte[] node_id;
698 * The channel_announcement which should be sent.
700 public final org.ldk.structs.ChannelAnnouncement msg;
702 * The followup channel_update which should be sent.
704 public final org.ldk.structs.ChannelUpdate update_msg;
705 private SendChannelAnnouncement(long ptr, bindings.LDKMessageSendEvent.SendChannelAnnouncement obj) {
707 this.node_id = obj.node_id;
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;
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).
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
728 * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
730 public final static class BroadcastChannelAnnouncement extends MessageSendEvent {
732 * The channel_announcement which should be sent.
734 public final org.ldk.structs.ChannelAnnouncement msg;
736 * The followup channel_update which should be sent.
738 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
740 @Nullable public final org.ldk.structs.ChannelUpdate update_msg;
741 private BroadcastChannelAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement obj) {
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;
754 * Used to indicate that a channel_update should be broadcast to all peers.
756 public final static class BroadcastChannelUpdate extends MessageSendEvent {
758 * The channel_update which should be sent.
760 public final org.ldk.structs.ChannelUpdate msg;
761 private BroadcastChannelUpdate(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelUpdate obj) {
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;
770 * Used to indicate that a node_announcement should be broadcast to all peers.
772 public final static class BroadcastNodeAnnouncement extends MessageSendEvent {
774 * The node_announcement which should be sent.
776 public final org.ldk.structs.NodeAnnouncement msg;
777 private BroadcastNodeAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement obj) {
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;
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.
790 public final static class SendChannelUpdate extends MessageSendEvent {
792 * The node_id of the node which should receive this message
794 public final byte[] node_id;
796 * The channel_update which should be sent.
798 public final org.ldk.structs.ChannelUpdate msg;
799 private SendChannelUpdate(long ptr, bindings.LDKMessageSendEvent.SendChannelUpdate obj) {
801 this.node_id = obj.node_id;
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;
809 * Broadcast an error downstream to be handled
811 public final static class HandleError extends MessageSendEvent {
813 * The node_id of the node which should receive this message
815 public final byte[] node_id;
817 * The action which should be taken.
819 public final org.ldk.structs.ErrorAction action;
820 private HandleError(long ptr, bindings.LDKMessageSendEvent.HandleError obj) {
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;
830 * Query a peer for channels with funding transaction UTXOs in a block range.
832 public final static class SendChannelRangeQuery extends MessageSendEvent {
834 * The node_id of this message recipient
836 public final byte[] node_id;
838 * The query_channel_range which should be sent.
840 public final org.ldk.structs.QueryChannelRange msg;
841 private SendChannelRangeQuery(long ptr, bindings.LDKMessageSendEvent.SendChannelRangeQuery obj) {
843 this.node_id = obj.node_id;
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;
851 * Request routing gossip messages from a peer for a list of channels identified by
852 * their short_channel_ids.
854 public final static class SendShortIdsQuery extends MessageSendEvent {
856 * The node_id of this message recipient
858 public final byte[] node_id;
860 * The query_short_channel_ids which should be sent.
862 public final org.ldk.structs.QueryShortChannelIds msg;
863 private SendShortIdsQuery(long ptr, bindings.LDKMessageSendEvent.SendShortIdsQuery obj) {
865 this.node_id = obj.node_id;
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;
873 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
874 * emitted during processing of the query.
876 public final static class SendReplyChannelRange extends MessageSendEvent {
878 * The node_id of this message recipient
880 public final byte[] node_id;
882 * The reply_channel_range which should be sent.
884 public final org.ldk.structs.ReplyChannelRange msg;
885 private SendReplyChannelRange(long ptr, bindings.LDKMessageSendEvent.SendReplyChannelRange obj) {
887 this.node_id = obj.node_id;
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;
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.
898 public final static class SendGossipTimestampFilter extends MessageSendEvent {
900 * The node_id of this message recipient
902 public final byte[] node_id;
904 * The gossip_timestamp_filter which should be sent.
906 public final org.ldk.structs.GossipTimestampFilter msg;
907 private SendGossipTimestampFilter(long ptr, bindings.LDKMessageSendEvent.SendGossipTimestampFilter obj) {
909 this.node_id = obj.node_id;
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;
917 long ret = bindings.MessageSendEvent_clone_ptr(this.ptr);
918 Reference.reachabilityFence(this);
923 * Creates a copy of the MessageSendEvent
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); };
935 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
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); };
949 * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
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); };
963 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
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); };
977 * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
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); };
991 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
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); };
1005 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
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); };
1019 * Utility method to constructs a new SendStfu-variant MessageSendEvent
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); };
1033 * Utility method to constructs a new SendSplice-variant MessageSendEvent
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); };
1047 * Utility method to constructs a new SendSpliceAck-variant MessageSendEvent
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); };
1061 * Utility method to constructs a new SendSpliceLocked-variant MessageSendEvent
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); };
1075 * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
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); };
1089 * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
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); };
1103 * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
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); };
1117 * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
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); };
1131 * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
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); };
1145 * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent
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); };
1159 * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
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); };
1173 * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
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); };
1187 * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
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); };
1201 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
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); };
1215 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
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); };
1229 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
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); };
1243 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
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); };
1257 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
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); };
1271 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
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); };
1285 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
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); };
1299 * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
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); };
1315 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
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); };
1330 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
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); };
1343 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
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); };
1356 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
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); };
1370 * Utility method to constructs a new HandleError-variant MessageSendEvent
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); };
1384 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
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); };
1398 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
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); };
1412 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
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); };
1426 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
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); };