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.SendOpenChannel.class) {
30 return new SendOpenChannel(ptr, (bindings.LDKMessageSendEvent.SendOpenChannel)raw_val);
32 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendFundingCreated.class) {
33 return new SendFundingCreated(ptr, (bindings.LDKMessageSendEvent.SendFundingCreated)raw_val);
35 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendFundingSigned.class) {
36 return new SendFundingSigned(ptr, (bindings.LDKMessageSendEvent.SendFundingSigned)raw_val);
38 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendFundingLocked.class) {
39 return new SendFundingLocked(ptr, (bindings.LDKMessageSendEvent.SendFundingLocked)raw_val);
41 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendAnnouncementSignatures.class) {
42 return new SendAnnouncementSignatures(ptr, (bindings.LDKMessageSendEvent.SendAnnouncementSignatures)raw_val);
44 if (raw_val.getClass() == bindings.LDKMessageSendEvent.UpdateHTLCs.class) {
45 return new UpdateHTLCs(ptr, (bindings.LDKMessageSendEvent.UpdateHTLCs)raw_val);
47 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendRevokeAndACK.class) {
48 return new SendRevokeAndACK(ptr, (bindings.LDKMessageSendEvent.SendRevokeAndACK)raw_val);
50 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendClosingSigned.class) {
51 return new SendClosingSigned(ptr, (bindings.LDKMessageSendEvent.SendClosingSigned)raw_val);
53 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendShutdown.class) {
54 return new SendShutdown(ptr, (bindings.LDKMessageSendEvent.SendShutdown)raw_val);
56 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelReestablish.class) {
57 return new SendChannelReestablish(ptr, (bindings.LDKMessageSendEvent.SendChannelReestablish)raw_val);
59 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement.class) {
60 return new BroadcastChannelAnnouncement(ptr, (bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement)raw_val);
62 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement.class) {
63 return new BroadcastNodeAnnouncement(ptr, (bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement)raw_val);
65 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastChannelUpdate.class) {
66 return new BroadcastChannelUpdate(ptr, (bindings.LDKMessageSendEvent.BroadcastChannelUpdate)raw_val);
68 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelUpdate.class) {
69 return new SendChannelUpdate(ptr, (bindings.LDKMessageSendEvent.SendChannelUpdate)raw_val);
71 if (raw_val.getClass() == bindings.LDKMessageSendEvent.HandleError.class) {
72 return new HandleError(ptr, (bindings.LDKMessageSendEvent.HandleError)raw_val);
74 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelRangeQuery.class) {
75 return new SendChannelRangeQuery(ptr, (bindings.LDKMessageSendEvent.SendChannelRangeQuery)raw_val);
77 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendShortIdsQuery.class) {
78 return new SendShortIdsQuery(ptr, (bindings.LDKMessageSendEvent.SendShortIdsQuery)raw_val);
80 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendReplyChannelRange.class) {
81 return new SendReplyChannelRange(ptr, (bindings.LDKMessageSendEvent.SendReplyChannelRange)raw_val);
83 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendGossipTimestampFilter.class) {
84 return new SendGossipTimestampFilter(ptr, (bindings.LDKMessageSendEvent.SendGossipTimestampFilter)raw_val);
86 assert false; return null; // Unreachable without extending the (internal) bindings interface
90 * Used to indicate that we've accepted a channel open and should send the accept_channel
91 * message provided to the given peer.
93 public final static class SendAcceptChannel extends MessageSendEvent {
95 * The node_id of the node which should receive this message
97 public final byte[] node_id;
99 * The message which should be sent.
101 public final org.ldk.structs.AcceptChannel msg;
102 private SendAcceptChannel(long ptr, bindings.LDKMessageSendEvent.SendAcceptChannel obj) {
104 this.node_id = obj.node_id;
106 AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new AcceptChannel(null, msg); }
107 msg_hu_conv.ptrs_to.add(this);
108 this.msg = msg_hu_conv;
112 * Used to indicate that we've initiated a channel open and should send the open_channel
113 * message provided to the given peer.
115 public final static class SendOpenChannel extends MessageSendEvent {
117 * The node_id of the node which should receive this message
119 public final byte[] node_id;
121 * The message which should be sent.
123 public final org.ldk.structs.OpenChannel msg;
124 private SendOpenChannel(long ptr, bindings.LDKMessageSendEvent.SendOpenChannel obj) {
126 this.node_id = obj.node_id;
128 OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new OpenChannel(null, msg); }
129 msg_hu_conv.ptrs_to.add(this);
130 this.msg = msg_hu_conv;
134 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
136 public final static class SendFundingCreated extends MessageSendEvent {
138 * The node_id of the node which should receive this message
140 public final byte[] node_id;
142 * The message which should be sent.
144 public final org.ldk.structs.FundingCreated msg;
145 private SendFundingCreated(long ptr, bindings.LDKMessageSendEvent.SendFundingCreated obj) {
147 this.node_id = obj.node_id;
149 FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingCreated(null, msg); }
150 msg_hu_conv.ptrs_to.add(this);
151 this.msg = msg_hu_conv;
155 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
157 public final static class SendFundingSigned extends MessageSendEvent {
159 * The node_id of the node which should receive this message
161 public final byte[] node_id;
163 * The message which should be sent.
165 public final org.ldk.structs.FundingSigned msg;
166 private SendFundingSigned(long ptr, bindings.LDKMessageSendEvent.SendFundingSigned obj) {
168 this.node_id = obj.node_id;
170 FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingSigned(null, msg); }
171 msg_hu_conv.ptrs_to.add(this);
172 this.msg = msg_hu_conv;
176 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
178 public final static class SendFundingLocked extends MessageSendEvent {
180 * The node_id of the node which should receive these message(s)
182 public final byte[] node_id;
184 * The funding_locked message which should be sent.
186 public final org.ldk.structs.FundingLocked msg;
187 private SendFundingLocked(long ptr, bindings.LDKMessageSendEvent.SendFundingLocked obj) {
189 this.node_id = obj.node_id;
191 FundingLocked msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingLocked(null, msg); }
192 msg_hu_conv.ptrs_to.add(this);
193 this.msg = msg_hu_conv;
197 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
199 public final static class SendAnnouncementSignatures extends MessageSendEvent {
201 * The node_id of the node which should receive these message(s)
203 public final byte[] node_id;
205 * The announcement_signatures message which should be sent.
207 public final org.ldk.structs.AnnouncementSignatures msg;
208 private SendAnnouncementSignatures(long ptr, bindings.LDKMessageSendEvent.SendAnnouncementSignatures obj) {
210 this.node_id = obj.node_id;
212 AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new AnnouncementSignatures(null, msg); }
213 msg_hu_conv.ptrs_to.add(this);
214 this.msg = msg_hu_conv;
218 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
219 * message should be sent to the peer with the given node_id.
221 public final static class UpdateHTLCs extends MessageSendEvent {
223 * The node_id of the node which should receive these message(s)
225 public final byte[] node_id;
227 * The update messages which should be sent. ALL messages in the struct should be sent!
229 public final org.ldk.structs.CommitmentUpdate updates;
230 private UpdateHTLCs(long ptr, bindings.LDKMessageSendEvent.UpdateHTLCs obj) {
232 this.node_id = obj.node_id;
233 long updates = obj.updates;
234 CommitmentUpdate updates_hu_conv = null; if (updates < 0 || updates > 4096) { updates_hu_conv = new CommitmentUpdate(null, updates); }
235 updates_hu_conv.ptrs_to.add(this);
236 this.updates = updates_hu_conv;
240 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
242 public final static class SendRevokeAndACK extends MessageSendEvent {
244 * The node_id of the node which should receive this message
246 public final byte[] node_id;
248 * The message which should be sent.
250 public final org.ldk.structs.RevokeAndACK msg;
251 private SendRevokeAndACK(long ptr, bindings.LDKMessageSendEvent.SendRevokeAndACK obj) {
253 this.node_id = obj.node_id;
255 RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new RevokeAndACK(null, msg); }
256 msg_hu_conv.ptrs_to.add(this);
257 this.msg = msg_hu_conv;
261 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
263 public final static class SendClosingSigned extends MessageSendEvent {
265 * The node_id of the node which should receive this message
267 public final byte[] node_id;
269 * The message which should be sent.
271 public final org.ldk.structs.ClosingSigned msg;
272 private SendClosingSigned(long ptr, bindings.LDKMessageSendEvent.SendClosingSigned obj) {
274 this.node_id = obj.node_id;
276 ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ClosingSigned(null, msg); }
277 msg_hu_conv.ptrs_to.add(this);
278 this.msg = msg_hu_conv;
282 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
284 public final static class SendShutdown extends MessageSendEvent {
286 * The node_id of the node which should receive this message
288 public final byte[] node_id;
290 * The message which should be sent.
292 public final org.ldk.structs.Shutdown msg;
293 private SendShutdown(long ptr, bindings.LDKMessageSendEvent.SendShutdown obj) {
295 this.node_id = obj.node_id;
297 Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new Shutdown(null, msg); }
298 msg_hu_conv.ptrs_to.add(this);
299 this.msg = msg_hu_conv;
303 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
305 public final static class SendChannelReestablish extends MessageSendEvent {
307 * The node_id of the node which should receive this message
309 public final byte[] node_id;
311 * The message which should be sent.
313 public final org.ldk.structs.ChannelReestablish msg;
314 private SendChannelReestablish(long ptr, bindings.LDKMessageSendEvent.SendChannelReestablish obj) {
316 this.node_id = obj.node_id;
318 ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelReestablish(null, msg); }
319 msg_hu_conv.ptrs_to.add(this);
320 this.msg = msg_hu_conv;
324 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
325 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
327 * Note that after doing so, you very likely (unless you did so very recently) want to call
328 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
329 * This ensures that any nodes which see our channel_announcement also have a relevant
330 * node_announcement, including relevant feature flags which may be important for routing
333 public final static class BroadcastChannelAnnouncement extends MessageSendEvent {
335 * The channel_announcement which should be sent.
337 public final org.ldk.structs.ChannelAnnouncement msg;
339 * The followup channel_update which should be sent.
341 public final org.ldk.structs.ChannelUpdate update_msg;
342 private BroadcastChannelAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement obj) {
345 ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelAnnouncement(null, msg); }
346 msg_hu_conv.ptrs_to.add(this);
347 this.msg = msg_hu_conv;
348 long update_msg = obj.update_msg;
349 ChannelUpdate update_msg_hu_conv = null; if (update_msg < 0 || update_msg > 4096) { update_msg_hu_conv = new ChannelUpdate(null, update_msg); }
350 update_msg_hu_conv.ptrs_to.add(this);
351 this.update_msg = update_msg_hu_conv;
355 * Used to indicate that a node_announcement should be broadcast to all peers.
357 public final static class BroadcastNodeAnnouncement extends MessageSendEvent {
359 * The node_announcement which should be sent.
361 public final org.ldk.structs.NodeAnnouncement msg;
362 private BroadcastNodeAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement obj) {
365 NodeAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new NodeAnnouncement(null, msg); }
366 msg_hu_conv.ptrs_to.add(this);
367 this.msg = msg_hu_conv;
371 * Used to indicate that a channel_update should be broadcast to all peers.
373 public final static class BroadcastChannelUpdate extends MessageSendEvent {
375 * The channel_update which should be sent.
377 public final org.ldk.structs.ChannelUpdate msg;
378 private BroadcastChannelUpdate(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelUpdate obj) {
381 ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelUpdate(null, msg); }
382 msg_hu_conv.ptrs_to.add(this);
383 this.msg = msg_hu_conv;
387 * Used to indicate that a channel_update should be sent to a single peer.
388 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
389 * private channel and we shouldn't be informing all of our peers of channel parameters.
391 public final static class SendChannelUpdate extends MessageSendEvent {
393 * The node_id of the node which should receive this message
395 public final byte[] node_id;
397 * The channel_update which should be sent.
399 public final org.ldk.structs.ChannelUpdate msg;
400 private SendChannelUpdate(long ptr, bindings.LDKMessageSendEvent.SendChannelUpdate obj) {
402 this.node_id = obj.node_id;
404 ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelUpdate(null, msg); }
405 msg_hu_conv.ptrs_to.add(this);
406 this.msg = msg_hu_conv;
410 * Broadcast an error downstream to be handled
412 public final static class HandleError extends MessageSendEvent {
414 * The node_id of the node which should receive this message
416 public final byte[] node_id;
418 * The action which should be taken.
420 public final org.ldk.structs.ErrorAction action;
421 private HandleError(long ptr, bindings.LDKMessageSendEvent.HandleError obj) {
423 this.node_id = obj.node_id;
424 long action = obj.action;
425 org.ldk.structs.ErrorAction action_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(action);
426 action_hu_conv.ptrs_to.add(this);
427 this.action = action_hu_conv;
431 * Query a peer for channels with funding transaction UTXOs in a block range.
433 public final static class SendChannelRangeQuery extends MessageSendEvent {
435 * The node_id of this message recipient
437 public final byte[] node_id;
439 * The query_channel_range which should be sent.
441 public final org.ldk.structs.QueryChannelRange msg;
442 private SendChannelRangeQuery(long ptr, bindings.LDKMessageSendEvent.SendChannelRangeQuery obj) {
444 this.node_id = obj.node_id;
446 QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new QueryChannelRange(null, msg); }
447 msg_hu_conv.ptrs_to.add(this);
448 this.msg = msg_hu_conv;
452 * Request routing gossip messages from a peer for a list of channels identified by
453 * their short_channel_ids.
455 public final static class SendShortIdsQuery extends MessageSendEvent {
457 * The node_id of this message recipient
459 public final byte[] node_id;
461 * The query_short_channel_ids which should be sent.
463 public final org.ldk.structs.QueryShortChannelIds msg;
464 private SendShortIdsQuery(long ptr, bindings.LDKMessageSendEvent.SendShortIdsQuery obj) {
466 this.node_id = obj.node_id;
468 QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new QueryShortChannelIds(null, msg); }
469 msg_hu_conv.ptrs_to.add(this);
470 this.msg = msg_hu_conv;
474 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
475 * emitted during processing of the query.
477 public final static class SendReplyChannelRange extends MessageSendEvent {
479 * The node_id of this message recipient
481 public final byte[] node_id;
483 * The reply_channel_range which should be sent.
485 public final org.ldk.structs.ReplyChannelRange msg;
486 private SendReplyChannelRange(long ptr, bindings.LDKMessageSendEvent.SendReplyChannelRange obj) {
488 this.node_id = obj.node_id;
490 ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ReplyChannelRange(null, msg); }
491 msg_hu_conv.ptrs_to.add(this);
492 this.msg = msg_hu_conv;
496 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
497 * enable receiving gossip messages from the peer.
499 public final static class SendGossipTimestampFilter extends MessageSendEvent {
501 * The node_id of this message recipient
503 public final byte[] node_id;
505 * The gossip_timestamp_filter which should be sent.
507 public final org.ldk.structs.GossipTimestampFilter msg;
508 private SendGossipTimestampFilter(long ptr, bindings.LDKMessageSendEvent.SendGossipTimestampFilter obj) {
510 this.node_id = obj.node_id;
512 GossipTimestampFilter msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new GossipTimestampFilter(null, msg); }
513 msg_hu_conv.ptrs_to.add(this);
514 this.msg = msg_hu_conv;
518 long ret = bindings.MessageSendEvent_clone_ptr(this.ptr);
519 Reference.reachabilityFence(this);
524 * Creates a copy of the MessageSendEvent
526 public MessageSendEvent clone() {
527 long ret = bindings.MessageSendEvent_clone(this.ptr);
528 Reference.reachabilityFence(this);
529 if (ret >= 0 && ret <= 4096) { return null; }
530 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
531 ret_hu_conv.ptrs_to.add(this);
536 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
538 public static MessageSendEvent send_accept_channel(byte[] node_id, AcceptChannel msg) {
539 long ret = bindings.MessageSendEvent_send_accept_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
540 Reference.reachabilityFence(node_id);
541 Reference.reachabilityFence(msg);
542 if (ret >= 0 && ret <= 4096) { return null; }
543 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
544 ret_hu_conv.ptrs_to.add(ret_hu_conv);
549 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
551 public static MessageSendEvent send_open_channel(byte[] node_id, OpenChannel msg) {
552 long ret = bindings.MessageSendEvent_send_open_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
553 Reference.reachabilityFence(node_id);
554 Reference.reachabilityFence(msg);
555 if (ret >= 0 && ret <= 4096) { return null; }
556 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
557 ret_hu_conv.ptrs_to.add(ret_hu_conv);
562 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
564 public static MessageSendEvent send_funding_created(byte[] node_id, FundingCreated msg) {
565 long ret = bindings.MessageSendEvent_send_funding_created(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
566 Reference.reachabilityFence(node_id);
567 Reference.reachabilityFence(msg);
568 if (ret >= 0 && ret <= 4096) { return null; }
569 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
570 ret_hu_conv.ptrs_to.add(ret_hu_conv);
575 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
577 public static MessageSendEvent send_funding_signed(byte[] node_id, FundingSigned msg) {
578 long ret = bindings.MessageSendEvent_send_funding_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
579 Reference.reachabilityFence(node_id);
580 Reference.reachabilityFence(msg);
581 if (ret >= 0 && ret <= 4096) { return null; }
582 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
583 ret_hu_conv.ptrs_to.add(ret_hu_conv);
588 * Utility method to constructs a new SendFundingLocked-variant MessageSendEvent
590 public static MessageSendEvent send_funding_locked(byte[] node_id, FundingLocked msg) {
591 long ret = bindings.MessageSendEvent_send_funding_locked(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
592 Reference.reachabilityFence(node_id);
593 Reference.reachabilityFence(msg);
594 if (ret >= 0 && ret <= 4096) { return null; }
595 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
596 ret_hu_conv.ptrs_to.add(ret_hu_conv);
601 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
603 public static MessageSendEvent send_announcement_signatures(byte[] node_id, AnnouncementSignatures msg) {
604 long ret = bindings.MessageSendEvent_send_announcement_signatures(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
605 Reference.reachabilityFence(node_id);
606 Reference.reachabilityFence(msg);
607 if (ret >= 0 && ret <= 4096) { return null; }
608 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
609 ret_hu_conv.ptrs_to.add(ret_hu_conv);
614 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
616 public static MessageSendEvent update_htlcs(byte[] node_id, CommitmentUpdate updates) {
617 long ret = bindings.MessageSendEvent_update_htlcs(InternalUtils.check_arr_len(node_id, 33), updates == null ? 0 : updates.ptr & ~1);
618 Reference.reachabilityFence(node_id);
619 Reference.reachabilityFence(updates);
620 if (ret >= 0 && ret <= 4096) { return null; }
621 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
622 ret_hu_conv.ptrs_to.add(ret_hu_conv);
627 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
629 public static MessageSendEvent send_revoke_and_ack(byte[] node_id, RevokeAndACK msg) {
630 long ret = bindings.MessageSendEvent_send_revoke_and_ack(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
631 Reference.reachabilityFence(node_id);
632 Reference.reachabilityFence(msg);
633 if (ret >= 0 && ret <= 4096) { return null; }
634 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
635 ret_hu_conv.ptrs_to.add(ret_hu_conv);
640 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
642 public static MessageSendEvent send_closing_signed(byte[] node_id, ClosingSigned msg) {
643 long ret = bindings.MessageSendEvent_send_closing_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
644 Reference.reachabilityFence(node_id);
645 Reference.reachabilityFence(msg);
646 if (ret >= 0 && ret <= 4096) { return null; }
647 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
648 ret_hu_conv.ptrs_to.add(ret_hu_conv);
653 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
655 public static MessageSendEvent send_shutdown(byte[] node_id, Shutdown msg) {
656 long ret = bindings.MessageSendEvent_send_shutdown(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
657 Reference.reachabilityFence(node_id);
658 Reference.reachabilityFence(msg);
659 if (ret >= 0 && ret <= 4096) { return null; }
660 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
661 ret_hu_conv.ptrs_to.add(ret_hu_conv);
666 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
668 public static MessageSendEvent send_channel_reestablish(byte[] node_id, ChannelReestablish msg) {
669 long ret = bindings.MessageSendEvent_send_channel_reestablish(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
670 Reference.reachabilityFence(node_id);
671 Reference.reachabilityFence(msg);
672 if (ret >= 0 && ret <= 4096) { return null; }
673 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
674 ret_hu_conv.ptrs_to.add(ret_hu_conv);
679 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
681 public static MessageSendEvent broadcast_channel_announcement(ChannelAnnouncement msg, ChannelUpdate update_msg) {
682 long ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : msg.ptr & ~1, update_msg == null ? 0 : update_msg.ptr & ~1);
683 Reference.reachabilityFence(msg);
684 Reference.reachabilityFence(update_msg);
685 if (ret >= 0 && ret <= 4096) { return null; }
686 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
687 ret_hu_conv.ptrs_to.add(ret_hu_conv);
692 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
694 public static MessageSendEvent broadcast_node_announcement(NodeAnnouncement msg) {
695 long ret = bindings.MessageSendEvent_broadcast_node_announcement(msg == null ? 0 : msg.ptr & ~1);
696 Reference.reachabilityFence(msg);
697 if (ret >= 0 && ret <= 4096) { return null; }
698 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
699 ret_hu_conv.ptrs_to.add(ret_hu_conv);
704 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
706 public static MessageSendEvent broadcast_channel_update(ChannelUpdate msg) {
707 long ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr & ~1);
708 Reference.reachabilityFence(msg);
709 if (ret >= 0 && ret <= 4096) { return null; }
710 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
711 ret_hu_conv.ptrs_to.add(ret_hu_conv);
716 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
718 public static MessageSendEvent send_channel_update(byte[] node_id, ChannelUpdate msg) {
719 long ret = bindings.MessageSendEvent_send_channel_update(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
720 Reference.reachabilityFence(node_id);
721 Reference.reachabilityFence(msg);
722 if (ret >= 0 && ret <= 4096) { return null; }
723 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
724 ret_hu_conv.ptrs_to.add(ret_hu_conv);
729 * Utility method to constructs a new HandleError-variant MessageSendEvent
731 public static MessageSendEvent handle_error(byte[] node_id, ErrorAction action) {
732 long ret = bindings.MessageSendEvent_handle_error(InternalUtils.check_arr_len(node_id, 33), action.ptr);
733 Reference.reachabilityFence(node_id);
734 Reference.reachabilityFence(action);
735 if (ret >= 0 && ret <= 4096) { return null; }
736 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
737 ret_hu_conv.ptrs_to.add(ret_hu_conv);
742 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
744 public static MessageSendEvent send_channel_range_query(byte[] node_id, QueryChannelRange msg) {
745 long ret = bindings.MessageSendEvent_send_channel_range_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
746 Reference.reachabilityFence(node_id);
747 Reference.reachabilityFence(msg);
748 if (ret >= 0 && ret <= 4096) { return null; }
749 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
750 ret_hu_conv.ptrs_to.add(ret_hu_conv);
755 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
757 public static MessageSendEvent send_short_ids_query(byte[] node_id, QueryShortChannelIds msg) {
758 long ret = bindings.MessageSendEvent_send_short_ids_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
759 Reference.reachabilityFence(node_id);
760 Reference.reachabilityFence(msg);
761 if (ret >= 0 && ret <= 4096) { return null; }
762 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
763 ret_hu_conv.ptrs_to.add(ret_hu_conv);
768 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
770 public static MessageSendEvent send_reply_channel_range(byte[] node_id, ReplyChannelRange msg) {
771 long ret = bindings.MessageSendEvent_send_reply_channel_range(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
772 Reference.reachabilityFence(node_id);
773 Reference.reachabilityFence(msg);
774 if (ret >= 0 && ret <= 4096) { return null; }
775 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
776 ret_hu_conv.ptrs_to.add(ret_hu_conv);
781 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
783 public static MessageSendEvent send_gossip_timestamp_filter(byte[] node_id, GossipTimestampFilter msg) {
784 long ret = bindings.MessageSendEvent_send_gossip_timestamp_filter(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
785 Reference.reachabilityFence(node_id);
786 Reference.reachabilityFence(msg);
787 if (ret >= 0 && ret <= 4096) { return null; }
788 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
789 ret_hu_conv.ptrs_to.add(ret_hu_conv);