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.SendChannelReady.class) {
39 return new SendChannelReady(ptr, (bindings.LDKMessageSendEvent.SendChannelReady)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.SendChannelAnnouncement.class) {
60 return new SendChannelAnnouncement(ptr, (bindings.LDKMessageSendEvent.SendChannelAnnouncement)raw_val);
62 if (raw_val.getClass() == bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement.class) {
63 return new BroadcastChannelAnnouncement(ptr, (bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement)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 org.ldk.structs.AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannel(null, msg); }
107 if (msg_hu_conv != null) { 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 org.ldk.structs.OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannel(null, msg); }
129 if (msg_hu_conv != null) { 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 org.ldk.structs.FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingCreated(null, msg); }
150 if (msg_hu_conv != null) { 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 org.ldk.structs.FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingSigned(null, msg); }
171 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
172 this.msg = msg_hu_conv;
176 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
178 public final static class SendChannelReady extends MessageSendEvent {
180 * The node_id of the node which should receive these message(s)
182 public final byte[] node_id;
184 * The channel_ready message which should be sent.
186 public final org.ldk.structs.ChannelReady msg;
187 private SendChannelReady(long ptr, bindings.LDKMessageSendEvent.SendChannelReady obj) {
189 this.node_id = obj.node_id;
191 org.ldk.structs.ChannelReady msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReady(null, msg); }
192 if (msg_hu_conv != null) { 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 org.ldk.structs.AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, msg); }
213 if (msg_hu_conv != null) { 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 org.ldk.structs.CommitmentUpdate updates_hu_conv = null; if (updates < 0 || updates > 4096) { updates_hu_conv = new org.ldk.structs.CommitmentUpdate(null, updates); }
235 if (updates_hu_conv != null) { 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 org.ldk.structs.RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.RevokeAndACK(null, msg); }
256 if (msg_hu_conv != null) { 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 org.ldk.structs.ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ClosingSigned(null, msg); }
277 if (msg_hu_conv != null) { 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 org.ldk.structs.Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Shutdown(null, msg); }
298 if (msg_hu_conv != null) { 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 org.ldk.structs.ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReestablish(null, msg); }
319 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
320 this.msg = msg_hu_conv;
324 * Used to send a channel_announcement and channel_update to a specific peer, likely on
325 * initial connection to ensure our peers know about our channels.
327 public final static class SendChannelAnnouncement extends MessageSendEvent {
329 * The node_id of the node which should receive this message
331 public final byte[] node_id;
333 * The channel_announcement which should be sent.
335 public final org.ldk.structs.ChannelAnnouncement msg;
337 * The followup channel_update which should be sent.
339 public final org.ldk.structs.ChannelUpdate update_msg;
340 private SendChannelAnnouncement(long ptr, bindings.LDKMessageSendEvent.SendChannelAnnouncement obj) {
342 this.node_id = obj.node_id;
344 org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); }
345 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
346 this.msg = msg_hu_conv;
347 long update_msg = obj.update_msg;
348 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); }
349 if (update_msg_hu_conv != null) { update_msg_hu_conv.ptrs_to.add(this); };
350 this.update_msg = update_msg_hu_conv;
354 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
355 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
357 * Note that after doing so, you very likely (unless you did so very recently) want to
358 * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
359 * ensures that any nodes which see our channel_announcement also have a relevant
360 * node_announcement, including relevant feature flags which may be important for routing
363 * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
365 public final static class BroadcastChannelAnnouncement extends MessageSendEvent {
367 * The channel_announcement which should be sent.
369 public final org.ldk.structs.ChannelAnnouncement msg;
371 * The followup channel_update which should be sent.
373 public final org.ldk.structs.ChannelUpdate update_msg;
374 private BroadcastChannelAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement obj) {
377 org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); }
378 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
379 this.msg = msg_hu_conv;
380 long update_msg = obj.update_msg;
381 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); }
382 if (update_msg_hu_conv != null) { update_msg_hu_conv.ptrs_to.add(this); };
383 this.update_msg = update_msg_hu_conv;
387 * Used to indicate that a channel_update should be broadcast to all peers.
389 public final static class BroadcastChannelUpdate extends MessageSendEvent {
391 * The channel_update which should be sent.
393 public final org.ldk.structs.ChannelUpdate msg;
394 private BroadcastChannelUpdate(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelUpdate obj) {
397 org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); }
398 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
399 this.msg = msg_hu_conv;
403 * Used to indicate that a channel_update should be sent to a single peer.
404 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
405 * private channel and we shouldn't be informing all of our peers of channel parameters.
407 public final static class SendChannelUpdate extends MessageSendEvent {
409 * The node_id of the node which should receive this message
411 public final byte[] node_id;
413 * The channel_update which should be sent.
415 public final org.ldk.structs.ChannelUpdate msg;
416 private SendChannelUpdate(long ptr, bindings.LDKMessageSendEvent.SendChannelUpdate obj) {
418 this.node_id = obj.node_id;
420 org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); }
421 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
422 this.msg = msg_hu_conv;
426 * Broadcast an error downstream to be handled
428 public final static class HandleError extends MessageSendEvent {
430 * The node_id of the node which should receive this message
432 public final byte[] node_id;
434 * The action which should be taken.
436 public final org.ldk.structs.ErrorAction action;
437 private HandleError(long ptr, bindings.LDKMessageSendEvent.HandleError obj) {
439 this.node_id = obj.node_id;
440 long action = obj.action;
441 org.ldk.structs.ErrorAction action_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(action);
442 if (action_hu_conv != null) { action_hu_conv.ptrs_to.add(this); };
443 this.action = action_hu_conv;
447 * Query a peer for channels with funding transaction UTXOs in a block range.
449 public final static class SendChannelRangeQuery extends MessageSendEvent {
451 * The node_id of this message recipient
453 public final byte[] node_id;
455 * The query_channel_range which should be sent.
457 public final org.ldk.structs.QueryChannelRange msg;
458 private SendChannelRangeQuery(long ptr, bindings.LDKMessageSendEvent.SendChannelRangeQuery obj) {
460 this.node_id = obj.node_id;
462 org.ldk.structs.QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryChannelRange(null, msg); }
463 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
464 this.msg = msg_hu_conv;
468 * Request routing gossip messages from a peer for a list of channels identified by
469 * their short_channel_ids.
471 public final static class SendShortIdsQuery extends MessageSendEvent {
473 * The node_id of this message recipient
475 public final byte[] node_id;
477 * The query_short_channel_ids which should be sent.
479 public final org.ldk.structs.QueryShortChannelIds msg;
480 private SendShortIdsQuery(long ptr, bindings.LDKMessageSendEvent.SendShortIdsQuery obj) {
482 this.node_id = obj.node_id;
484 org.ldk.structs.QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, msg); }
485 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
486 this.msg = msg_hu_conv;
490 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
491 * emitted during processing of the query.
493 public final static class SendReplyChannelRange extends MessageSendEvent {
495 * The node_id of this message recipient
497 public final byte[] node_id;
499 * The reply_channel_range which should be sent.
501 public final org.ldk.structs.ReplyChannelRange msg;
502 private SendReplyChannelRange(long ptr, bindings.LDKMessageSendEvent.SendReplyChannelRange obj) {
504 this.node_id = obj.node_id;
506 org.ldk.structs.ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ReplyChannelRange(null, msg); }
507 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
508 this.msg = msg_hu_conv;
512 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
513 * enable receiving gossip messages from the peer.
515 public final static class SendGossipTimestampFilter extends MessageSendEvent {
517 * The node_id of this message recipient
519 public final byte[] node_id;
521 * The gossip_timestamp_filter which should be sent.
523 public final org.ldk.structs.GossipTimestampFilter msg;
524 private SendGossipTimestampFilter(long ptr, bindings.LDKMessageSendEvent.SendGossipTimestampFilter obj) {
526 this.node_id = obj.node_id;
528 org.ldk.structs.GossipTimestampFilter msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.GossipTimestampFilter(null, msg); }
529 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
530 this.msg = msg_hu_conv;
534 long ret = bindings.MessageSendEvent_clone_ptr(this.ptr);
535 Reference.reachabilityFence(this);
540 * Creates a copy of the MessageSendEvent
542 public MessageSendEvent clone() {
543 long ret = bindings.MessageSendEvent_clone(this.ptr);
544 Reference.reachabilityFence(this);
545 if (ret >= 0 && ret <= 4096) { return null; }
546 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
547 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
552 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
554 public static MessageSendEvent send_accept_channel(byte[] node_id, AcceptChannel msg) {
555 long ret = bindings.MessageSendEvent_send_accept_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
556 Reference.reachabilityFence(node_id);
557 Reference.reachabilityFence(msg);
558 if (ret >= 0 && ret <= 4096) { return null; }
559 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
560 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
561 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
566 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
568 public static MessageSendEvent send_open_channel(byte[] node_id, OpenChannel msg) {
569 long ret = bindings.MessageSendEvent_send_open_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
570 Reference.reachabilityFence(node_id);
571 Reference.reachabilityFence(msg);
572 if (ret >= 0 && ret <= 4096) { return null; }
573 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
574 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
575 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
580 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
582 public static MessageSendEvent send_funding_created(byte[] node_id, FundingCreated msg) {
583 long ret = bindings.MessageSendEvent_send_funding_created(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
584 Reference.reachabilityFence(node_id);
585 Reference.reachabilityFence(msg);
586 if (ret >= 0 && ret <= 4096) { return null; }
587 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
588 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
589 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
594 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
596 public static MessageSendEvent send_funding_signed(byte[] node_id, FundingSigned msg) {
597 long ret = bindings.MessageSendEvent_send_funding_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
598 Reference.reachabilityFence(node_id);
599 Reference.reachabilityFence(msg);
600 if (ret >= 0 && ret <= 4096) { return null; }
601 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
602 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
603 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
608 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
610 public static MessageSendEvent send_channel_ready(byte[] node_id, ChannelReady msg) {
611 long ret = bindings.MessageSendEvent_send_channel_ready(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
612 Reference.reachabilityFence(node_id);
613 Reference.reachabilityFence(msg);
614 if (ret >= 0 && ret <= 4096) { return null; }
615 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
616 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
617 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
622 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
624 public static MessageSendEvent send_announcement_signatures(byte[] node_id, AnnouncementSignatures msg) {
625 long ret = bindings.MessageSendEvent_send_announcement_signatures(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
626 Reference.reachabilityFence(node_id);
627 Reference.reachabilityFence(msg);
628 if (ret >= 0 && ret <= 4096) { return null; }
629 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
630 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
631 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
636 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
638 public static MessageSendEvent update_htlcs(byte[] node_id, CommitmentUpdate updates) {
639 long ret = bindings.MessageSendEvent_update_htlcs(InternalUtils.check_arr_len(node_id, 33), updates == null ? 0 : updates.ptr);
640 Reference.reachabilityFence(node_id);
641 Reference.reachabilityFence(updates);
642 if (ret >= 0 && ret <= 4096) { return null; }
643 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
644 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
645 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(updates); };
650 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
652 public static MessageSendEvent send_revoke_and_ack(byte[] node_id, RevokeAndACK msg) {
653 long ret = bindings.MessageSendEvent_send_revoke_and_ack(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
654 Reference.reachabilityFence(node_id);
655 Reference.reachabilityFence(msg);
656 if (ret >= 0 && ret <= 4096) { return null; }
657 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
658 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
659 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
664 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
666 public static MessageSendEvent send_closing_signed(byte[] node_id, ClosingSigned msg) {
667 long ret = bindings.MessageSendEvent_send_closing_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
668 Reference.reachabilityFence(node_id);
669 Reference.reachabilityFence(msg);
670 if (ret >= 0 && ret <= 4096) { return null; }
671 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
672 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
673 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
678 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
680 public static MessageSendEvent send_shutdown(byte[] node_id, Shutdown msg) {
681 long ret = bindings.MessageSendEvent_send_shutdown(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
682 Reference.reachabilityFence(node_id);
683 Reference.reachabilityFence(msg);
684 if (ret >= 0 && ret <= 4096) { return null; }
685 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
686 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
687 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
692 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
694 public static MessageSendEvent send_channel_reestablish(byte[] node_id, ChannelReestablish msg) {
695 long ret = bindings.MessageSendEvent_send_channel_reestablish(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
696 Reference.reachabilityFence(node_id);
697 Reference.reachabilityFence(msg);
698 if (ret >= 0 && ret <= 4096) { return null; }
699 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
700 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
701 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
706 * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
708 public static MessageSendEvent send_channel_announcement(byte[] node_id, ChannelAnnouncement msg, ChannelUpdate update_msg) {
709 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);
710 Reference.reachabilityFence(node_id);
711 Reference.reachabilityFence(msg);
712 Reference.reachabilityFence(update_msg);
713 if (ret >= 0 && ret <= 4096) { return null; }
714 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
715 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
716 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
717 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(update_msg); };
722 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
724 public static MessageSendEvent broadcast_channel_announcement(ChannelAnnouncement msg, ChannelUpdate update_msg) {
725 long ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : msg.ptr, update_msg == null ? 0 : update_msg.ptr);
726 Reference.reachabilityFence(msg);
727 Reference.reachabilityFence(update_msg);
728 if (ret >= 0 && ret <= 4096) { return null; }
729 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
730 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
731 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
732 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(update_msg); };
737 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
739 public static MessageSendEvent broadcast_channel_update(ChannelUpdate msg) {
740 long ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr);
741 Reference.reachabilityFence(msg);
742 if (ret >= 0 && ret <= 4096) { return null; }
743 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
744 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
745 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
750 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
752 public static MessageSendEvent send_channel_update(byte[] node_id, ChannelUpdate msg) {
753 long ret = bindings.MessageSendEvent_send_channel_update(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
754 Reference.reachabilityFence(node_id);
755 Reference.reachabilityFence(msg);
756 if (ret >= 0 && ret <= 4096) { return null; }
757 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
758 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
759 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
764 * Utility method to constructs a new HandleError-variant MessageSendEvent
766 public static MessageSendEvent handle_error(byte[] node_id, ErrorAction action) {
767 long ret = bindings.MessageSendEvent_handle_error(InternalUtils.check_arr_len(node_id, 33), action.ptr);
768 Reference.reachabilityFence(node_id);
769 Reference.reachabilityFence(action);
770 if (ret >= 0 && ret <= 4096) { return null; }
771 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
772 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
777 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
779 public static MessageSendEvent send_channel_range_query(byte[] node_id, QueryChannelRange msg) {
780 long ret = bindings.MessageSendEvent_send_channel_range_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
781 Reference.reachabilityFence(node_id);
782 Reference.reachabilityFence(msg);
783 if (ret >= 0 && ret <= 4096) { return null; }
784 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
785 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
786 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
791 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
793 public static MessageSendEvent send_short_ids_query(byte[] node_id, QueryShortChannelIds msg) {
794 long ret = bindings.MessageSendEvent_send_short_ids_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
795 Reference.reachabilityFence(node_id);
796 Reference.reachabilityFence(msg);
797 if (ret >= 0 && ret <= 4096) { return null; }
798 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
799 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
800 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
805 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
807 public static MessageSendEvent send_reply_channel_range(byte[] node_id, ReplyChannelRange msg) {
808 long ret = bindings.MessageSendEvent_send_reply_channel_range(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
809 Reference.reachabilityFence(node_id);
810 Reference.reachabilityFence(msg);
811 if (ret >= 0 && ret <= 4096) { return null; }
812 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
813 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
814 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
819 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
821 public static MessageSendEvent send_gossip_timestamp_filter(byte[] node_id, GossipTimestampFilter msg) {
822 long ret = bindings.MessageSendEvent_send_gossip_timestamp_filter(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
823 Reference.reachabilityFence(node_id);
824 Reference.reachabilityFence(msg);
825 if (ret >= 0 && ret <= 4096) { return null; }
826 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
827 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
828 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };