6 namespace org { namespace ldk { namespace structs {
9 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
10 * broadcast to most peers).
11 * These events are handled by PeerManager::process_events if you are using a PeerManager.
13 public class MessageSendEvent : CommonBase {
14 protected MessageSendEvent(object _dummy, long ptr) : base(ptr) { }
16 if (ptr != 0) { bindings.MessageSendEvent_free(ptr); }
19 internal static MessageSendEvent constr_from_ptr(long ptr) {
20 long raw_ty = bindings.LDKMessageSendEvent_ty_from_ptr(ptr);
22 case 0: return new MessageSendEvent_SendAcceptChannel(ptr);
23 case 1: return new MessageSendEvent_SendOpenChannel(ptr);
24 case 2: return new MessageSendEvent_SendFundingCreated(ptr);
25 case 3: return new MessageSendEvent_SendFundingSigned(ptr);
26 case 4: return new MessageSendEvent_SendChannelReady(ptr);
27 case 5: return new MessageSendEvent_SendAnnouncementSignatures(ptr);
28 case 6: return new MessageSendEvent_UpdateHTLCs(ptr);
29 case 7: return new MessageSendEvent_SendRevokeAndACK(ptr);
30 case 8: return new MessageSendEvent_SendClosingSigned(ptr);
31 case 9: return new MessageSendEvent_SendShutdown(ptr);
32 case 10: return new MessageSendEvent_SendChannelReestablish(ptr);
33 case 11: return new MessageSendEvent_SendChannelAnnouncement(ptr);
34 case 12: return new MessageSendEvent_BroadcastChannelAnnouncement(ptr);
35 case 13: return new MessageSendEvent_BroadcastChannelUpdate(ptr);
36 case 14: return new MessageSendEvent_SendChannelUpdate(ptr);
37 case 15: return new MessageSendEvent_HandleError(ptr);
38 case 16: return new MessageSendEvent_SendChannelRangeQuery(ptr);
39 case 17: return new MessageSendEvent_SendShortIdsQuery(ptr);
40 case 18: return new MessageSendEvent_SendReplyChannelRange(ptr);
41 case 19: return new MessageSendEvent_SendGossipTimestampFilter(ptr);
43 throw new ArgumentException("Impossible enum variant");
47 /** A MessageSendEvent of type SendAcceptChannel */
48 public class MessageSendEvent_SendAcceptChannel : MessageSendEvent {
50 * The node_id of the node which should receive this message
52 public byte[] node_id;
54 * The message which should be sent.
56 public AcceptChannel msg;
57 internal MessageSendEvent_SendAcceptChannel(long ptr) : base(null, ptr) {
58 this.node_id = bindings.LDKMessageSendEvent_SendAcceptChannel_get_node_id(ptr);
59 long msg = bindings.LDKMessageSendEvent_SendAcceptChannel_get_msg(ptr);
60 org.ldk.structs.AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannel(null, msg); }
61 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
62 this.msg = msg_hu_conv;
65 /** A MessageSendEvent of type SendOpenChannel */
66 public class MessageSendEvent_SendOpenChannel : MessageSendEvent {
68 * The node_id of the node which should receive this message
70 public byte[] node_id;
72 * The message which should be sent.
74 public OpenChannel msg;
75 internal MessageSendEvent_SendOpenChannel(long ptr) : base(null, ptr) {
76 this.node_id = bindings.LDKMessageSendEvent_SendOpenChannel_get_node_id(ptr);
77 long msg = bindings.LDKMessageSendEvent_SendOpenChannel_get_msg(ptr);
78 org.ldk.structs.OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannel(null, msg); }
79 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
80 this.msg = msg_hu_conv;
83 /** A MessageSendEvent of type SendFundingCreated */
84 public class MessageSendEvent_SendFundingCreated : MessageSendEvent {
86 * The node_id of the node which should receive this message
88 public byte[] node_id;
90 * The message which should be sent.
92 public FundingCreated msg;
93 internal MessageSendEvent_SendFundingCreated(long ptr) : base(null, ptr) {
94 this.node_id = bindings.LDKMessageSendEvent_SendFundingCreated_get_node_id(ptr);
95 long msg = bindings.LDKMessageSendEvent_SendFundingCreated_get_msg(ptr);
96 org.ldk.structs.FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingCreated(null, msg); }
97 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
98 this.msg = msg_hu_conv;
101 /** A MessageSendEvent of type SendFundingSigned */
102 public class MessageSendEvent_SendFundingSigned : MessageSendEvent {
104 * The node_id of the node which should receive this message
106 public byte[] node_id;
108 * The message which should be sent.
110 public FundingSigned msg;
111 internal MessageSendEvent_SendFundingSigned(long ptr) : base(null, ptr) {
112 this.node_id = bindings.LDKMessageSendEvent_SendFundingSigned_get_node_id(ptr);
113 long msg = bindings.LDKMessageSendEvent_SendFundingSigned_get_msg(ptr);
114 org.ldk.structs.FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingSigned(null, msg); }
115 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
116 this.msg = msg_hu_conv;
119 /** A MessageSendEvent of type SendChannelReady */
120 public class MessageSendEvent_SendChannelReady : MessageSendEvent {
122 * The node_id of the node which should receive these message(s)
124 public byte[] node_id;
126 * The channel_ready message which should be sent.
128 public ChannelReady msg;
129 internal MessageSendEvent_SendChannelReady(long ptr) : base(null, ptr) {
130 this.node_id = bindings.LDKMessageSendEvent_SendChannelReady_get_node_id(ptr);
131 long msg = bindings.LDKMessageSendEvent_SendChannelReady_get_msg(ptr);
132 org.ldk.structs.ChannelReady msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReady(null, msg); }
133 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
134 this.msg = msg_hu_conv;
137 /** A MessageSendEvent of type SendAnnouncementSignatures */
138 public class MessageSendEvent_SendAnnouncementSignatures : MessageSendEvent {
140 * The node_id of the node which should receive these message(s)
142 public byte[] node_id;
144 * The announcement_signatures message which should be sent.
146 public AnnouncementSignatures msg;
147 internal MessageSendEvent_SendAnnouncementSignatures(long ptr) : base(null, ptr) {
148 this.node_id = bindings.LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id(ptr);
149 long msg = bindings.LDKMessageSendEvent_SendAnnouncementSignatures_get_msg(ptr);
150 org.ldk.structs.AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, msg); }
151 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
152 this.msg = msg_hu_conv;
155 /** A MessageSendEvent of type UpdateHTLCs */
156 public class MessageSendEvent_UpdateHTLCs : MessageSendEvent {
158 * The node_id of the node which should receive these message(s)
160 public byte[] node_id;
162 * The update messages which should be sent. ALL messages in the struct should be sent!
164 public CommitmentUpdate updates;
165 internal MessageSendEvent_UpdateHTLCs(long ptr) : base(null, ptr) {
166 this.node_id = bindings.LDKMessageSendEvent_UpdateHTLCs_get_node_id(ptr);
167 long updates = bindings.LDKMessageSendEvent_UpdateHTLCs_get_updates(ptr);
168 org.ldk.structs.CommitmentUpdate updates_hu_conv = null; if (updates < 0 || updates > 4096) { updates_hu_conv = new org.ldk.structs.CommitmentUpdate(null, updates); }
169 if (updates_hu_conv != null) { updates_hu_conv.ptrs_to.AddLast(this); };
170 this.updates = updates_hu_conv;
173 /** A MessageSendEvent of type SendRevokeAndACK */
174 public class MessageSendEvent_SendRevokeAndACK : MessageSendEvent {
176 * The node_id of the node which should receive this message
178 public byte[] node_id;
180 * The message which should be sent.
182 public RevokeAndACK msg;
183 internal MessageSendEvent_SendRevokeAndACK(long ptr) : base(null, ptr) {
184 this.node_id = bindings.LDKMessageSendEvent_SendRevokeAndACK_get_node_id(ptr);
185 long msg = bindings.LDKMessageSendEvent_SendRevokeAndACK_get_msg(ptr);
186 org.ldk.structs.RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.RevokeAndACK(null, msg); }
187 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
188 this.msg = msg_hu_conv;
191 /** A MessageSendEvent of type SendClosingSigned */
192 public class MessageSendEvent_SendClosingSigned : MessageSendEvent {
194 * The node_id of the node which should receive this message
196 public byte[] node_id;
198 * The message which should be sent.
200 public ClosingSigned msg;
201 internal MessageSendEvent_SendClosingSigned(long ptr) : base(null, ptr) {
202 this.node_id = bindings.LDKMessageSendEvent_SendClosingSigned_get_node_id(ptr);
203 long msg = bindings.LDKMessageSendEvent_SendClosingSigned_get_msg(ptr);
204 org.ldk.structs.ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ClosingSigned(null, msg); }
205 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
206 this.msg = msg_hu_conv;
209 /** A MessageSendEvent of type SendShutdown */
210 public class MessageSendEvent_SendShutdown : MessageSendEvent {
212 * The node_id of the node which should receive this message
214 public byte[] node_id;
216 * The message which should be sent.
219 internal MessageSendEvent_SendShutdown(long ptr) : base(null, ptr) {
220 this.node_id = bindings.LDKMessageSendEvent_SendShutdown_get_node_id(ptr);
221 long msg = bindings.LDKMessageSendEvent_SendShutdown_get_msg(ptr);
222 org.ldk.structs.Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Shutdown(null, msg); }
223 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
224 this.msg = msg_hu_conv;
227 /** A MessageSendEvent of type SendChannelReestablish */
228 public class MessageSendEvent_SendChannelReestablish : MessageSendEvent {
230 * The node_id of the node which should receive this message
232 public byte[] node_id;
234 * The message which should be sent.
236 public ChannelReestablish msg;
237 internal MessageSendEvent_SendChannelReestablish(long ptr) : base(null, ptr) {
238 this.node_id = bindings.LDKMessageSendEvent_SendChannelReestablish_get_node_id(ptr);
239 long msg = bindings.LDKMessageSendEvent_SendChannelReestablish_get_msg(ptr);
240 org.ldk.structs.ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReestablish(null, msg); }
241 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
242 this.msg = msg_hu_conv;
245 /** A MessageSendEvent of type SendChannelAnnouncement */
246 public class MessageSendEvent_SendChannelAnnouncement : MessageSendEvent {
248 * The node_id of the node which should receive this message
250 public byte[] node_id;
252 * The channel_announcement which should be sent.
254 public ChannelAnnouncement msg;
256 * The followup channel_update which should be sent.
258 public ChannelUpdate update_msg;
259 internal MessageSendEvent_SendChannelAnnouncement(long ptr) : base(null, ptr) {
260 this.node_id = bindings.LDKMessageSendEvent_SendChannelAnnouncement_get_node_id(ptr);
261 long msg = bindings.LDKMessageSendEvent_SendChannelAnnouncement_get_msg(ptr);
262 org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); }
263 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
264 this.msg = msg_hu_conv;
265 long update_msg = bindings.LDKMessageSendEvent_SendChannelAnnouncement_get_update_msg(ptr);
266 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); }
267 if (update_msg_hu_conv != null) { update_msg_hu_conv.ptrs_to.AddLast(this); };
268 this.update_msg = update_msg_hu_conv;
271 /** A MessageSendEvent of type BroadcastChannelAnnouncement */
272 public class MessageSendEvent_BroadcastChannelAnnouncement : MessageSendEvent {
274 * The channel_announcement which should be sent.
276 public ChannelAnnouncement msg;
278 * The followup channel_update which should be sent.
280 public ChannelUpdate update_msg;
281 internal MessageSendEvent_BroadcastChannelAnnouncement(long ptr) : base(null, ptr) {
282 long msg = bindings.LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg(ptr);
283 org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); }
284 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
285 this.msg = msg_hu_conv;
286 long update_msg = bindings.LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg(ptr);
287 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); }
288 if (update_msg_hu_conv != null) { update_msg_hu_conv.ptrs_to.AddLast(this); };
289 this.update_msg = update_msg_hu_conv;
292 /** A MessageSendEvent of type BroadcastChannelUpdate */
293 public class MessageSendEvent_BroadcastChannelUpdate : MessageSendEvent {
295 * The channel_update which should be sent.
297 public ChannelUpdate msg;
298 internal MessageSendEvent_BroadcastChannelUpdate(long ptr) : base(null, ptr) {
299 long msg = bindings.LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(ptr);
300 org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); }
301 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
302 this.msg = msg_hu_conv;
305 /** A MessageSendEvent of type SendChannelUpdate */
306 public class MessageSendEvent_SendChannelUpdate : MessageSendEvent {
308 * The node_id of the node which should receive this message
310 public byte[] node_id;
312 * The channel_update which should be sent.
314 public ChannelUpdate msg;
315 internal MessageSendEvent_SendChannelUpdate(long ptr) : base(null, ptr) {
316 this.node_id = bindings.LDKMessageSendEvent_SendChannelUpdate_get_node_id(ptr);
317 long msg = bindings.LDKMessageSendEvent_SendChannelUpdate_get_msg(ptr);
318 org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); }
319 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
320 this.msg = msg_hu_conv;
323 /** A MessageSendEvent of type HandleError */
324 public class MessageSendEvent_HandleError : MessageSendEvent {
326 * The node_id of the node which should receive this message
328 public byte[] node_id;
330 * The action which should be taken.
332 public ErrorAction action;
333 internal MessageSendEvent_HandleError(long ptr) : base(null, ptr) {
334 this.node_id = bindings.LDKMessageSendEvent_HandleError_get_node_id(ptr);
335 long action = bindings.LDKMessageSendEvent_HandleError_get_action(ptr);
336 org.ldk.structs.ErrorAction action_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(action);
337 if (action_hu_conv != null) { action_hu_conv.ptrs_to.AddLast(this); };
338 this.action = action_hu_conv;
341 /** A MessageSendEvent of type SendChannelRangeQuery */
342 public class MessageSendEvent_SendChannelRangeQuery : MessageSendEvent {
344 * The node_id of this message recipient
346 public byte[] node_id;
348 * The query_channel_range which should be sent.
350 public QueryChannelRange msg;
351 internal MessageSendEvent_SendChannelRangeQuery(long ptr) : base(null, ptr) {
352 this.node_id = bindings.LDKMessageSendEvent_SendChannelRangeQuery_get_node_id(ptr);
353 long msg = bindings.LDKMessageSendEvent_SendChannelRangeQuery_get_msg(ptr);
354 org.ldk.structs.QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryChannelRange(null, msg); }
355 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
356 this.msg = msg_hu_conv;
359 /** A MessageSendEvent of type SendShortIdsQuery */
360 public class MessageSendEvent_SendShortIdsQuery : MessageSendEvent {
362 * The node_id of this message recipient
364 public byte[] node_id;
366 * The query_short_channel_ids which should be sent.
368 public QueryShortChannelIds msg;
369 internal MessageSendEvent_SendShortIdsQuery(long ptr) : base(null, ptr) {
370 this.node_id = bindings.LDKMessageSendEvent_SendShortIdsQuery_get_node_id(ptr);
371 long msg = bindings.LDKMessageSendEvent_SendShortIdsQuery_get_msg(ptr);
372 org.ldk.structs.QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, msg); }
373 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
374 this.msg = msg_hu_conv;
377 /** A MessageSendEvent of type SendReplyChannelRange */
378 public class MessageSendEvent_SendReplyChannelRange : MessageSendEvent {
380 * The node_id of this message recipient
382 public byte[] node_id;
384 * The reply_channel_range which should be sent.
386 public ReplyChannelRange msg;
387 internal MessageSendEvent_SendReplyChannelRange(long ptr) : base(null, ptr) {
388 this.node_id = bindings.LDKMessageSendEvent_SendReplyChannelRange_get_node_id(ptr);
389 long msg = bindings.LDKMessageSendEvent_SendReplyChannelRange_get_msg(ptr);
390 org.ldk.structs.ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ReplyChannelRange(null, msg); }
391 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
392 this.msg = msg_hu_conv;
395 /** A MessageSendEvent of type SendGossipTimestampFilter */
396 public class MessageSendEvent_SendGossipTimestampFilter : MessageSendEvent {
398 * The node_id of this message recipient
400 public byte[] node_id;
402 * The gossip_timestamp_filter which should be sent.
404 public GossipTimestampFilter msg;
405 internal MessageSendEvent_SendGossipTimestampFilter(long ptr) : base(null, ptr) {
406 this.node_id = bindings.LDKMessageSendEvent_SendGossipTimestampFilter_get_node_id(ptr);
407 long msg = bindings.LDKMessageSendEvent_SendGossipTimestampFilter_get_msg(ptr);
408 org.ldk.structs.GossipTimestampFilter msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.GossipTimestampFilter(null, msg); }
409 if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.AddLast(this); };
410 this.msg = msg_hu_conv;
413 internal long clone_ptr() {
414 long ret = bindings.MessageSendEvent_clone_ptr(this.ptr);
420 * Creates a copy of the MessageSendEvent
422 public MessageSendEvent clone() {
423 long ret = bindings.MessageSendEvent_clone(this.ptr);
425 if (ret >= 0 && ret <= 4096) { return null; }
426 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
427 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
432 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
434 public static MessageSendEvent send_accept_channel(byte[] node_id, org.ldk.structs.AcceptChannel msg) {
435 long ret = bindings.MessageSendEvent_send_accept_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
436 GC.KeepAlive(node_id);
438 if (ret >= 0 && ret <= 4096) { return null; }
439 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
440 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
441 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
446 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
448 public static MessageSendEvent send_open_channel(byte[] node_id, org.ldk.structs.OpenChannel msg) {
449 long ret = bindings.MessageSendEvent_send_open_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
450 GC.KeepAlive(node_id);
452 if (ret >= 0 && ret <= 4096) { return null; }
453 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
454 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
455 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
460 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
462 public static MessageSendEvent send_funding_created(byte[] node_id, org.ldk.structs.FundingCreated msg) {
463 long ret = bindings.MessageSendEvent_send_funding_created(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
464 GC.KeepAlive(node_id);
466 if (ret >= 0 && ret <= 4096) { return null; }
467 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
468 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
469 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
474 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
476 public static MessageSendEvent send_funding_signed(byte[] node_id, org.ldk.structs.FundingSigned msg) {
477 long ret = bindings.MessageSendEvent_send_funding_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
478 GC.KeepAlive(node_id);
480 if (ret >= 0 && ret <= 4096) { return null; }
481 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
482 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
483 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
488 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
490 public static MessageSendEvent send_channel_ready(byte[] node_id, org.ldk.structs.ChannelReady msg) {
491 long ret = bindings.MessageSendEvent_send_channel_ready(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
492 GC.KeepAlive(node_id);
494 if (ret >= 0 && ret <= 4096) { return null; }
495 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
496 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
497 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
502 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
504 public static MessageSendEvent send_announcement_signatures(byte[] node_id, org.ldk.structs.AnnouncementSignatures msg) {
505 long ret = bindings.MessageSendEvent_send_announcement_signatures(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
506 GC.KeepAlive(node_id);
508 if (ret >= 0 && ret <= 4096) { return null; }
509 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
510 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
511 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
516 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
518 public static MessageSendEvent update_htlcs(byte[] node_id, org.ldk.structs.CommitmentUpdate updates) {
519 long ret = bindings.MessageSendEvent_update_htlcs(InternalUtils.check_arr_len(node_id, 33), updates == null ? 0 : updates.ptr);
520 GC.KeepAlive(node_id);
521 GC.KeepAlive(updates);
522 if (ret >= 0 && ret <= 4096) { return null; }
523 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
524 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
525 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(updates); };
530 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
532 public static MessageSendEvent send_revoke_and_ack(byte[] node_id, org.ldk.structs.RevokeAndACK msg) {
533 long ret = bindings.MessageSendEvent_send_revoke_and_ack(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
534 GC.KeepAlive(node_id);
536 if (ret >= 0 && ret <= 4096) { return null; }
537 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
538 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
539 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
544 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
546 public static MessageSendEvent send_closing_signed(byte[] node_id, org.ldk.structs.ClosingSigned msg) {
547 long ret = bindings.MessageSendEvent_send_closing_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
548 GC.KeepAlive(node_id);
550 if (ret >= 0 && ret <= 4096) { return null; }
551 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
552 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
553 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
558 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
560 public static MessageSendEvent send_shutdown(byte[] node_id, org.ldk.structs.Shutdown msg) {
561 long ret = bindings.MessageSendEvent_send_shutdown(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
562 GC.KeepAlive(node_id);
564 if (ret >= 0 && ret <= 4096) { return null; }
565 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
566 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
567 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
572 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
574 public static MessageSendEvent send_channel_reestablish(byte[] node_id, org.ldk.structs.ChannelReestablish msg) {
575 long ret = bindings.MessageSendEvent_send_channel_reestablish(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
576 GC.KeepAlive(node_id);
578 if (ret >= 0 && ret <= 4096) { return null; }
579 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
580 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
581 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
586 * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
588 public static MessageSendEvent send_channel_announcement(byte[] node_id, org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) {
589 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);
590 GC.KeepAlive(node_id);
592 GC.KeepAlive(update_msg);
593 if (ret >= 0 && ret <= 4096) { return null; }
594 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
595 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
596 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
597 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_msg); };
602 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
604 public static MessageSendEvent broadcast_channel_announcement(org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) {
605 long ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : msg.ptr, update_msg == null ? 0 : update_msg.ptr);
607 GC.KeepAlive(update_msg);
608 if (ret >= 0 && ret <= 4096) { return null; }
609 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
610 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
611 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
612 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(update_msg); };
617 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
619 public static MessageSendEvent broadcast_channel_update(org.ldk.structs.ChannelUpdate msg) {
620 long ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr);
622 if (ret >= 0 && ret <= 4096) { return null; }
623 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
624 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
625 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
630 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
632 public static MessageSendEvent send_channel_update(byte[] node_id, org.ldk.structs.ChannelUpdate msg) {
633 long ret = bindings.MessageSendEvent_send_channel_update(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
634 GC.KeepAlive(node_id);
636 if (ret >= 0 && ret <= 4096) { return null; }
637 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
638 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
639 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
644 * Utility method to constructs a new HandleError-variant MessageSendEvent
646 public static MessageSendEvent handle_error(byte[] node_id, org.ldk.structs.ErrorAction action) {
647 long ret = bindings.MessageSendEvent_handle_error(InternalUtils.check_arr_len(node_id, 33), action.ptr);
648 GC.KeepAlive(node_id);
649 GC.KeepAlive(action);
650 if (ret >= 0 && ret <= 4096) { return null; }
651 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
652 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
657 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
659 public static MessageSendEvent send_channel_range_query(byte[] node_id, org.ldk.structs.QueryChannelRange msg) {
660 long ret = bindings.MessageSendEvent_send_channel_range_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
661 GC.KeepAlive(node_id);
663 if (ret >= 0 && ret <= 4096) { return null; }
664 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
665 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
666 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
671 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
673 public static MessageSendEvent send_short_ids_query(byte[] node_id, org.ldk.structs.QueryShortChannelIds msg) {
674 long ret = bindings.MessageSendEvent_send_short_ids_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
675 GC.KeepAlive(node_id);
677 if (ret >= 0 && ret <= 4096) { return null; }
678 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
679 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
680 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
685 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
687 public static MessageSendEvent send_reply_channel_range(byte[] node_id, org.ldk.structs.ReplyChannelRange msg) {
688 long ret = bindings.MessageSendEvent_send_reply_channel_range(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
689 GC.KeepAlive(node_id);
691 if (ret >= 0 && ret <= 4096) { return null; }
692 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
693 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
694 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };
699 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
701 public static MessageSendEvent send_gossip_timestamp_filter(byte[] node_id, org.ldk.structs.GossipTimestampFilter msg) {
702 long ret = bindings.MessageSendEvent_send_gossip_timestamp_filter(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr);
703 GC.KeepAlive(node_id);
705 if (ret >= 0 && ret <= 4096) { return null; }
706 org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret);
707 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
708 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(msg); };