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.PaymentFailureNetworkUpdate.class) {
74 return new PaymentFailureNetworkUpdate(ptr, (bindings.LDKMessageSendEvent.PaymentFailureNetworkUpdate)raw_val);
76 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelRangeQuery.class) {
77 return new SendChannelRangeQuery(ptr, (bindings.LDKMessageSendEvent.SendChannelRangeQuery)raw_val);
79 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendShortIdsQuery.class) {
80 return new SendShortIdsQuery(ptr, (bindings.LDKMessageSendEvent.SendShortIdsQuery)raw_val);
82 if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendReplyChannelRange.class) {
83 return new SendReplyChannelRange(ptr, (bindings.LDKMessageSendEvent.SendReplyChannelRange)raw_val);
85 assert false; return null; // Unreachable without extending the (internal) bindings interface
88 public final static class SendAcceptChannel extends MessageSendEvent {
90 * The node_id of the node which should receive this message
92 public final byte[] node_id;
94 * The message which should be sent.
96 public final AcceptChannel msg;
97 private SendAcceptChannel(long ptr, bindings.LDKMessageSendEvent.SendAcceptChannel obj) {
99 this.node_id = obj.node_id;
101 AcceptChannel msg_hu_conv = new AcceptChannel(null, msg);
102 msg_hu_conv.ptrs_to.add(this);
103 this.msg = msg_hu_conv;
106 public final static class SendOpenChannel extends MessageSendEvent {
108 * The node_id of the node which should receive this message
110 public final byte[] node_id;
112 * The message which should be sent.
114 public final OpenChannel msg;
115 private SendOpenChannel(long ptr, bindings.LDKMessageSendEvent.SendOpenChannel obj) {
117 this.node_id = obj.node_id;
119 OpenChannel msg_hu_conv = new OpenChannel(null, msg);
120 msg_hu_conv.ptrs_to.add(this);
121 this.msg = msg_hu_conv;
124 public final static class SendFundingCreated extends MessageSendEvent {
126 * The node_id of the node which should receive this message
128 public final byte[] node_id;
130 * The message which should be sent.
132 public final FundingCreated msg;
133 private SendFundingCreated(long ptr, bindings.LDKMessageSendEvent.SendFundingCreated obj) {
135 this.node_id = obj.node_id;
137 FundingCreated msg_hu_conv = new FundingCreated(null, msg);
138 msg_hu_conv.ptrs_to.add(this);
139 this.msg = msg_hu_conv;
142 public final static class SendFundingSigned extends MessageSendEvent {
144 * The node_id of the node which should receive this message
146 public final byte[] node_id;
148 * The message which should be sent.
150 public final FundingSigned msg;
151 private SendFundingSigned(long ptr, bindings.LDKMessageSendEvent.SendFundingSigned obj) {
153 this.node_id = obj.node_id;
155 FundingSigned msg_hu_conv = new FundingSigned(null, msg);
156 msg_hu_conv.ptrs_to.add(this);
157 this.msg = msg_hu_conv;
160 public final static class SendFundingLocked extends MessageSendEvent {
162 * The node_id of the node which should receive these message(s)
164 public final byte[] node_id;
166 * The funding_locked message which should be sent.
168 public final FundingLocked msg;
169 private SendFundingLocked(long ptr, bindings.LDKMessageSendEvent.SendFundingLocked obj) {
171 this.node_id = obj.node_id;
173 FundingLocked msg_hu_conv = new FundingLocked(null, msg);
174 msg_hu_conv.ptrs_to.add(this);
175 this.msg = msg_hu_conv;
178 public final static class SendAnnouncementSignatures extends MessageSendEvent {
180 * The node_id of the node which should receive these message(s)
182 public final byte[] node_id;
184 * The announcement_signatures message which should be sent.
186 public final AnnouncementSignatures msg;
187 private SendAnnouncementSignatures(long ptr, bindings.LDKMessageSendEvent.SendAnnouncementSignatures obj) {
189 this.node_id = obj.node_id;
191 AnnouncementSignatures msg_hu_conv = new AnnouncementSignatures(null, msg);
192 msg_hu_conv.ptrs_to.add(this);
193 this.msg = msg_hu_conv;
196 public final static class UpdateHTLCs extends MessageSendEvent {
198 * The node_id of the node which should receive these message(s)
200 public final byte[] node_id;
202 * The update messages which should be sent. ALL messages in the struct should be sent!
204 public final CommitmentUpdate updates;
205 private UpdateHTLCs(long ptr, bindings.LDKMessageSendEvent.UpdateHTLCs obj) {
207 this.node_id = obj.node_id;
208 long updates = obj.updates;
209 CommitmentUpdate updates_hu_conv = new CommitmentUpdate(null, updates);
210 updates_hu_conv.ptrs_to.add(this);
211 this.updates = updates_hu_conv;
214 public final static class SendRevokeAndACK extends MessageSendEvent {
216 * The node_id of the node which should receive this message
218 public final byte[] node_id;
220 * The message which should be sent.
222 public final RevokeAndACK msg;
223 private SendRevokeAndACK(long ptr, bindings.LDKMessageSendEvent.SendRevokeAndACK obj) {
225 this.node_id = obj.node_id;
227 RevokeAndACK msg_hu_conv = new RevokeAndACK(null, msg);
228 msg_hu_conv.ptrs_to.add(this);
229 this.msg = msg_hu_conv;
232 public final static class SendClosingSigned extends MessageSendEvent {
234 * The node_id of the node which should receive this message
236 public final byte[] node_id;
238 * The message which should be sent.
240 public final ClosingSigned msg;
241 private SendClosingSigned(long ptr, bindings.LDKMessageSendEvent.SendClosingSigned obj) {
243 this.node_id = obj.node_id;
245 ClosingSigned msg_hu_conv = new ClosingSigned(null, msg);
246 msg_hu_conv.ptrs_to.add(this);
247 this.msg = msg_hu_conv;
250 public final static class SendShutdown extends MessageSendEvent {
252 * The node_id of the node which should receive this message
254 public final byte[] node_id;
256 * The message which should be sent.
258 public final Shutdown msg;
259 private SendShutdown(long ptr, bindings.LDKMessageSendEvent.SendShutdown obj) {
261 this.node_id = obj.node_id;
263 Shutdown msg_hu_conv = new Shutdown(null, msg);
264 msg_hu_conv.ptrs_to.add(this);
265 this.msg = msg_hu_conv;
268 public final static class SendChannelReestablish extends MessageSendEvent {
270 * The node_id of the node which should receive this message
272 public final byte[] node_id;
274 * The message which should be sent.
276 public final ChannelReestablish msg;
277 private SendChannelReestablish(long ptr, bindings.LDKMessageSendEvent.SendChannelReestablish obj) {
279 this.node_id = obj.node_id;
281 ChannelReestablish msg_hu_conv = new ChannelReestablish(null, msg);
282 msg_hu_conv.ptrs_to.add(this);
283 this.msg = msg_hu_conv;
286 public final static class BroadcastChannelAnnouncement extends MessageSendEvent {
288 * The channel_announcement which should be sent.
290 public final ChannelAnnouncement msg;
292 * The followup channel_update which should be sent.
294 public final ChannelUpdate update_msg;
295 private BroadcastChannelAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement obj) {
298 ChannelAnnouncement msg_hu_conv = new ChannelAnnouncement(null, msg);
299 msg_hu_conv.ptrs_to.add(this);
300 this.msg = msg_hu_conv;
301 long update_msg = obj.update_msg;
302 ChannelUpdate update_msg_hu_conv = new ChannelUpdate(null, update_msg);
303 update_msg_hu_conv.ptrs_to.add(this);
304 this.update_msg = update_msg_hu_conv;
307 public final static class BroadcastNodeAnnouncement extends MessageSendEvent {
309 * The node_announcement which should be sent.
311 public final NodeAnnouncement msg;
312 private BroadcastNodeAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement obj) {
315 NodeAnnouncement msg_hu_conv = new NodeAnnouncement(null, msg);
316 msg_hu_conv.ptrs_to.add(this);
317 this.msg = msg_hu_conv;
320 public final static class BroadcastChannelUpdate extends MessageSendEvent {
322 * The channel_update which should be sent.
324 public final ChannelUpdate msg;
325 private BroadcastChannelUpdate(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelUpdate obj) {
328 ChannelUpdate msg_hu_conv = new ChannelUpdate(null, msg);
329 msg_hu_conv.ptrs_to.add(this);
330 this.msg = msg_hu_conv;
333 public final static class SendChannelUpdate extends MessageSendEvent {
335 * The node_id of the node which should receive this message
337 public final byte[] node_id;
339 * The channel_update which should be sent.
341 public final ChannelUpdate msg;
342 private SendChannelUpdate(long ptr, bindings.LDKMessageSendEvent.SendChannelUpdate obj) {
344 this.node_id = obj.node_id;
346 ChannelUpdate msg_hu_conv = new ChannelUpdate(null, msg);
347 msg_hu_conv.ptrs_to.add(this);
348 this.msg = msg_hu_conv;
351 public final static class HandleError extends MessageSendEvent {
353 * The node_id of the node which should receive this message
355 public final byte[] node_id;
357 * The action which should be taken.
359 public final ErrorAction action;
360 private HandleError(long ptr, bindings.LDKMessageSendEvent.HandleError obj) {
362 this.node_id = obj.node_id;
363 long action = obj.action;
364 ErrorAction action_hu_conv = ErrorAction.constr_from_ptr(action);
365 action_hu_conv.ptrs_to.add(this);
366 this.action = action_hu_conv;
369 public final static class PaymentFailureNetworkUpdate extends MessageSendEvent {
371 * The channel/node update which should be sent to NetGraphMsgHandler
373 public final HTLCFailChannelUpdate update;
374 private PaymentFailureNetworkUpdate(long ptr, bindings.LDKMessageSendEvent.PaymentFailureNetworkUpdate obj) {
376 long update = obj.update;
377 HTLCFailChannelUpdate update_hu_conv = HTLCFailChannelUpdate.constr_from_ptr(update);
378 update_hu_conv.ptrs_to.add(this);
379 this.update = update_hu_conv;
382 public final static class SendChannelRangeQuery extends MessageSendEvent {
384 * The node_id of this message recipient
386 public final byte[] node_id;
388 * The query_channel_range which should be sent.
390 public final QueryChannelRange msg;
391 private SendChannelRangeQuery(long ptr, bindings.LDKMessageSendEvent.SendChannelRangeQuery obj) {
393 this.node_id = obj.node_id;
395 QueryChannelRange msg_hu_conv = new QueryChannelRange(null, msg);
396 msg_hu_conv.ptrs_to.add(this);
397 this.msg = msg_hu_conv;
400 public final static class SendShortIdsQuery extends MessageSendEvent {
402 * The node_id of this message recipient
404 public final byte[] node_id;
406 * The query_short_channel_ids which should be sent.
408 public final QueryShortChannelIds msg;
409 private SendShortIdsQuery(long ptr, bindings.LDKMessageSendEvent.SendShortIdsQuery obj) {
411 this.node_id = obj.node_id;
413 QueryShortChannelIds msg_hu_conv = new QueryShortChannelIds(null, msg);
414 msg_hu_conv.ptrs_to.add(this);
415 this.msg = msg_hu_conv;
418 public final static class SendReplyChannelRange extends MessageSendEvent {
420 * The node_id of this message recipient
422 public final byte[] node_id;
424 * The reply_channel_range which should be sent.
426 public final ReplyChannelRange msg;
427 private SendReplyChannelRange(long ptr, bindings.LDKMessageSendEvent.SendReplyChannelRange obj) {
429 this.node_id = obj.node_id;
431 ReplyChannelRange msg_hu_conv = new ReplyChannelRange(null, msg);
432 msg_hu_conv.ptrs_to.add(this);
433 this.msg = msg_hu_conv;
437 * Creates a copy of the MessageSendEvent
439 public MessageSendEvent clone() {
440 long ret = bindings.MessageSendEvent_clone(this.ptr);
441 if (ret < 1024) { return null; }
442 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
443 ret_hu_conv.ptrs_to.add(this);
448 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
450 public static MessageSendEvent send_accept_channel(byte[] node_id, AcceptChannel msg) {
451 long ret = bindings.MessageSendEvent_send_accept_channel(node_id, msg == null ? 0 : msg.ptr & ~1);
452 if (ret < 1024) { return null; }
453 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
454 ret_hu_conv.ptrs_to.add(ret_hu_conv);
455 ret_hu_conv.ptrs_to.add(msg);
460 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
462 public static MessageSendEvent send_open_channel(byte[] node_id, OpenChannel msg) {
463 long ret = bindings.MessageSendEvent_send_open_channel(node_id, msg == null ? 0 : msg.ptr & ~1);
464 if (ret < 1024) { return null; }
465 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
466 ret_hu_conv.ptrs_to.add(ret_hu_conv);
467 ret_hu_conv.ptrs_to.add(msg);
472 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
474 public static MessageSendEvent send_funding_created(byte[] node_id, FundingCreated msg) {
475 long ret = bindings.MessageSendEvent_send_funding_created(node_id, msg == null ? 0 : msg.ptr & ~1);
476 if (ret < 1024) { return null; }
477 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
478 ret_hu_conv.ptrs_to.add(ret_hu_conv);
479 ret_hu_conv.ptrs_to.add(msg);
484 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
486 public static MessageSendEvent send_funding_signed(byte[] node_id, FundingSigned msg) {
487 long ret = bindings.MessageSendEvent_send_funding_signed(node_id, msg == null ? 0 : msg.ptr & ~1);
488 if (ret < 1024) { return null; }
489 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
490 ret_hu_conv.ptrs_to.add(ret_hu_conv);
491 ret_hu_conv.ptrs_to.add(msg);
496 * Utility method to constructs a new SendFundingLocked-variant MessageSendEvent
498 public static MessageSendEvent send_funding_locked(byte[] node_id, FundingLocked msg) {
499 long ret = bindings.MessageSendEvent_send_funding_locked(node_id, msg == null ? 0 : msg.ptr & ~1);
500 if (ret < 1024) { return null; }
501 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
502 ret_hu_conv.ptrs_to.add(ret_hu_conv);
503 ret_hu_conv.ptrs_to.add(msg);
508 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
510 public static MessageSendEvent send_announcement_signatures(byte[] node_id, AnnouncementSignatures msg) {
511 long ret = bindings.MessageSendEvent_send_announcement_signatures(node_id, msg == null ? 0 : msg.ptr & ~1);
512 if (ret < 1024) { return null; }
513 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
514 ret_hu_conv.ptrs_to.add(ret_hu_conv);
515 ret_hu_conv.ptrs_to.add(msg);
520 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
522 public static MessageSendEvent update_htlcs(byte[] node_id, CommitmentUpdate updates) {
523 long ret = bindings.MessageSendEvent_update_htlcs(node_id, updates == null ? 0 : updates.ptr & ~1);
524 if (ret < 1024) { return null; }
525 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
526 ret_hu_conv.ptrs_to.add(ret_hu_conv);
527 ret_hu_conv.ptrs_to.add(updates);
532 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
534 public static MessageSendEvent send_revoke_and_ack(byte[] node_id, RevokeAndACK msg) {
535 long ret = bindings.MessageSendEvent_send_revoke_and_ack(node_id, msg == null ? 0 : msg.ptr & ~1);
536 if (ret < 1024) { return null; }
537 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
538 ret_hu_conv.ptrs_to.add(ret_hu_conv);
539 ret_hu_conv.ptrs_to.add(msg);
544 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
546 public static MessageSendEvent send_closing_signed(byte[] node_id, ClosingSigned msg) {
547 long ret = bindings.MessageSendEvent_send_closing_signed(node_id, msg == null ? 0 : msg.ptr & ~1);
548 if (ret < 1024) { return null; }
549 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
550 ret_hu_conv.ptrs_to.add(ret_hu_conv);
551 ret_hu_conv.ptrs_to.add(msg);
556 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
558 public static MessageSendEvent send_shutdown(byte[] node_id, Shutdown msg) {
559 long ret = bindings.MessageSendEvent_send_shutdown(node_id, msg == null ? 0 : msg.ptr & ~1);
560 if (ret < 1024) { return null; }
561 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
562 ret_hu_conv.ptrs_to.add(ret_hu_conv);
563 ret_hu_conv.ptrs_to.add(msg);
568 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
570 public static MessageSendEvent send_channel_reestablish(byte[] node_id, ChannelReestablish msg) {
571 long ret = bindings.MessageSendEvent_send_channel_reestablish(node_id, msg == null ? 0 : msg.ptr & ~1);
572 if (ret < 1024) { return null; }
573 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
574 ret_hu_conv.ptrs_to.add(ret_hu_conv);
575 ret_hu_conv.ptrs_to.add(msg);
580 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
582 public static MessageSendEvent broadcast_channel_announcement(ChannelAnnouncement msg, ChannelUpdate update_msg) {
583 long ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : msg.ptr & ~1, update_msg == null ? 0 : update_msg.ptr & ~1);
584 if (ret < 1024) { return null; }
585 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
586 ret_hu_conv.ptrs_to.add(ret_hu_conv);
587 ret_hu_conv.ptrs_to.add(msg);
588 ret_hu_conv.ptrs_to.add(update_msg);
593 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
595 public static MessageSendEvent broadcast_node_announcement(NodeAnnouncement msg) {
596 long ret = bindings.MessageSendEvent_broadcast_node_announcement(msg == null ? 0 : msg.ptr & ~1);
597 if (ret < 1024) { return null; }
598 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
599 ret_hu_conv.ptrs_to.add(ret_hu_conv);
600 ret_hu_conv.ptrs_to.add(msg);
605 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
607 public static MessageSendEvent broadcast_channel_update(ChannelUpdate msg) {
608 long ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr & ~1);
609 if (ret < 1024) { return null; }
610 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
611 ret_hu_conv.ptrs_to.add(ret_hu_conv);
612 ret_hu_conv.ptrs_to.add(msg);
617 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
619 public static MessageSendEvent send_channel_update(byte[] node_id, ChannelUpdate msg) {
620 long ret = bindings.MessageSendEvent_send_channel_update(node_id, msg == null ? 0 : msg.ptr & ~1);
621 if (ret < 1024) { return null; }
622 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
623 ret_hu_conv.ptrs_to.add(ret_hu_conv);
624 ret_hu_conv.ptrs_to.add(msg);
629 * Utility method to constructs a new HandleError-variant MessageSendEvent
631 public static MessageSendEvent handle_error(byte[] node_id, ErrorAction action) {
632 long ret = bindings.MessageSendEvent_handle_error(node_id, action.ptr);
633 if (ret < 1024) { 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 PaymentFailureNetworkUpdate-variant MessageSendEvent
642 public static MessageSendEvent payment_failure_network_update(HTLCFailChannelUpdate update) {
643 long ret = bindings.MessageSendEvent_payment_failure_network_update(update.ptr);
644 if (ret < 1024) { 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 SendChannelRangeQuery-variant MessageSendEvent
653 public static MessageSendEvent send_channel_range_query(byte[] node_id, QueryChannelRange msg) {
654 long ret = bindings.MessageSendEvent_send_channel_range_query(node_id, msg == null ? 0 : msg.ptr & ~1);
655 if (ret < 1024) { return null; }
656 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
657 ret_hu_conv.ptrs_to.add(ret_hu_conv);
658 ret_hu_conv.ptrs_to.add(msg);
663 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
665 public static MessageSendEvent send_short_ids_query(byte[] node_id, QueryShortChannelIds msg) {
666 long ret = bindings.MessageSendEvent_send_short_ids_query(node_id, msg == null ? 0 : msg.ptr & ~1);
667 if (ret < 1024) { return null; }
668 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
669 ret_hu_conv.ptrs_to.add(ret_hu_conv);
670 ret_hu_conv.ptrs_to.add(msg);
675 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
677 public static MessageSendEvent send_reply_channel_range(byte[] node_id, ReplyChannelRange msg) {
678 long ret = bindings.MessageSendEvent_send_reply_channel_range(node_id, msg == null ? 0 : msg.ptr & ~1);
679 if (ret < 1024) { return null; }
680 MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
681 ret_hu_conv.ptrs_to.add(ret_hu_conv);
682 ret_hu_conv.ptrs_to.add(msg);