1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import javax.annotation.Nullable;
11 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
12 * broadcast to most peers).
13 * These events are handled by PeerManager::process_events if you are using a PeerManager.
15 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
16 public class MessageSendEvent extends CommonBase {
17 private MessageSendEvent(Object _dummy, long ptr) { super(ptr); }
18 @Override @SuppressWarnings("deprecation")
19 protected void finalize() throws Throwable {
21 if (ptr != 0) { bindings.MessageSendEvent_free(ptr); }
23 static MessageSendEvent constr_from_ptr(long ptr) {
24 bindings.LDKMessageSendEvent raw_val = bindings.LDKMessageSendEvent_ref_from_ptr(ptr);
25 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendAcceptChannel.class) {
26 return new SendAcceptChannel(ptr, (bindings.LDKMessageSendEvent.SendAcceptChannel)raw_val);
28 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendOpenChannel.class) {
29 return new SendOpenChannel(ptr, (bindings.LDKMessageSendEvent.SendOpenChannel)raw_val);
31 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendFundingCreated.class) {
32 return new SendFundingCreated(ptr, (bindings.LDKMessageSendEvent.SendFundingCreated)raw_val);
34 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendFundingSigned.class) {
35 return new SendFundingSigned(ptr, (bindings.LDKMessageSendEvent.SendFundingSigned)raw_val);
37 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendFundingLocked.class) {
38 return new SendFundingLocked(ptr, (bindings.LDKMessageSendEvent.SendFundingLocked)raw_val);
40 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendAnnouncementSignatures.class) {
41 return new SendAnnouncementSignatures(ptr, (bindings.LDKMessageSendEvent.SendAnnouncementSignatures)raw_val);
43 if (raw_val.getClass() == bindings.LDKMessageSendEvent.UpdateHTLCs.class) {
44 return new UpdateHTLCs(ptr, (bindings.LDKMessageSendEvent.UpdateHTLCs)raw_val);
46 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendRevokeAndACK.class) {
47 return new SendRevokeAndACK(ptr, (bindings.LDKMessageSendEvent.SendRevokeAndACK)raw_val);
49 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendClosingSigned.class) {
50 return new SendClosingSigned(ptr, (bindings.LDKMessageSendEvent.SendClosingSigned)raw_val);
52 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendShutdown.class) {
53 return new SendShutdown(ptr, (bindings.LDKMessageSendEvent.SendShutdown)raw_val);
55 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelReestablish.class) {
56 return new SendChannelReestablish(ptr, (bindings.LDKMessageSendEvent.SendChannelReestablish)raw_val);
58 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement.class) {
59 return new BroadcastChannelAnnouncement(ptr, (bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement)raw_val);
61 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement.class) {
62 return new BroadcastNodeAnnouncement(ptr, (bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement)raw_val);
64 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastChannelUpdate.class) {
65 return new BroadcastChannelUpdate(ptr, (bindings.LDKMessageSendEvent.BroadcastChannelUpdate)raw_val);
67 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelUpdate.class) {
68 return new SendChannelUpdate(ptr, (bindings.LDKMessageSendEvent.SendChannelUpdate)raw_val);
70 if (raw_val.getClass() == bindings.LDKMessageSendEvent.HandleError.class) {
71 return new HandleError(ptr, (bindings.LDKMessageSendEvent.HandleError)raw_val);
73 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelRangeQuery.class) {
74 return new SendChannelRangeQuery(ptr, (bindings.LDKMessageSendEvent.SendChannelRangeQuery)raw_val);
76 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendShortIdsQuery.class) {
77 return new SendShortIdsQuery(ptr, (bindings.LDKMessageSendEvent.SendShortIdsQuery)raw_val);
79 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendReplyChannelRange.class) {
80 return new SendReplyChannelRange(ptr, (bindings.LDKMessageSendEvent.SendReplyChannelRange)raw_val);
82 assert false; return null; // Unreachable without extending the (internal) bindings interface
86 * Used to indicate that we've accepted a channel open and should send the accept_channel
87 * message provided to the given peer.
89 public final static class SendAcceptChannel extends MessageSendEvent {
91 * The node_id of the node which should receive this message
93 public final byte[] node_id;
95 * The message which should be sent.
97 public final AcceptChannel msg;
98 private SendAcceptChannel(long ptr, bindings.LDKMessageSendEvent.SendAcceptChannel obj) {
100 this.node_id = obj.node_id;
102 AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new AcceptChannel(null, msg); }
103 msg_hu_conv.ptrs_to.add(this);
104 this.msg = msg_hu_conv;
108 * Used to indicate that we've initiated a channel open and should send the open_channel
109 * message provided to the given peer.
111 public final static class SendOpenChannel extends MessageSendEvent {
113 * The node_id of the node which should receive this message
115 public final byte[] node_id;
117 * The message which should be sent.
119 public final OpenChannel msg;
120 private SendOpenChannel(long ptr, bindings.LDKMessageSendEvent.SendOpenChannel obj) {
122 this.node_id = obj.node_id;
124 OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new OpenChannel(null, msg); }
125 msg_hu_conv.ptrs_to.add(this);
126 this.msg = msg_hu_conv;
130 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
132 public final static class SendFundingCreated extends MessageSendEvent {
134 * The node_id of the node which should receive this message
136 public final byte[] node_id;
138 * The message which should be sent.
140 public final FundingCreated msg;
141 private SendFundingCreated(long ptr, bindings.LDKMessageSendEvent.SendFundingCreated obj) {
143 this.node_id = obj.node_id;
145 FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingCreated(null, msg); }
146 msg_hu_conv.ptrs_to.add(this);
147 this.msg = msg_hu_conv;
151 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
153 public final static class SendFundingSigned extends MessageSendEvent {
155 * The node_id of the node which should receive this message
157 public final byte[] node_id;
159 * The message which should be sent.
161 public final FundingSigned msg;
162 private SendFundingSigned(long ptr, bindings.LDKMessageSendEvent.SendFundingSigned obj) {
164 this.node_id = obj.node_id;
166 FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingSigned(null, msg); }
167 msg_hu_conv.ptrs_to.add(this);
168 this.msg = msg_hu_conv;
172 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
174 public final static class SendFundingLocked extends MessageSendEvent {
176 * The node_id of the node which should receive these message(s)
178 public final byte[] node_id;
180 * The funding_locked message which should be sent.
182 public final FundingLocked msg;
183 private SendFundingLocked(long ptr, bindings.LDKMessageSendEvent.SendFundingLocked obj) {
185 this.node_id = obj.node_id;
187 FundingLocked msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingLocked(null, msg); }
188 msg_hu_conv.ptrs_to.add(this);
189 this.msg = msg_hu_conv;
193 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
195 public final static class SendAnnouncementSignatures extends MessageSendEvent {
197 * The node_id of the node which should receive these message(s)
199 public final byte[] node_id;
201 * The announcement_signatures message which should be sent.
203 public final AnnouncementSignatures msg;
204 private SendAnnouncementSignatures(long ptr, bindings.LDKMessageSendEvent.SendAnnouncementSignatures obj) {
206 this.node_id = obj.node_id;
208 AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new AnnouncementSignatures(null, msg); }
209 msg_hu_conv.ptrs_to.add(this);
210 this.msg = msg_hu_conv;
214 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
215 * message should be sent to the peer with the given node_id.
217 public final static class UpdateHTLCs extends MessageSendEvent {
219 * The node_id of the node which should receive these message(s)
221 public final byte[] node_id;
223 * The update messages which should be sent. ALL messages in the struct should be sent!
225 public final CommitmentUpdate updates;
226 private UpdateHTLCs(long ptr, bindings.LDKMessageSendEvent.UpdateHTLCs obj) {
228 this.node_id = obj.node_id;
229 long updates = obj.updates;
230 CommitmentUpdate updates_hu_conv = null; if (updates < 0 || updates > 4096) { updates_hu_conv = new CommitmentUpdate(null, updates); }
231 updates_hu_conv.ptrs_to.add(this);
232 this.updates = updates_hu_conv;
236 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
238 public final static class SendRevokeAndACK extends MessageSendEvent {
240 * The node_id of the node which should receive this message
242 public final byte[] node_id;
244 * The message which should be sent.
246 public final RevokeAndACK msg;
247 private SendRevokeAndACK(long ptr, bindings.LDKMessageSendEvent.SendRevokeAndACK obj) {
249 this.node_id = obj.node_id;
251 RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new RevokeAndACK(null, msg); }
252 msg_hu_conv.ptrs_to.add(this);
253 this.msg = msg_hu_conv;
257 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
259 public final static class SendClosingSigned extends MessageSendEvent {
261 * The node_id of the node which should receive this message
263 public final byte[] node_id;
265 * The message which should be sent.
267 public final ClosingSigned msg;
268 private SendClosingSigned(long ptr, bindings.LDKMessageSendEvent.SendClosingSigned obj) {
270 this.node_id = obj.node_id;
272 ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ClosingSigned(null, msg); }
273 msg_hu_conv.ptrs_to.add(this);
274 this.msg = msg_hu_conv;
278 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
280 public final static class SendShutdown extends MessageSendEvent {
282 * The node_id of the node which should receive this message
284 public final byte[] node_id;
286 * The message which should be sent.
288 public final Shutdown msg;
289 private SendShutdown(long ptr, bindings.LDKMessageSendEvent.SendShutdown obj) {
291 this.node_id = obj.node_id;
293 Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new Shutdown(null, msg); }
294 msg_hu_conv.ptrs_to.add(this);
295 this.msg = msg_hu_conv;
299 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
301 public final static class SendChannelReestablish extends MessageSendEvent {
303 * The node_id of the node which should receive this message
305 public final byte[] node_id;
307 * The message which should be sent.
309 public final ChannelReestablish msg;
310 private SendChannelReestablish(long ptr, bindings.LDKMessageSendEvent.SendChannelReestablish obj) {
312 this.node_id = obj.node_id;
314 ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelReestablish(null, msg); }
315 msg_hu_conv.ptrs_to.add(this);
316 this.msg = msg_hu_conv;
320 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
321 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
323 * Note that after doing so, you very likely (unless you did so very recently) want to call
324 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
325 * This ensures that any nodes which see our channel_announcement also have a relevant
326 * node_announcement, including relevant feature flags which may be important for routing
329 public final static class BroadcastChannelAnnouncement extends MessageSendEvent {
331 * The channel_announcement which should be sent.
333 public final ChannelAnnouncement msg;
335 * The followup channel_update which should be sent.
337 public final ChannelUpdate update_msg;
338 private BroadcastChannelAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement obj) {
341 ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelAnnouncement(null, msg); }
342 msg_hu_conv.ptrs_to.add(this);
343 this.msg = msg_hu_conv;
344 long update_msg = obj.update_msg;
345 ChannelUpdate update_msg_hu_conv = null; if (update_msg < 0 || update_msg > 4096) { update_msg_hu_conv = new ChannelUpdate(null, update_msg); }
346 update_msg_hu_conv.ptrs_to.add(this);
347 this.update_msg = update_msg_hu_conv;
351 * Used to indicate that a node_announcement should be broadcast to all peers.
353 public final static class BroadcastNodeAnnouncement extends MessageSendEvent {
355 * The node_announcement which should be sent.
357 public final NodeAnnouncement msg;
358 private BroadcastNodeAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement obj) {
361 NodeAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new NodeAnnouncement(null, msg); }
362 msg_hu_conv.ptrs_to.add(this);
363 this.msg = msg_hu_conv;
367 * Used to indicate that a channel_update should be broadcast to all peers.
369 public final static class BroadcastChannelUpdate extends MessageSendEvent {
371 * The channel_update which should be sent.
373 public final ChannelUpdate msg;
374 private BroadcastChannelUpdate(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelUpdate obj) {
377 ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelUpdate(null, msg); }
378 msg_hu_conv.ptrs_to.add(this);
379 this.msg = msg_hu_conv;
383 * Used to indicate that a channel_update should be sent to a single peer.
384 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
385 * private channel and we shouldn't be informing all of our peers of channel parameters.
387 public final static class SendChannelUpdate extends MessageSendEvent {
389 * The node_id of the node which should receive this message
391 public final byte[] node_id;
393 * The channel_update which should be sent.
395 public final ChannelUpdate msg;
396 private SendChannelUpdate(long ptr, bindings.LDKMessageSendEvent.SendChannelUpdate obj) {
398 this.node_id = obj.node_id;
400 ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelUpdate(null, msg); }
401 msg_hu_conv.ptrs_to.add(this);
402 this.msg = msg_hu_conv;
406 * Broadcast an error downstream to be handled
408 public final static class HandleError extends MessageSendEvent {
410 * The node_id of the node which should receive this message
412 public final byte[] node_id;
414 * The action which should be taken.
416 public final ErrorAction action;
417 private HandleError(long ptr, bindings.LDKMessageSendEvent.HandleError obj) {
419 this.node_id = obj.node_id;
420 long action = obj.action;
421 ErrorAction action_hu_conv = ErrorAction.constr_from_ptr(action);
422 action_hu_conv.ptrs_to.add(this);
423 this.action = action_hu_conv;
427 * Query a peer for channels with funding transaction UTXOs in a block range.
429 public final static class SendChannelRangeQuery extends MessageSendEvent {
431 * The node_id of this message recipient
433 public final byte[] node_id;
435 * The query_channel_range which should be sent.
437 public final QueryChannelRange msg;
438 private SendChannelRangeQuery(long ptr, bindings.LDKMessageSendEvent.SendChannelRangeQuery obj) {
440 this.node_id = obj.node_id;
442 QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new QueryChannelRange(null, msg); }
443 msg_hu_conv.ptrs_to.add(this);
444 this.msg = msg_hu_conv;
448 * Request routing gossip messages from a peer for a list of channels identified by
449 * their short_channel_ids.
451 public final static class SendShortIdsQuery extends MessageSendEvent {
453 * The node_id of this message recipient
455 public final byte[] node_id;
457 * The query_short_channel_ids which should be sent.
459 public final QueryShortChannelIds msg;
460 private SendShortIdsQuery(long ptr, bindings.LDKMessageSendEvent.SendShortIdsQuery obj) {
462 this.node_id = obj.node_id;
464 QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new QueryShortChannelIds(null, msg); }
465 msg_hu_conv.ptrs_to.add(this);
466 this.msg = msg_hu_conv;
470 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
471 * emitted during processing of the query.
473 public final static class SendReplyChannelRange extends MessageSendEvent {
475 * The node_id of this message recipient
477 public final byte[] node_id;
479 * The reply_channel_range which should be sent.
481 public final ReplyChannelRange msg;
482 private SendReplyChannelRange(long ptr, bindings.LDKMessageSendEvent.SendReplyChannelRange obj) {
484 this.node_id = obj.node_id;
486 ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ReplyChannelRange(null, msg); }
487 msg_hu_conv.ptrs_to.add(this);
488 this.msg = msg_hu_conv;
492 long ret = bindings.MessageSendEvent_clone_ptr(this.ptr);
497 * Creates a copy of the MessageSendEvent
499 public MessageSendEvent clone() {
500 long ret = bindings.MessageSendEvent_clone(this.ptr);
501 if (ret >= 0 && ret <= 4096) { return null; }
502 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
503 ret_hu_conv.ptrs_to.add(this);
508 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
510 public static MessageSendEvent send_accept_channel(byte[] node_id, AcceptChannel msg) {
511 long ret = bindings.MessageSendEvent_send_accept_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
512 if (ret >= 0 && ret <= 4096) { return null; }
513 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
514 ret_hu_conv.ptrs_to.add(ret_hu_conv);
519 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
521 public static MessageSendEvent send_open_channel(byte[] node_id, OpenChannel msg) {
522 long ret = bindings.MessageSendEvent_send_open_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
523 if (ret >= 0 && ret <= 4096) { return null; }
524 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
525 ret_hu_conv.ptrs_to.add(ret_hu_conv);
530 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
532 public static MessageSendEvent send_funding_created(byte[] node_id, FundingCreated msg) {
533 long ret = bindings.MessageSendEvent_send_funding_created(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
534 if (ret >= 0 && ret <= 4096) { return null; }
535 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
536 ret_hu_conv.ptrs_to.add(ret_hu_conv);
541 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
543 public static MessageSendEvent send_funding_signed(byte[] node_id, FundingSigned msg) {
544 long ret = bindings.MessageSendEvent_send_funding_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
545 if (ret >= 0 && ret <= 4096) { return null; }
546 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
547 ret_hu_conv.ptrs_to.add(ret_hu_conv);
552 * Utility method to constructs a new SendFundingLocked-variant MessageSendEvent
554 public static MessageSendEvent send_funding_locked(byte[] node_id, FundingLocked msg) {
555 long ret = bindings.MessageSendEvent_send_funding_locked(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
556 if (ret >= 0 && ret <= 4096) { return null; }
557 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
558 ret_hu_conv.ptrs_to.add(ret_hu_conv);
563 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
565 public static MessageSendEvent send_announcement_signatures(byte[] node_id, AnnouncementSignatures msg) {
566 long ret = bindings.MessageSendEvent_send_announcement_signatures(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
567 if (ret >= 0 && ret <= 4096) { return null; }
568 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
569 ret_hu_conv.ptrs_to.add(ret_hu_conv);
574 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
576 public static MessageSendEvent update_htlcs(byte[] node_id, CommitmentUpdate updates) {
577 long ret = bindings.MessageSendEvent_update_htlcs(InternalUtils.check_arr_len(node_id, 33), updates == null ? 0 : updates.ptr & ~1);
578 if (ret >= 0 && ret <= 4096) { return null; }
579 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
580 ret_hu_conv.ptrs_to.add(ret_hu_conv);
585 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
587 public static MessageSendEvent send_revoke_and_ack(byte[] node_id, RevokeAndACK msg) {
588 long ret = bindings.MessageSendEvent_send_revoke_and_ack(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
589 if (ret >= 0 && ret <= 4096) { return null; }
590 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
591 ret_hu_conv.ptrs_to.add(ret_hu_conv);
596 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
598 public static MessageSendEvent send_closing_signed(byte[] node_id, ClosingSigned msg) {
599 long ret = bindings.MessageSendEvent_send_closing_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
600 if (ret >= 0 && ret <= 4096) { return null; }
601 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
602 ret_hu_conv.ptrs_to.add(ret_hu_conv);
607 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
609 public static MessageSendEvent send_shutdown(byte[] node_id, Shutdown msg) {
610 long ret = bindings.MessageSendEvent_send_shutdown(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
611 if (ret >= 0 && ret <= 4096) { return null; }
612 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
613 ret_hu_conv.ptrs_to.add(ret_hu_conv);
618 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
620 public static MessageSendEvent send_channel_reestablish(byte[] node_id, ChannelReestablish msg) {
621 long ret = bindings.MessageSendEvent_send_channel_reestablish(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
622 if (ret >= 0 && ret <= 4096) { return null; }
623 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
624 ret_hu_conv.ptrs_to.add(ret_hu_conv);
629 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
631 public static MessageSendEvent broadcast_channel_announcement(ChannelAnnouncement msg, ChannelUpdate update_msg) {
632 long ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : msg.ptr & ~1, update_msg == null ? 0 : update_msg.ptr & ~1);
633 if (ret >= 0 && ret <= 4096) { return null; }
634 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
635 ret_hu_conv.ptrs_to.add(ret_hu_conv);
640 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
642 public static MessageSendEvent broadcast_node_announcement(NodeAnnouncement msg) {
643 long ret = bindings.MessageSendEvent_broadcast_node_announcement(msg == null ? 0 : msg.ptr & ~1);
644 if (ret >= 0 && ret <= 4096) { return null; }
645 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
646 ret_hu_conv.ptrs_to.add(ret_hu_conv);
651 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
653 public static MessageSendEvent broadcast_channel_update(ChannelUpdate msg) {
654 long ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr & ~1);
655 if (ret >= 0 && ret <= 4096) { return null; }
656 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
657 ret_hu_conv.ptrs_to.add(ret_hu_conv);
662 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
664 public static MessageSendEvent send_channel_update(byte[] node_id, ChannelUpdate msg) {
665 long ret = bindings.MessageSendEvent_send_channel_update(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
666 if (ret >= 0 && ret <= 4096) { return null; }
667 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
668 ret_hu_conv.ptrs_to.add(ret_hu_conv);
673 * Utility method to constructs a new HandleError-variant MessageSendEvent
675 public static MessageSendEvent handle_error(byte[] node_id, ErrorAction action) {
676 long ret = bindings.MessageSendEvent_handle_error(InternalUtils.check_arr_len(node_id, 33), action.ptr);
677 if (ret >= 0 && ret <= 4096) { return null; }
678 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
679 ret_hu_conv.ptrs_to.add(ret_hu_conv);
684 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
686 public static MessageSendEvent send_channel_range_query(byte[] node_id, QueryChannelRange msg) {
687 long ret = bindings.MessageSendEvent_send_channel_range_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
688 if (ret >= 0 && ret <= 4096) { return null; }
689 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
690 ret_hu_conv.ptrs_to.add(ret_hu_conv);
695 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
697 public static MessageSendEvent send_short_ids_query(byte[] node_id, QueryShortChannelIds msg) {
698 long ret = bindings.MessageSendEvent_send_short_ids_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
699 if (ret >= 0 && ret <= 4096) { return null; }
700 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
701 ret_hu_conv.ptrs_to.add(ret_hu_conv);
706 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
708 public static MessageSendEvent send_reply_channel_range(byte[] node_id, ReplyChannelRange msg) {
709 long ret = bindings.MessageSendEvent_send_reply_channel_range(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
710 if (ret >= 0 && ret <= 4096) { return null; }
711 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
712 ret_hu_conv.ptrs_to.add(ret_hu_conv);