6 namespace org { namespace ldk { namespace structs {
9 * An Event which you should probably take some action in response to.
11 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
12 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
13 * written as it makes no sense to respond to it after reconnecting to peers).
15 public class Event : CommonBase {
16 protected Event(object _dummy, long ptr) : base(ptr) { }
18 if (ptr != 0) { bindings.Event_free(ptr); }
21 internal static Event constr_from_ptr(long ptr) {
22 long raw_ty = bindings.LDKEvent_ty_from_ptr(ptr);
24 case 0: return new Event_FundingGenerationReady(ptr);
25 case 1: return new Event_PaymentClaimable(ptr);
26 case 2: return new Event_PaymentClaimed(ptr);
27 case 3: return new Event_ConnectionNeeded(ptr);
28 case 4: return new Event_InvoiceRequestFailed(ptr);
29 case 5: return new Event_PaymentSent(ptr);
30 case 6: return new Event_PaymentFailed(ptr);
31 case 7: return new Event_PaymentPathSuccessful(ptr);
32 case 8: return new Event_PaymentPathFailed(ptr);
33 case 9: return new Event_ProbeSuccessful(ptr);
34 case 10: return new Event_ProbeFailed(ptr);
35 case 11: return new Event_PendingHTLCsForwardable(ptr);
36 case 12: return new Event_HTLCIntercepted(ptr);
37 case 13: return new Event_SpendableOutputs(ptr);
38 case 14: return new Event_PaymentForwarded(ptr);
39 case 15: return new Event_ChannelPending(ptr);
40 case 16: return new Event_ChannelReady(ptr);
41 case 17: return new Event_ChannelClosed(ptr);
42 case 18: return new Event_DiscardFunding(ptr);
43 case 19: return new Event_OpenChannelRequest(ptr);
44 case 20: return new Event_HTLCHandlingFailed(ptr);
45 case 21: return new Event_BumpTransaction(ptr);
47 throw new ArgumentException("Impossible enum variant");
51 /** A Event of type FundingGenerationReady */
52 public class Event_FundingGenerationReady : Event {
54 * The random channel_id we picked which you'll need to pass into
55 * [`ChannelManager::funding_transaction_generated`].
57 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
59 public ChannelId temporary_channel_id;
61 * The counterparty's node_id, which you'll need to pass back into
62 * [`ChannelManager::funding_transaction_generated`].
64 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
66 public byte[] counterparty_node_id;
68 * The value, in satoshis, that the output should have.
70 public long channel_value_satoshis;
72 * The script which should be used in the transaction output.
74 public byte[] output_script;
76 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
77 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
78 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
79 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
80 * serialized with LDK versions prior to 0.0.113.
82 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
83 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
84 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
86 public UInt128 user_channel_id;
87 internal Event_FundingGenerationReady(long ptr) : base(null, ptr) {
88 long temporary_channel_id = bindings.LDKEvent_FundingGenerationReady_get_temporary_channel_id(ptr);
89 org.ldk.structs.ChannelId temporary_channel_id_hu_conv = null; if (temporary_channel_id < 0 || temporary_channel_id > 4096) { temporary_channel_id_hu_conv = new org.ldk.structs.ChannelId(null, temporary_channel_id); }
90 if (temporary_channel_id_hu_conv != null) { temporary_channel_id_hu_conv.ptrs_to.AddLast(this); };
91 this.temporary_channel_id = temporary_channel_id_hu_conv;
92 long counterparty_node_id = bindings.LDKEvent_FundingGenerationReady_get_counterparty_node_id(ptr);
93 byte[] counterparty_node_id_conv = InternalUtils.decodeUint8Array(counterparty_node_id);
94 this.counterparty_node_id = counterparty_node_id_conv;
95 this.channel_value_satoshis = bindings.LDKEvent_FundingGenerationReady_get_channel_value_satoshis(ptr);
96 long output_script = bindings.LDKEvent_FundingGenerationReady_get_output_script(ptr);
97 byte[] output_script_conv = InternalUtils.decodeUint8Array(output_script);
98 this.output_script = output_script_conv;
99 long user_channel_id = bindings.LDKEvent_FundingGenerationReady_get_user_channel_id(ptr);
100 org.ldk.util.UInt128 user_channel_id_conv = new org.ldk.util.UInt128(user_channel_id);
101 this.user_channel_id = user_channel_id_conv;
104 /** A Event of type PaymentClaimable */
105 public class Event_PaymentClaimable : Event {
107 * The node that will receive the payment after it has been claimed.
108 * This is useful to identify payments received via [phantom nodes].
109 * This field will always be filled in when the event was generated by LDK versions
112 * [phantom nodes]: crate::sign::PhantomKeysManager
114 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
116 public byte[] receiver_node_id;
118 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
119 * not stop you from registering duplicate payment hashes for inbound payments.
121 public byte[] payment_hash;
123 * The fields in the onion which were received with each HTLC. Only fields which were
124 * identical in each HTLC involved in the payment will be included here.
126 * Payments received on LDK versions prior to 0.0.115 will have this field unset.
128 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
130 public RecipientOnionFields onion_fields;
132 * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater
133 * than the invoice amount.
135 * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set
136 * and the previous hop took an extra fee.
139 * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this
140 * field, you may lose money!
142 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
144 public long amount_msat;
146 * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee
147 * taken by our channel counterparty.
149 * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set.
151 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
153 public long counterparty_skimmed_fee_msat;
155 * Information for claiming this received payment, based on whether the purpose of the
156 * payment is to pay an invoice or to send a spontaneous payment.
158 public PaymentPurpose purpose;
160 * The `channel_id` indicating over which channel we received the payment.
162 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
164 public ChannelId via_channel_id;
166 * The `user_channel_id` indicating over which channel we received the payment.
168 public Option_U128Z via_user_channel_id;
170 * The block height at which this payment will be failed back and will no longer be
171 * eligible for claiming.
173 * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
174 * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
176 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
178 public Option_u32Z claim_deadline;
179 internal Event_PaymentClaimable(long ptr) : base(null, ptr) {
180 long receiver_node_id = bindings.LDKEvent_PaymentClaimable_get_receiver_node_id(ptr);
181 byte[] receiver_node_id_conv = InternalUtils.decodeUint8Array(receiver_node_id);
182 this.receiver_node_id = receiver_node_id_conv;
183 long payment_hash = bindings.LDKEvent_PaymentClaimable_get_payment_hash(ptr);
184 byte[] payment_hash_conv = InternalUtils.decodeUint8Array(payment_hash);
185 this.payment_hash = payment_hash_conv;
186 long onion_fields = bindings.LDKEvent_PaymentClaimable_get_onion_fields(ptr);
187 org.ldk.structs.RecipientOnionFields onion_fields_hu_conv = null; if (onion_fields < 0 || onion_fields > 4096) { onion_fields_hu_conv = new org.ldk.structs.RecipientOnionFields(null, onion_fields); }
188 if (onion_fields_hu_conv != null) { onion_fields_hu_conv.ptrs_to.AddLast(this); };
189 this.onion_fields = onion_fields_hu_conv;
190 this.amount_msat = bindings.LDKEvent_PaymentClaimable_get_amount_msat(ptr);
191 this.counterparty_skimmed_fee_msat = bindings.LDKEvent_PaymentClaimable_get_counterparty_skimmed_fee_msat(ptr);
192 long purpose = bindings.LDKEvent_PaymentClaimable_get_purpose(ptr);
193 org.ldk.structs.PaymentPurpose purpose_hu_conv = org.ldk.structs.PaymentPurpose.constr_from_ptr(purpose);
194 if (purpose_hu_conv != null) { purpose_hu_conv.ptrs_to.AddLast(this); };
195 this.purpose = purpose_hu_conv;
196 long via_channel_id = bindings.LDKEvent_PaymentClaimable_get_via_channel_id(ptr);
197 org.ldk.structs.ChannelId via_channel_id_hu_conv = null; if (via_channel_id < 0 || via_channel_id > 4096) { via_channel_id_hu_conv = new org.ldk.structs.ChannelId(null, via_channel_id); }
198 if (via_channel_id_hu_conv != null) { via_channel_id_hu_conv.ptrs_to.AddLast(this); };
199 this.via_channel_id = via_channel_id_hu_conv;
200 long via_user_channel_id = bindings.LDKEvent_PaymentClaimable_get_via_user_channel_id(ptr);
201 org.ldk.structs.Option_U128Z via_user_channel_id_hu_conv = org.ldk.structs.Option_U128Z.constr_from_ptr(via_user_channel_id);
202 if (via_user_channel_id_hu_conv != null) { via_user_channel_id_hu_conv.ptrs_to.AddLast(this); };
203 this.via_user_channel_id = via_user_channel_id_hu_conv;
204 long claim_deadline = bindings.LDKEvent_PaymentClaimable_get_claim_deadline(ptr);
205 org.ldk.structs.Option_u32Z claim_deadline_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(claim_deadline);
206 if (claim_deadline_hu_conv != null) { claim_deadline_hu_conv.ptrs_to.AddLast(this); };
207 this.claim_deadline = claim_deadline_hu_conv;
210 /** A Event of type PaymentClaimed */
211 public class Event_PaymentClaimed : Event {
213 * The node that received the payment.
214 * This is useful to identify payments which were received via [phantom nodes].
215 * This field will always be filled in when the event was generated by LDK versions
218 * [phantom nodes]: crate::sign::PhantomKeysManager
220 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
222 public byte[] receiver_node_id;
224 * The payment hash of the claimed payment. Note that LDK will not stop you from
225 * registering duplicate payment hashes for inbound payments.
227 public byte[] payment_hash;
229 * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
232 public long amount_msat;
234 * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
235 * spontaneous payment.
237 public PaymentPurpose purpose;
239 * The HTLCs that comprise the claimed payment. This will be empty for events serialized prior
240 * to LDK version 0.0.117.
242 public ClaimedHTLC[] htlcs;
244 * The sender-intended sum total of all the MPP parts. This will be `None` for events
245 * serialized prior to LDK version 0.0.117.
247 public Option_u64Z sender_intended_total_msat;
248 internal Event_PaymentClaimed(long ptr) : base(null, ptr) {
249 long receiver_node_id = bindings.LDKEvent_PaymentClaimed_get_receiver_node_id(ptr);
250 byte[] receiver_node_id_conv = InternalUtils.decodeUint8Array(receiver_node_id);
251 this.receiver_node_id = receiver_node_id_conv;
252 long payment_hash = bindings.LDKEvent_PaymentClaimed_get_payment_hash(ptr);
253 byte[] payment_hash_conv = InternalUtils.decodeUint8Array(payment_hash);
254 this.payment_hash = payment_hash_conv;
255 this.amount_msat = bindings.LDKEvent_PaymentClaimed_get_amount_msat(ptr);
256 long purpose = bindings.LDKEvent_PaymentClaimed_get_purpose(ptr);
257 org.ldk.structs.PaymentPurpose purpose_hu_conv = org.ldk.structs.PaymentPurpose.constr_from_ptr(purpose);
258 if (purpose_hu_conv != null) { purpose_hu_conv.ptrs_to.AddLast(this); };
259 this.purpose = purpose_hu_conv;
260 long htlcs = bindings.LDKEvent_PaymentClaimed_get_htlcs(ptr);
261 int htlcs_conv_13_len = InternalUtils.getArrayLength(htlcs);
262 ClaimedHTLC[] htlcs_conv_13_arr = new ClaimedHTLC[htlcs_conv_13_len];
263 for (int n = 0; n < htlcs_conv_13_len; n++) {
264 long htlcs_conv_13 = InternalUtils.getU64ArrayElem(htlcs, n);
265 org.ldk.structs.ClaimedHTLC htlcs_conv_13_hu_conv = null; if (htlcs_conv_13 < 0 || htlcs_conv_13 > 4096) { htlcs_conv_13_hu_conv = new org.ldk.structs.ClaimedHTLC(null, htlcs_conv_13); }
266 if (htlcs_conv_13_hu_conv != null) { htlcs_conv_13_hu_conv.ptrs_to.AddLast(this); };
267 htlcs_conv_13_arr[n] = htlcs_conv_13_hu_conv;
269 bindings.free_buffer(htlcs);
270 this.htlcs = htlcs_conv_13_arr;
271 long sender_intended_total_msat = bindings.LDKEvent_PaymentClaimed_get_sender_intended_total_msat(ptr);
272 org.ldk.structs.Option_u64Z sender_intended_total_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(sender_intended_total_msat);
273 if (sender_intended_total_msat_hu_conv != null) { sender_intended_total_msat_hu_conv.ptrs_to.AddLast(this); };
274 this.sender_intended_total_msat = sender_intended_total_msat_hu_conv;
277 /** A Event of type ConnectionNeeded */
278 public class Event_ConnectionNeeded : Event {
280 * The node id for the node needing a connection.
282 public byte[] node_id;
284 * Sockets for connecting to the node.
286 public SocketAddress[] addresses;
287 internal Event_ConnectionNeeded(long ptr) : base(null, ptr) {
288 long node_id = bindings.LDKEvent_ConnectionNeeded_get_node_id(ptr);
289 byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
290 this.node_id = node_id_conv;
291 long addresses = bindings.LDKEvent_ConnectionNeeded_get_addresses(ptr);
292 int addresses_conv_15_len = InternalUtils.getArrayLength(addresses);
293 SocketAddress[] addresses_conv_15_arr = new SocketAddress[addresses_conv_15_len];
294 for (int p = 0; p < addresses_conv_15_len; p++) {
295 long addresses_conv_15 = InternalUtils.getU64ArrayElem(addresses, p);
296 org.ldk.structs.SocketAddress addresses_conv_15_hu_conv = org.ldk.structs.SocketAddress.constr_from_ptr(addresses_conv_15);
297 if (addresses_conv_15_hu_conv != null) { addresses_conv_15_hu_conv.ptrs_to.AddLast(this); };
298 addresses_conv_15_arr[p] = addresses_conv_15_hu_conv;
300 bindings.free_buffer(addresses);
301 this.addresses = addresses_conv_15_arr;
304 /** A Event of type InvoiceRequestFailed */
305 public class Event_InvoiceRequestFailed : Event {
307 * The `payment_id` to have been associated with payment for the requested invoice.
309 public byte[] payment_id;
310 internal Event_InvoiceRequestFailed(long ptr) : base(null, ptr) {
311 long payment_id = bindings.LDKEvent_InvoiceRequestFailed_get_payment_id(ptr);
312 byte[] payment_id_conv = InternalUtils.decodeUint8Array(payment_id);
313 this.payment_id = payment_id_conv;
316 /** A Event of type PaymentSent */
317 public class Event_PaymentSent : Event {
319 * The `payment_id` passed to [`ChannelManager::send_payment`].
321 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
323 public Option_ThirtyTwoBytesZ payment_id;
325 * The preimage to the hash given to ChannelManager::send_payment.
326 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
329 public byte[] payment_preimage;
331 * The hash that was given to [`ChannelManager::send_payment`].
333 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
335 public byte[] payment_hash;
337 * The total fee which was spent at intermediate hops in this payment, across all paths.
339 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
340 * overpayment to the recipient node.
342 * If the recipient or an intermediate node misbehaves and gives us free money, this may
343 * overstate the amount paid, though this is unlikely.
345 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
347 public Option_u64Z fee_paid_msat;
348 internal Event_PaymentSent(long ptr) : base(null, ptr) {
349 long payment_id = bindings.LDKEvent_PaymentSent_get_payment_id(ptr);
350 org.ldk.structs.Option_ThirtyTwoBytesZ payment_id_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(payment_id);
351 if (payment_id_hu_conv != null) { payment_id_hu_conv.ptrs_to.AddLast(this); };
352 this.payment_id = payment_id_hu_conv;
353 long payment_preimage = bindings.LDKEvent_PaymentSent_get_payment_preimage(ptr);
354 byte[] payment_preimage_conv = InternalUtils.decodeUint8Array(payment_preimage);
355 this.payment_preimage = payment_preimage_conv;
356 long payment_hash = bindings.LDKEvent_PaymentSent_get_payment_hash(ptr);
357 byte[] payment_hash_conv = InternalUtils.decodeUint8Array(payment_hash);
358 this.payment_hash = payment_hash_conv;
359 long fee_paid_msat = bindings.LDKEvent_PaymentSent_get_fee_paid_msat(ptr);
360 org.ldk.structs.Option_u64Z fee_paid_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(fee_paid_msat);
361 if (fee_paid_msat_hu_conv != null) { fee_paid_msat_hu_conv.ptrs_to.AddLast(this); };
362 this.fee_paid_msat = fee_paid_msat_hu_conv;
365 /** A Event of type PaymentFailed */
366 public class Event_PaymentFailed : Event {
368 * The `payment_id` passed to [`ChannelManager::send_payment`].
370 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
372 public byte[] payment_id;
374 * The hash that was given to [`ChannelManager::send_payment`].
376 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
378 public byte[] payment_hash;
380 * The reason the payment failed. This is only `None` for events generated or serialized
381 * by versions prior to 0.0.115.
383 public Option_PaymentFailureReasonZ reason;
384 internal Event_PaymentFailed(long ptr) : base(null, ptr) {
385 long payment_id = bindings.LDKEvent_PaymentFailed_get_payment_id(ptr);
386 byte[] payment_id_conv = InternalUtils.decodeUint8Array(payment_id);
387 this.payment_id = payment_id_conv;
388 long payment_hash = bindings.LDKEvent_PaymentFailed_get_payment_hash(ptr);
389 byte[] payment_hash_conv = InternalUtils.decodeUint8Array(payment_hash);
390 this.payment_hash = payment_hash_conv;
391 long reason = bindings.LDKEvent_PaymentFailed_get_reason(ptr);
392 org.ldk.structs.Option_PaymentFailureReasonZ reason_hu_conv = org.ldk.structs.Option_PaymentFailureReasonZ.constr_from_ptr(reason);
393 if (reason_hu_conv != null) { reason_hu_conv.ptrs_to.AddLast(this); };
394 this.reason = reason_hu_conv;
397 /** A Event of type PaymentPathSuccessful */
398 public class Event_PaymentPathSuccessful : Event {
400 * The `payment_id` passed to [`ChannelManager::send_payment`].
402 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
404 public byte[] payment_id;
406 * The hash that was given to [`ChannelManager::send_payment`].
408 * This will be `Some` for all payments which completed on LDK 0.0.104 or later.
410 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
412 public Option_ThirtyTwoBytesZ payment_hash;
414 * The payment path that was successful.
416 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
419 internal Event_PaymentPathSuccessful(long ptr) : base(null, ptr) {
420 long payment_id = bindings.LDKEvent_PaymentPathSuccessful_get_payment_id(ptr);
421 byte[] payment_id_conv = InternalUtils.decodeUint8Array(payment_id);
422 this.payment_id = payment_id_conv;
423 long payment_hash = bindings.LDKEvent_PaymentPathSuccessful_get_payment_hash(ptr);
424 org.ldk.structs.Option_ThirtyTwoBytesZ payment_hash_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(payment_hash);
425 if (payment_hash_hu_conv != null) { payment_hash_hu_conv.ptrs_to.AddLast(this); };
426 this.payment_hash = payment_hash_hu_conv;
427 long path = bindings.LDKEvent_PaymentPathSuccessful_get_path(ptr);
428 org.ldk.structs.Path path_hu_conv = null; if (path < 0 || path > 4096) { path_hu_conv = new org.ldk.structs.Path(null, path); }
429 if (path_hu_conv != null) { path_hu_conv.ptrs_to.AddLast(this); };
430 this.path = path_hu_conv;
433 /** A Event of type PaymentPathFailed */
434 public class Event_PaymentPathFailed : Event {
436 * The `payment_id` passed to [`ChannelManager::send_payment`].
438 * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later.
440 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
441 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
443 public Option_ThirtyTwoBytesZ payment_id;
445 * The hash that was given to [`ChannelManager::send_payment`].
447 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
449 public byte[] payment_hash;
451 * Indicates the payment was rejected for some reason by the recipient. This implies that
452 * the payment has failed, not just the route in question. If this is not set, the payment may
453 * be retried via a different route.
455 public bool payment_failed_permanently;
457 * Extra error details based on the failure type. May contain an update that needs to be
458 * applied to the [`NetworkGraph`].
460 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
462 public PathFailure failure;
464 * The payment path that failed.
468 * The channel responsible for the failed payment path.
470 * Note that for route hints or for the first hop in a path this may be an SCID alias and
471 * may not refer to a channel in the public network graph. These aliases may also collide
472 * with channels in the public network graph.
474 * If this is `Some`, then the corresponding channel should be avoided when the payment is
475 * retried. May be `None` for older [`Event`] serializations.
477 public Option_u64Z short_channel_id;
478 internal Event_PaymentPathFailed(long ptr) : base(null, ptr) {
479 long payment_id = bindings.LDKEvent_PaymentPathFailed_get_payment_id(ptr);
480 org.ldk.structs.Option_ThirtyTwoBytesZ payment_id_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(payment_id);
481 if (payment_id_hu_conv != null) { payment_id_hu_conv.ptrs_to.AddLast(this); };
482 this.payment_id = payment_id_hu_conv;
483 long payment_hash = bindings.LDKEvent_PaymentPathFailed_get_payment_hash(ptr);
484 byte[] payment_hash_conv = InternalUtils.decodeUint8Array(payment_hash);
485 this.payment_hash = payment_hash_conv;
486 this.payment_failed_permanently = bindings.LDKEvent_PaymentPathFailed_get_payment_failed_permanently(ptr);
487 long failure = bindings.LDKEvent_PaymentPathFailed_get_failure(ptr);
488 org.ldk.structs.PathFailure failure_hu_conv = org.ldk.structs.PathFailure.constr_from_ptr(failure);
489 if (failure_hu_conv != null) { failure_hu_conv.ptrs_to.AddLast(this); };
490 this.failure = failure_hu_conv;
491 long path = bindings.LDKEvent_PaymentPathFailed_get_path(ptr);
492 org.ldk.structs.Path path_hu_conv = null; if (path < 0 || path > 4096) { path_hu_conv = new org.ldk.structs.Path(null, path); }
493 if (path_hu_conv != null) { path_hu_conv.ptrs_to.AddLast(this); };
494 this.path = path_hu_conv;
495 long short_channel_id = bindings.LDKEvent_PaymentPathFailed_get_short_channel_id(ptr);
496 org.ldk.structs.Option_u64Z short_channel_id_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(short_channel_id);
497 if (short_channel_id_hu_conv != null) { short_channel_id_hu_conv.ptrs_to.AddLast(this); };
498 this.short_channel_id = short_channel_id_hu_conv;
501 /** A Event of type ProbeSuccessful */
502 public class Event_ProbeSuccessful : Event {
504 * The id returned by [`ChannelManager::send_probe`].
506 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
508 public byte[] payment_id;
510 * The hash generated by [`ChannelManager::send_probe`].
512 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
514 public byte[] payment_hash;
516 * The payment path that was successful.
519 internal Event_ProbeSuccessful(long ptr) : base(null, ptr) {
520 long payment_id = bindings.LDKEvent_ProbeSuccessful_get_payment_id(ptr);
521 byte[] payment_id_conv = InternalUtils.decodeUint8Array(payment_id);
522 this.payment_id = payment_id_conv;
523 long payment_hash = bindings.LDKEvent_ProbeSuccessful_get_payment_hash(ptr);
524 byte[] payment_hash_conv = InternalUtils.decodeUint8Array(payment_hash);
525 this.payment_hash = payment_hash_conv;
526 long path = bindings.LDKEvent_ProbeSuccessful_get_path(ptr);
527 org.ldk.structs.Path path_hu_conv = null; if (path < 0 || path > 4096) { path_hu_conv = new org.ldk.structs.Path(null, path); }
528 if (path_hu_conv != null) { path_hu_conv.ptrs_to.AddLast(this); };
529 this.path = path_hu_conv;
532 /** A Event of type ProbeFailed */
533 public class Event_ProbeFailed : Event {
535 * The id returned by [`ChannelManager::send_probe`].
537 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
539 public byte[] payment_id;
541 * The hash generated by [`ChannelManager::send_probe`].
543 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
545 public byte[] payment_hash;
547 * The payment path that failed.
551 * The channel responsible for the failed probe.
553 * Note that for route hints or for the first hop in a path this may be an SCID alias and
554 * may not refer to a channel in the public network graph. These aliases may also collide
555 * with channels in the public network graph.
557 public Option_u64Z short_channel_id;
558 internal Event_ProbeFailed(long ptr) : base(null, ptr) {
559 long payment_id = bindings.LDKEvent_ProbeFailed_get_payment_id(ptr);
560 byte[] payment_id_conv = InternalUtils.decodeUint8Array(payment_id);
561 this.payment_id = payment_id_conv;
562 long payment_hash = bindings.LDKEvent_ProbeFailed_get_payment_hash(ptr);
563 byte[] payment_hash_conv = InternalUtils.decodeUint8Array(payment_hash);
564 this.payment_hash = payment_hash_conv;
565 long path = bindings.LDKEvent_ProbeFailed_get_path(ptr);
566 org.ldk.structs.Path path_hu_conv = null; if (path < 0 || path > 4096) { path_hu_conv = new org.ldk.structs.Path(null, path); }
567 if (path_hu_conv != null) { path_hu_conv.ptrs_to.AddLast(this); };
568 this.path = path_hu_conv;
569 long short_channel_id = bindings.LDKEvent_ProbeFailed_get_short_channel_id(ptr);
570 org.ldk.structs.Option_u64Z short_channel_id_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(short_channel_id);
571 if (short_channel_id_hu_conv != null) { short_channel_id_hu_conv.ptrs_to.AddLast(this); };
572 this.short_channel_id = short_channel_id_hu_conv;
575 /** A Event of type PendingHTLCsForwardable */
576 public class Event_PendingHTLCsForwardable : Event {
578 * The minimum amount of time that should be waited prior to calling
579 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
580 * you should wait a random amount of time in roughly the range (now + time_forwardable,
581 * now + 5*time_forwardable).
583 public long time_forwardable;
584 internal Event_PendingHTLCsForwardable(long ptr) : base(null, ptr) {
585 this.time_forwardable = bindings.LDKEvent_PendingHTLCsForwardable_get_time_forwardable(ptr);
588 /** A Event of type HTLCIntercepted */
589 public class Event_HTLCIntercepted : Event {
591 * An id to help LDK identify which HTLC is being forwarded or failed.
593 public byte[] intercept_id;
595 * The fake scid that was programmed as the next hop's scid, generated using
596 * [`ChannelManager::get_intercept_scid`].
598 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
600 public long requested_next_hop_scid;
602 * The payment hash used for this HTLC.
604 public byte[] payment_hash;
606 * How many msats were received on the inbound edge of this HTLC.
608 public long inbound_amount_msat;
610 * How many msats the payer intended to route to the next node. Depending on the reason you are
611 * intercepting this payment, you might take a fee by forwarding less than this amount.
612 * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116.
614 * Note that LDK will NOT check that expected fees were factored into this value. You MUST
615 * check that whatever fee you want has been included here or subtract it as required. Further,
616 * LDK will not stop you from forwarding more than you received.
618 public long expected_outbound_amount_msat;
619 internal Event_HTLCIntercepted(long ptr) : base(null, ptr) {
620 long intercept_id = bindings.LDKEvent_HTLCIntercepted_get_intercept_id(ptr);
621 byte[] intercept_id_conv = InternalUtils.decodeUint8Array(intercept_id);
622 this.intercept_id = intercept_id_conv;
623 this.requested_next_hop_scid = bindings.LDKEvent_HTLCIntercepted_get_requested_next_hop_scid(ptr);
624 long payment_hash = bindings.LDKEvent_HTLCIntercepted_get_payment_hash(ptr);
625 byte[] payment_hash_conv = InternalUtils.decodeUint8Array(payment_hash);
626 this.payment_hash = payment_hash_conv;
627 this.inbound_amount_msat = bindings.LDKEvent_HTLCIntercepted_get_inbound_amount_msat(ptr);
628 this.expected_outbound_amount_msat = bindings.LDKEvent_HTLCIntercepted_get_expected_outbound_amount_msat(ptr);
631 /** A Event of type SpendableOutputs */
632 public class Event_SpendableOutputs : Event {
634 * The outputs which you should store as spendable by you.
636 public SpendableOutputDescriptor[] outputs;
638 * The `channel_id` indicating which channel the spendable outputs belong to.
640 * This will always be `Some` for events generated by LDK versions 0.0.117 and above.
642 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
644 public ChannelId channel_id;
645 internal Event_SpendableOutputs(long ptr) : base(null, ptr) {
646 long outputs = bindings.LDKEvent_SpendableOutputs_get_outputs(ptr);
647 int outputs_conv_27_len = InternalUtils.getArrayLength(outputs);
648 SpendableOutputDescriptor[] outputs_conv_27_arr = new SpendableOutputDescriptor[outputs_conv_27_len];
649 for (int b = 0; b < outputs_conv_27_len; b++) {
650 long outputs_conv_27 = InternalUtils.getU64ArrayElem(outputs, b);
651 org.ldk.structs.SpendableOutputDescriptor outputs_conv_27_hu_conv = org.ldk.structs.SpendableOutputDescriptor.constr_from_ptr(outputs_conv_27);
652 if (outputs_conv_27_hu_conv != null) { outputs_conv_27_hu_conv.ptrs_to.AddLast(this); };
653 outputs_conv_27_arr[b] = outputs_conv_27_hu_conv;
655 bindings.free_buffer(outputs);
656 this.outputs = outputs_conv_27_arr;
657 long channel_id = bindings.LDKEvent_SpendableOutputs_get_channel_id(ptr);
658 org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.ChannelId(null, channel_id); }
659 if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.AddLast(this); };
660 this.channel_id = channel_id_hu_conv;
663 /** A Event of type PaymentForwarded */
664 public class Event_PaymentForwarded : Event {
666 * The channel id of the incoming channel between the previous node and us.
668 * This is only `None` for events generated or serialized by versions prior to 0.0.107.
670 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
672 public ChannelId prev_channel_id;
674 * The channel id of the outgoing channel between the next node and us.
676 * This is only `None` for events generated or serialized by versions prior to 0.0.107.
678 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
680 public ChannelId next_channel_id;
682 * The `user_channel_id` of the incoming channel between the previous node and us.
684 * This is only `None` for events generated or serialized by versions prior to 0.0.122.
686 public Option_U128Z prev_user_channel_id;
688 * The `user_channel_id` of the outgoing channel between the next node and us.
690 * This will be `None` if the payment was settled via an on-chain transaction. See the
691 * caveat described for the `total_fee_earned_msat` field. Moreover it will be `None` for
692 * events generated or serialized by versions prior to 0.0.122.
694 public Option_U128Z next_user_channel_id;
696 * The total fee, in milli-satoshis, which was earned as a result of the payment.
698 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
699 * was pending, the amount the next hop claimed will have been rounded down to the nearest
700 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
701 * claimed the full value in millisatoshis from the source. In this case,
702 * `claim_from_onchain_tx` will be set.
704 * If the channel which sent us the payment has been force-closed, we will claim the funds
705 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
706 * fees which we will spend and will instead set this to `None`. It is possible duplicate
707 * `PaymentForwarded` events are generated for the same payment iff `total_fee_earned_msat` is
710 public Option_u64Z total_fee_earned_msat;
712 * The share of the total fee, in milli-satoshis, which was withheld in addition to the
715 * This will only be `Some` if we forwarded an intercepted HTLC with less than the
716 * expected amount. This means our counterparty accepted to receive less than the invoice
717 * amount, e.g., by claiming the payment featuring a corresponding
718 * [`PaymentClaimable::counterparty_skimmed_fee_msat`].
720 * Will also always be `None` for events serialized with LDK prior to version 0.0.122.
722 * The caveat described above the `total_fee_earned_msat` field applies here as well.
724 * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: Self::PaymentClaimable::counterparty_skimmed_fee_msat
726 public Option_u64Z skimmed_fee_msat;
728 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
731 public bool claim_from_onchain_tx;
733 * The final amount forwarded, in milli-satoshis, after the fee is deducted.
735 * The caveat described above the `total_fee_earned_msat` field applies here as well.
737 public Option_u64Z outbound_amount_forwarded_msat;
738 internal Event_PaymentForwarded(long ptr) : base(null, ptr) {
739 long prev_channel_id = bindings.LDKEvent_PaymentForwarded_get_prev_channel_id(ptr);
740 org.ldk.structs.ChannelId prev_channel_id_hu_conv = null; if (prev_channel_id < 0 || prev_channel_id > 4096) { prev_channel_id_hu_conv = new org.ldk.structs.ChannelId(null, prev_channel_id); }
741 if (prev_channel_id_hu_conv != null) { prev_channel_id_hu_conv.ptrs_to.AddLast(this); };
742 this.prev_channel_id = prev_channel_id_hu_conv;
743 long next_channel_id = bindings.LDKEvent_PaymentForwarded_get_next_channel_id(ptr);
744 org.ldk.structs.ChannelId next_channel_id_hu_conv = null; if (next_channel_id < 0 || next_channel_id > 4096) { next_channel_id_hu_conv = new org.ldk.structs.ChannelId(null, next_channel_id); }
745 if (next_channel_id_hu_conv != null) { next_channel_id_hu_conv.ptrs_to.AddLast(this); };
746 this.next_channel_id = next_channel_id_hu_conv;
747 long prev_user_channel_id = bindings.LDKEvent_PaymentForwarded_get_prev_user_channel_id(ptr);
748 org.ldk.structs.Option_U128Z prev_user_channel_id_hu_conv = org.ldk.structs.Option_U128Z.constr_from_ptr(prev_user_channel_id);
749 if (prev_user_channel_id_hu_conv != null) { prev_user_channel_id_hu_conv.ptrs_to.AddLast(this); };
750 this.prev_user_channel_id = prev_user_channel_id_hu_conv;
751 long next_user_channel_id = bindings.LDKEvent_PaymentForwarded_get_next_user_channel_id(ptr);
752 org.ldk.structs.Option_U128Z next_user_channel_id_hu_conv = org.ldk.structs.Option_U128Z.constr_from_ptr(next_user_channel_id);
753 if (next_user_channel_id_hu_conv != null) { next_user_channel_id_hu_conv.ptrs_to.AddLast(this); };
754 this.next_user_channel_id = next_user_channel_id_hu_conv;
755 long total_fee_earned_msat = bindings.LDKEvent_PaymentForwarded_get_total_fee_earned_msat(ptr);
756 org.ldk.structs.Option_u64Z total_fee_earned_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(total_fee_earned_msat);
757 if (total_fee_earned_msat_hu_conv != null) { total_fee_earned_msat_hu_conv.ptrs_to.AddLast(this); };
758 this.total_fee_earned_msat = total_fee_earned_msat_hu_conv;
759 long skimmed_fee_msat = bindings.LDKEvent_PaymentForwarded_get_skimmed_fee_msat(ptr);
760 org.ldk.structs.Option_u64Z skimmed_fee_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(skimmed_fee_msat);
761 if (skimmed_fee_msat_hu_conv != null) { skimmed_fee_msat_hu_conv.ptrs_to.AddLast(this); };
762 this.skimmed_fee_msat = skimmed_fee_msat_hu_conv;
763 this.claim_from_onchain_tx = bindings.LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(ptr);
764 long outbound_amount_forwarded_msat = bindings.LDKEvent_PaymentForwarded_get_outbound_amount_forwarded_msat(ptr);
765 org.ldk.structs.Option_u64Z outbound_amount_forwarded_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(outbound_amount_forwarded_msat);
766 if (outbound_amount_forwarded_msat_hu_conv != null) { outbound_amount_forwarded_msat_hu_conv.ptrs_to.AddLast(this); };
767 this.outbound_amount_forwarded_msat = outbound_amount_forwarded_msat_hu_conv;
770 /** A Event of type ChannelPending */
771 public class Event_ChannelPending : Event {
773 * The `channel_id` of the channel that is pending confirmation.
775 public ChannelId channel_id;
777 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
778 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
779 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
780 * `user_channel_id` will be randomized for an inbound channel.
782 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
783 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
784 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
786 public UInt128 user_channel_id;
788 * The `temporary_channel_id` this channel used to be known by during channel establishment.
790 * Will be `None` for channels created prior to LDK version 0.0.115.
792 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
794 public ChannelId former_temporary_channel_id;
796 * The `node_id` of the channel counterparty.
798 public byte[] counterparty_node_id;
800 * The outpoint of the channel's funding transaction.
802 public OutPoint funding_txo;
804 * The features that this channel will operate with.
806 * Will be `None` for channels created prior to LDK version 0.0.122.
808 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
810 public ChannelTypeFeatures channel_type;
811 internal Event_ChannelPending(long ptr) : base(null, ptr) {
812 long channel_id = bindings.LDKEvent_ChannelPending_get_channel_id(ptr);
813 org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.ChannelId(null, channel_id); }
814 if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.AddLast(this); };
815 this.channel_id = channel_id_hu_conv;
816 long user_channel_id = bindings.LDKEvent_ChannelPending_get_user_channel_id(ptr);
817 org.ldk.util.UInt128 user_channel_id_conv = new org.ldk.util.UInt128(user_channel_id);
818 this.user_channel_id = user_channel_id_conv;
819 long former_temporary_channel_id = bindings.LDKEvent_ChannelPending_get_former_temporary_channel_id(ptr);
820 org.ldk.structs.ChannelId former_temporary_channel_id_hu_conv = null; if (former_temporary_channel_id < 0 || former_temporary_channel_id > 4096) { former_temporary_channel_id_hu_conv = new org.ldk.structs.ChannelId(null, former_temporary_channel_id); }
821 if (former_temporary_channel_id_hu_conv != null) { former_temporary_channel_id_hu_conv.ptrs_to.AddLast(this); };
822 this.former_temporary_channel_id = former_temporary_channel_id_hu_conv;
823 long counterparty_node_id = bindings.LDKEvent_ChannelPending_get_counterparty_node_id(ptr);
824 byte[] counterparty_node_id_conv = InternalUtils.decodeUint8Array(counterparty_node_id);
825 this.counterparty_node_id = counterparty_node_id_conv;
826 long funding_txo = bindings.LDKEvent_ChannelPending_get_funding_txo(ptr);
827 org.ldk.structs.OutPoint funding_txo_hu_conv = null; if (funding_txo < 0 || funding_txo > 4096) { funding_txo_hu_conv = new org.ldk.structs.OutPoint(null, funding_txo); }
828 if (funding_txo_hu_conv != null) { funding_txo_hu_conv.ptrs_to.AddLast(this); };
829 this.funding_txo = funding_txo_hu_conv;
830 long channel_type = bindings.LDKEvent_ChannelPending_get_channel_type(ptr);
831 org.ldk.structs.ChannelTypeFeatures channel_type_hu_conv = null; if (channel_type < 0 || channel_type > 4096) { channel_type_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, channel_type); }
832 if (channel_type_hu_conv != null) { channel_type_hu_conv.ptrs_to.AddLast(this); };
833 this.channel_type = channel_type_hu_conv;
836 /** A Event of type ChannelReady */
837 public class Event_ChannelReady : Event {
839 * The `channel_id` of the channel that is ready.
841 public ChannelId channel_id;
843 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
844 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
845 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
846 * `user_channel_id` will be randomized for an inbound channel.
848 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
849 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
850 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
852 public UInt128 user_channel_id;
854 * The `node_id` of the channel counterparty.
856 public byte[] counterparty_node_id;
858 * The features that this channel will operate with.
860 public ChannelTypeFeatures channel_type;
861 internal Event_ChannelReady(long ptr) : base(null, ptr) {
862 long channel_id = bindings.LDKEvent_ChannelReady_get_channel_id(ptr);
863 org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.ChannelId(null, channel_id); }
864 if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.AddLast(this); };
865 this.channel_id = channel_id_hu_conv;
866 long user_channel_id = bindings.LDKEvent_ChannelReady_get_user_channel_id(ptr);
867 org.ldk.util.UInt128 user_channel_id_conv = new org.ldk.util.UInt128(user_channel_id);
868 this.user_channel_id = user_channel_id_conv;
869 long counterparty_node_id = bindings.LDKEvent_ChannelReady_get_counterparty_node_id(ptr);
870 byte[] counterparty_node_id_conv = InternalUtils.decodeUint8Array(counterparty_node_id);
871 this.counterparty_node_id = counterparty_node_id_conv;
872 long channel_type = bindings.LDKEvent_ChannelReady_get_channel_type(ptr);
873 org.ldk.structs.ChannelTypeFeatures channel_type_hu_conv = null; if (channel_type < 0 || channel_type > 4096) { channel_type_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, channel_type); }
874 if (channel_type_hu_conv != null) { channel_type_hu_conv.ptrs_to.AddLast(this); };
875 this.channel_type = channel_type_hu_conv;
878 /** A Event of type ChannelClosed */
879 public class Event_ChannelClosed : Event {
881 * The `channel_id` of the channel which has been closed. Note that on-chain transactions
882 * resolving the channel are likely still awaiting confirmation.
884 public ChannelId channel_id;
886 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
887 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
888 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
889 * `user_channel_id` will be randomized for inbound channels.
890 * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
891 * zero for objects serialized with LDK versions prior to 0.0.102.
893 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
894 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
895 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
897 public UInt128 user_channel_id;
899 * The reason the channel was closed.
901 public ClosureReason reason;
903 * Counterparty in the closed channel.
905 * This field will be `None` for objects serialized prior to LDK 0.0.117.
907 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
909 public byte[] counterparty_node_id;
911 * Channel capacity of the closing channel (sats).
913 * This field will be `None` for objects serialized prior to LDK 0.0.117.
915 public Option_u64Z channel_capacity_sats;
917 * The original channel funding TXO; this helps checking for the existence and confirmation
918 * status of the closing tx.
919 * Note that for instances serialized in v0.0.119 or prior this will be missing (None).
921 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
923 public OutPoint channel_funding_txo;
924 internal Event_ChannelClosed(long ptr) : base(null, ptr) {
925 long channel_id = bindings.LDKEvent_ChannelClosed_get_channel_id(ptr);
926 org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.ChannelId(null, channel_id); }
927 if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.AddLast(this); };
928 this.channel_id = channel_id_hu_conv;
929 long user_channel_id = bindings.LDKEvent_ChannelClosed_get_user_channel_id(ptr);
930 org.ldk.util.UInt128 user_channel_id_conv = new org.ldk.util.UInt128(user_channel_id);
931 this.user_channel_id = user_channel_id_conv;
932 long reason = bindings.LDKEvent_ChannelClosed_get_reason(ptr);
933 org.ldk.structs.ClosureReason reason_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(reason);
934 if (reason_hu_conv != null) { reason_hu_conv.ptrs_to.AddLast(this); };
935 this.reason = reason_hu_conv;
936 long counterparty_node_id = bindings.LDKEvent_ChannelClosed_get_counterparty_node_id(ptr);
937 byte[] counterparty_node_id_conv = InternalUtils.decodeUint8Array(counterparty_node_id);
938 this.counterparty_node_id = counterparty_node_id_conv;
939 long channel_capacity_sats = bindings.LDKEvent_ChannelClosed_get_channel_capacity_sats(ptr);
940 org.ldk.structs.Option_u64Z channel_capacity_sats_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(channel_capacity_sats);
941 if (channel_capacity_sats_hu_conv != null) { channel_capacity_sats_hu_conv.ptrs_to.AddLast(this); };
942 this.channel_capacity_sats = channel_capacity_sats_hu_conv;
943 long channel_funding_txo = bindings.LDKEvent_ChannelClosed_get_channel_funding_txo(ptr);
944 org.ldk.structs.OutPoint channel_funding_txo_hu_conv = null; if (channel_funding_txo < 0 || channel_funding_txo > 4096) { channel_funding_txo_hu_conv = new org.ldk.structs.OutPoint(null, channel_funding_txo); }
945 if (channel_funding_txo_hu_conv != null) { channel_funding_txo_hu_conv.ptrs_to.AddLast(this); };
946 this.channel_funding_txo = channel_funding_txo_hu_conv;
949 /** A Event of type DiscardFunding */
950 public class Event_DiscardFunding : Event {
952 * The channel_id of the channel which has been closed.
954 public ChannelId channel_id;
956 * The full transaction received from the user
958 public byte[] transaction;
959 internal Event_DiscardFunding(long ptr) : base(null, ptr) {
960 long channel_id = bindings.LDKEvent_DiscardFunding_get_channel_id(ptr);
961 org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.ChannelId(null, channel_id); }
962 if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.AddLast(this); };
963 this.channel_id = channel_id_hu_conv;
964 long transaction = bindings.LDKEvent_DiscardFunding_get_transaction(ptr);
965 byte[] transaction_conv = InternalUtils.decodeUint8Array(transaction);
966 this.transaction = transaction_conv;
969 /** A Event of type OpenChannelRequest */
970 public class Event_OpenChannelRequest : Event {
972 * The temporary channel ID of the channel requested to be opened.
974 * When responding to the request, the `temporary_channel_id` should be passed
975 * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
976 * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
978 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
979 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
981 public ChannelId temporary_channel_id;
983 * The node_id of the counterparty requesting to open the channel.
985 * When responding to the request, the `counterparty_node_id` should be passed
986 * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
987 * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
990 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
991 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
993 public byte[] counterparty_node_id;
995 * The channel value of the requested channel.
997 public long funding_satoshis;
999 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
1001 public long push_msat;
1003 * The features that this channel will operate with. If you reject the channel, a
1004 * well-behaved counterparty may automatically re-attempt the channel with a new set of
1007 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
1008 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
1011 * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
1012 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
1013 * 0.0.107. Channels setting this type also need to get manually accepted via
1014 * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
1015 * or will be rejected otherwise.
1017 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
1019 public ChannelTypeFeatures channel_type;
1020 internal Event_OpenChannelRequest(long ptr) : base(null, ptr) {
1021 long temporary_channel_id = bindings.LDKEvent_OpenChannelRequest_get_temporary_channel_id(ptr);
1022 org.ldk.structs.ChannelId temporary_channel_id_hu_conv = null; if (temporary_channel_id < 0 || temporary_channel_id > 4096) { temporary_channel_id_hu_conv = new org.ldk.structs.ChannelId(null, temporary_channel_id); }
1023 if (temporary_channel_id_hu_conv != null) { temporary_channel_id_hu_conv.ptrs_to.AddLast(this); };
1024 this.temporary_channel_id = temporary_channel_id_hu_conv;
1025 long counterparty_node_id = bindings.LDKEvent_OpenChannelRequest_get_counterparty_node_id(ptr);
1026 byte[] counterparty_node_id_conv = InternalUtils.decodeUint8Array(counterparty_node_id);
1027 this.counterparty_node_id = counterparty_node_id_conv;
1028 this.funding_satoshis = bindings.LDKEvent_OpenChannelRequest_get_funding_satoshis(ptr);
1029 this.push_msat = bindings.LDKEvent_OpenChannelRequest_get_push_msat(ptr);
1030 long channel_type = bindings.LDKEvent_OpenChannelRequest_get_channel_type(ptr);
1031 org.ldk.structs.ChannelTypeFeatures channel_type_hu_conv = null; if (channel_type < 0 || channel_type > 4096) { channel_type_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, channel_type); }
1032 if (channel_type_hu_conv != null) { channel_type_hu_conv.ptrs_to.AddLast(this); };
1033 this.channel_type = channel_type_hu_conv;
1036 /** A Event of type HTLCHandlingFailed */
1037 public class Event_HTLCHandlingFailed : Event {
1039 * The channel over which the HTLC was received.
1041 public ChannelId prev_channel_id;
1043 * Destination of the HTLC that failed to be processed.
1045 public HTLCDestination failed_next_destination;
1046 internal Event_HTLCHandlingFailed(long ptr) : base(null, ptr) {
1047 long prev_channel_id = bindings.LDKEvent_HTLCHandlingFailed_get_prev_channel_id(ptr);
1048 org.ldk.structs.ChannelId prev_channel_id_hu_conv = null; if (prev_channel_id < 0 || prev_channel_id > 4096) { prev_channel_id_hu_conv = new org.ldk.structs.ChannelId(null, prev_channel_id); }
1049 if (prev_channel_id_hu_conv != null) { prev_channel_id_hu_conv.ptrs_to.AddLast(this); };
1050 this.prev_channel_id = prev_channel_id_hu_conv;
1051 long failed_next_destination = bindings.LDKEvent_HTLCHandlingFailed_get_failed_next_destination(ptr);
1052 org.ldk.structs.HTLCDestination failed_next_destination_hu_conv = org.ldk.structs.HTLCDestination.constr_from_ptr(failed_next_destination);
1053 if (failed_next_destination_hu_conv != null) { failed_next_destination_hu_conv.ptrs_to.AddLast(this); };
1054 this.failed_next_destination = failed_next_destination_hu_conv;
1057 /** A Event of type BumpTransaction */
1058 public class Event_BumpTransaction : Event {
1059 public BumpTransactionEvent bump_transaction;
1060 internal Event_BumpTransaction(long ptr) : base(null, ptr) {
1061 long bump_transaction = bindings.LDKEvent_BumpTransaction_get_bump_transaction(ptr);
1062 org.ldk.structs.BumpTransactionEvent bump_transaction_hu_conv = org.ldk.structs.BumpTransactionEvent.constr_from_ptr(bump_transaction);
1063 if (bump_transaction_hu_conv != null) { bump_transaction_hu_conv.ptrs_to.AddLast(this); };
1064 this.bump_transaction = bump_transaction_hu_conv;
1067 internal long clone_ptr() {
1068 long ret = bindings.Event_clone_ptr(this.ptr);
1074 * Creates a copy of the Event
1076 public Event clone() {
1077 long ret = bindings.Event_clone(this.ptr);
1079 if (ret >= 0 && ret <= 4096) { return null; }
1080 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1081 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
1086 * Utility method to constructs a new FundingGenerationReady-variant Event
1088 public static Event funding_generation_ready(org.ldk.structs.ChannelId temporary_channel_id, byte[] counterparty_node_id, long channel_value_satoshis, byte[] output_script, org.ldk.util.UInt128 user_channel_id) {
1089 long ret = bindings.Event_funding_generation_ready(temporary_channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), channel_value_satoshis, InternalUtils.encodeUint8Array(output_script), InternalUtils.encodeUint8Array(user_channel_id.getLEBytes()));
1090 GC.KeepAlive(temporary_channel_id);
1091 GC.KeepAlive(counterparty_node_id);
1092 GC.KeepAlive(channel_value_satoshis);
1093 GC.KeepAlive(output_script);
1094 GC.KeepAlive(user_channel_id);
1095 if (ret >= 0 && ret <= 4096) { return null; }
1096 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1097 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1098 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(temporary_channel_id); };
1103 * Utility method to constructs a new PaymentClaimable-variant Event
1105 public static Event payment_claimable(byte[] receiver_node_id, byte[] payment_hash, org.ldk.structs.RecipientOnionFields onion_fields, long amount_msat, long counterparty_skimmed_fee_msat, org.ldk.structs.PaymentPurpose purpose, org.ldk.structs.ChannelId via_channel_id, org.ldk.structs.Option_U128Z via_user_channel_id, org.ldk.structs.Option_u32Z claim_deadline) {
1106 long ret = bindings.Event_payment_claimable(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(receiver_node_id, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), onion_fields.ptr, amount_msat, counterparty_skimmed_fee_msat, purpose.ptr, via_channel_id.ptr, via_user_channel_id.ptr, claim_deadline.ptr);
1107 GC.KeepAlive(receiver_node_id);
1108 GC.KeepAlive(payment_hash);
1109 GC.KeepAlive(onion_fields);
1110 GC.KeepAlive(amount_msat);
1111 GC.KeepAlive(counterparty_skimmed_fee_msat);
1112 GC.KeepAlive(purpose);
1113 GC.KeepAlive(via_channel_id);
1114 GC.KeepAlive(via_user_channel_id);
1115 GC.KeepAlive(claim_deadline);
1116 if (ret >= 0 && ret <= 4096) { return null; }
1117 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1118 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1119 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(onion_fields); };
1120 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(purpose); };
1121 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(via_channel_id); };
1122 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(via_user_channel_id); };
1123 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(claim_deadline); };
1128 * Utility method to constructs a new PaymentClaimed-variant Event
1130 public static Event payment_claimed(byte[] receiver_node_id, byte[] payment_hash, long amount_msat, org.ldk.structs.PaymentPurpose purpose, ClaimedHTLC[] htlcs, org.ldk.structs.Option_u64Z sender_intended_total_msat) {
1131 long ret = bindings.Event_payment_claimed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(receiver_node_id, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), amount_msat, purpose.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(htlcs, htlcs_conv_13 => htlcs_conv_13.ptr)), sender_intended_total_msat.ptr);
1132 GC.KeepAlive(receiver_node_id);
1133 GC.KeepAlive(payment_hash);
1134 GC.KeepAlive(amount_msat);
1135 GC.KeepAlive(purpose);
1136 GC.KeepAlive(htlcs);
1137 GC.KeepAlive(sender_intended_total_msat);
1138 if (ret >= 0 && ret <= 4096) { return null; }
1139 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1140 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1141 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(purpose); };
1142 foreach (ClaimedHTLC htlcs_conv_13 in htlcs) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(htlcs_conv_13); }; };
1143 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(sender_intended_total_msat); };
1148 * Utility method to constructs a new ConnectionNeeded-variant Event
1150 public static Event connection_needed(byte[] node_id, SocketAddress[] addresses) {
1151 long ret = bindings.Event_connection_needed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(addresses, addresses_conv_15 => addresses_conv_15.ptr)));
1152 GC.KeepAlive(node_id);
1153 GC.KeepAlive(addresses);
1154 if (ret >= 0 && ret <= 4096) { return null; }
1155 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1156 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1157 foreach (SocketAddress addresses_conv_15 in addresses) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(addresses_conv_15); }; };
1162 * Utility method to constructs a new InvoiceRequestFailed-variant Event
1164 public static Event invoice_request_failed(byte[] payment_id) {
1165 long ret = bindings.Event_invoice_request_failed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)));
1166 GC.KeepAlive(payment_id);
1167 if (ret >= 0 && ret <= 4096) { return null; }
1168 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1169 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1174 * Utility method to constructs a new PaymentSent-variant Event
1176 public static Event payment_sent(org.ldk.structs.Option_ThirtyTwoBytesZ payment_id, byte[] payment_preimage, byte[] payment_hash, org.ldk.structs.Option_u64Z fee_paid_msat) {
1177 long ret = bindings.Event_payment_sent(payment_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_preimage, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), fee_paid_msat.ptr);
1178 GC.KeepAlive(payment_id);
1179 GC.KeepAlive(payment_preimage);
1180 GC.KeepAlive(payment_hash);
1181 GC.KeepAlive(fee_paid_msat);
1182 if (ret >= 0 && ret <= 4096) { return null; }
1183 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1184 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1185 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_id); };
1186 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(fee_paid_msat); };
1191 * Utility method to constructs a new PaymentFailed-variant Event
1193 public static Event payment_failed(byte[] payment_id, byte[] payment_hash, org.ldk.structs.Option_PaymentFailureReasonZ reason) {
1194 long ret = bindings.Event_payment_failed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), reason.ptr);
1195 GC.KeepAlive(payment_id);
1196 GC.KeepAlive(payment_hash);
1197 GC.KeepAlive(reason);
1198 if (ret >= 0 && ret <= 4096) { return null; }
1199 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1200 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1201 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(reason); };
1206 * Utility method to constructs a new PaymentPathSuccessful-variant Event
1208 public static Event payment_path_successful(byte[] payment_id, org.ldk.structs.Option_ThirtyTwoBytesZ payment_hash, org.ldk.structs.Path path) {
1209 long ret = bindings.Event_payment_path_successful(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), payment_hash.ptr, path.ptr);
1210 GC.KeepAlive(payment_id);
1211 GC.KeepAlive(payment_hash);
1213 if (ret >= 0 && ret <= 4096) { return null; }
1214 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1215 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1216 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_hash); };
1217 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(path); };
1222 * Utility method to constructs a new PaymentPathFailed-variant Event
1224 public static Event payment_path_failed(org.ldk.structs.Option_ThirtyTwoBytesZ payment_id, byte[] payment_hash, bool payment_failed_permanently, org.ldk.structs.PathFailure failure, org.ldk.structs.Path path, org.ldk.structs.Option_u64Z short_channel_id) {
1225 long ret = bindings.Event_payment_path_failed(payment_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), payment_failed_permanently, failure.ptr, path.ptr, short_channel_id.ptr);
1226 GC.KeepAlive(payment_id);
1227 GC.KeepAlive(payment_hash);
1228 GC.KeepAlive(payment_failed_permanently);
1229 GC.KeepAlive(failure);
1231 GC.KeepAlive(short_channel_id);
1232 if (ret >= 0 && ret <= 4096) { return null; }
1233 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1234 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1235 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_id); };
1236 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(failure); };
1237 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(path); };
1238 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(short_channel_id); };
1243 * Utility method to constructs a new ProbeSuccessful-variant Event
1245 public static Event probe_successful(byte[] payment_id, byte[] payment_hash, org.ldk.structs.Path path) {
1246 long ret = bindings.Event_probe_successful(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), path.ptr);
1247 GC.KeepAlive(payment_id);
1248 GC.KeepAlive(payment_hash);
1250 if (ret >= 0 && ret <= 4096) { return null; }
1251 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1252 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1253 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(path); };
1258 * Utility method to constructs a new ProbeFailed-variant Event
1260 public static Event probe_failed(byte[] payment_id, byte[] payment_hash, org.ldk.structs.Path path, org.ldk.structs.Option_u64Z short_channel_id) {
1261 long ret = bindings.Event_probe_failed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), path.ptr, short_channel_id.ptr);
1262 GC.KeepAlive(payment_id);
1263 GC.KeepAlive(payment_hash);
1265 GC.KeepAlive(short_channel_id);
1266 if (ret >= 0 && ret <= 4096) { return null; }
1267 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1268 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1269 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(path); };
1270 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(short_channel_id); };
1275 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
1277 public static Event pending_htlcs_forwardable(long time_forwardable) {
1278 long ret = bindings.Event_pending_htlcs_forwardable(time_forwardable);
1279 GC.KeepAlive(time_forwardable);
1280 if (ret >= 0 && ret <= 4096) { return null; }
1281 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1282 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1287 * Utility method to constructs a new HTLCIntercepted-variant Event
1289 public static Event htlcintercepted(byte[] intercept_id, long requested_next_hop_scid, byte[] payment_hash, long inbound_amount_msat, long expected_outbound_amount_msat) {
1290 long ret = bindings.Event_htlcintercepted(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(intercept_id, 32)), requested_next_hop_scid, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), inbound_amount_msat, expected_outbound_amount_msat);
1291 GC.KeepAlive(intercept_id);
1292 GC.KeepAlive(requested_next_hop_scid);
1293 GC.KeepAlive(payment_hash);
1294 GC.KeepAlive(inbound_amount_msat);
1295 GC.KeepAlive(expected_outbound_amount_msat);
1296 if (ret >= 0 && ret <= 4096) { return null; }
1297 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1298 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1303 * Utility method to constructs a new SpendableOutputs-variant Event
1305 public static Event spendable_outputs(SpendableOutputDescriptor[] outputs, org.ldk.structs.ChannelId channel_id) {
1306 long ret = bindings.Event_spendable_outputs(InternalUtils.encodeUint64Array(InternalUtils.mapArray(outputs, outputs_conv_27 => outputs_conv_27.ptr)), channel_id.ptr);
1307 GC.KeepAlive(outputs);
1308 GC.KeepAlive(channel_id);
1309 if (ret >= 0 && ret <= 4096) { return null; }
1310 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1311 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1312 foreach (SpendableOutputDescriptor outputs_conv_27 in outputs) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outputs_conv_27); }; };
1313 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id); };
1318 * Utility method to constructs a new PaymentForwarded-variant Event
1320 public static Event payment_forwarded(org.ldk.structs.ChannelId prev_channel_id, org.ldk.structs.ChannelId next_channel_id, org.ldk.structs.Option_U128Z prev_user_channel_id, org.ldk.structs.Option_U128Z next_user_channel_id, org.ldk.structs.Option_u64Z total_fee_earned_msat, org.ldk.structs.Option_u64Z skimmed_fee_msat, bool claim_from_onchain_tx, org.ldk.structs.Option_u64Z outbound_amount_forwarded_msat) {
1321 long ret = bindings.Event_payment_forwarded(prev_channel_id.ptr, next_channel_id.ptr, prev_user_channel_id.ptr, next_user_channel_id.ptr, total_fee_earned_msat.ptr, skimmed_fee_msat.ptr, claim_from_onchain_tx, outbound_amount_forwarded_msat.ptr);
1322 GC.KeepAlive(prev_channel_id);
1323 GC.KeepAlive(next_channel_id);
1324 GC.KeepAlive(prev_user_channel_id);
1325 GC.KeepAlive(next_user_channel_id);
1326 GC.KeepAlive(total_fee_earned_msat);
1327 GC.KeepAlive(skimmed_fee_msat);
1328 GC.KeepAlive(claim_from_onchain_tx);
1329 GC.KeepAlive(outbound_amount_forwarded_msat);
1330 if (ret >= 0 && ret <= 4096) { return null; }
1331 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1332 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1333 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(prev_channel_id); };
1334 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(next_channel_id); };
1335 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(prev_user_channel_id); };
1336 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(next_user_channel_id); };
1337 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(total_fee_earned_msat); };
1338 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(skimmed_fee_msat); };
1339 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outbound_amount_forwarded_msat); };
1344 * Utility method to constructs a new ChannelPending-variant Event
1346 public static Event channel_pending(org.ldk.structs.ChannelId channel_id, org.ldk.util.UInt128 user_channel_id, org.ldk.structs.ChannelId former_temporary_channel_id, byte[] counterparty_node_id, org.ldk.structs.OutPoint funding_txo, org.ldk.structs.ChannelTypeFeatures channel_type) {
1347 long ret = bindings.Event_channel_pending(channel_id.ptr, InternalUtils.encodeUint8Array(user_channel_id.getLEBytes()), former_temporary_channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), funding_txo.ptr, channel_type.ptr);
1348 GC.KeepAlive(channel_id);
1349 GC.KeepAlive(user_channel_id);
1350 GC.KeepAlive(former_temporary_channel_id);
1351 GC.KeepAlive(counterparty_node_id);
1352 GC.KeepAlive(funding_txo);
1353 GC.KeepAlive(channel_type);
1354 if (ret >= 0 && ret <= 4096) { return null; }
1355 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1356 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1357 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id); };
1358 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(former_temporary_channel_id); };
1359 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_txo); };
1360 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type); };
1365 * Utility method to constructs a new ChannelReady-variant Event
1367 public static Event channel_ready(org.ldk.structs.ChannelId channel_id, org.ldk.util.UInt128 user_channel_id, byte[] counterparty_node_id, org.ldk.structs.ChannelTypeFeatures channel_type) {
1368 long ret = bindings.Event_channel_ready(channel_id.ptr, InternalUtils.encodeUint8Array(user_channel_id.getLEBytes()), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), channel_type.ptr);
1369 GC.KeepAlive(channel_id);
1370 GC.KeepAlive(user_channel_id);
1371 GC.KeepAlive(counterparty_node_id);
1372 GC.KeepAlive(channel_type);
1373 if (ret >= 0 && ret <= 4096) { return null; }
1374 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1375 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1376 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id); };
1377 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type); };
1382 * Utility method to constructs a new ChannelClosed-variant Event
1384 public static Event channel_closed(org.ldk.structs.ChannelId channel_id, org.ldk.util.UInt128 user_channel_id, org.ldk.structs.ClosureReason reason, byte[] counterparty_node_id, org.ldk.structs.Option_u64Z channel_capacity_sats, org.ldk.structs.OutPoint channel_funding_txo) {
1385 long ret = bindings.Event_channel_closed(channel_id.ptr, InternalUtils.encodeUint8Array(user_channel_id.getLEBytes()), reason.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), channel_capacity_sats.ptr, channel_funding_txo.ptr);
1386 GC.KeepAlive(channel_id);
1387 GC.KeepAlive(user_channel_id);
1388 GC.KeepAlive(reason);
1389 GC.KeepAlive(counterparty_node_id);
1390 GC.KeepAlive(channel_capacity_sats);
1391 GC.KeepAlive(channel_funding_txo);
1392 if (ret >= 0 && ret <= 4096) { return null; }
1393 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1394 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1395 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id); };
1396 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(reason); };
1397 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_capacity_sats); };
1398 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_funding_txo); };
1403 * Utility method to constructs a new DiscardFunding-variant Event
1405 public static Event discard_funding(org.ldk.structs.ChannelId channel_id, byte[] transaction) {
1406 long ret = bindings.Event_discard_funding(channel_id.ptr, InternalUtils.encodeUint8Array(transaction));
1407 GC.KeepAlive(channel_id);
1408 GC.KeepAlive(transaction);
1409 if (ret >= 0 && ret <= 4096) { return null; }
1410 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1411 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1412 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id); };
1417 * Utility method to constructs a new OpenChannelRequest-variant Event
1419 public static Event open_channel_request(org.ldk.structs.ChannelId temporary_channel_id, byte[] counterparty_node_id, long funding_satoshis, long push_msat, org.ldk.structs.ChannelTypeFeatures channel_type) {
1420 long ret = bindings.Event_open_channel_request(temporary_channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), funding_satoshis, push_msat, channel_type.ptr);
1421 GC.KeepAlive(temporary_channel_id);
1422 GC.KeepAlive(counterparty_node_id);
1423 GC.KeepAlive(funding_satoshis);
1424 GC.KeepAlive(push_msat);
1425 GC.KeepAlive(channel_type);
1426 if (ret >= 0 && ret <= 4096) { return null; }
1427 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1428 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1429 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(temporary_channel_id); };
1430 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type); };
1435 * Utility method to constructs a new HTLCHandlingFailed-variant Event
1437 public static Event htlchandling_failed(org.ldk.structs.ChannelId prev_channel_id, org.ldk.structs.HTLCDestination failed_next_destination) {
1438 long ret = bindings.Event_htlchandling_failed(prev_channel_id.ptr, failed_next_destination.ptr);
1439 GC.KeepAlive(prev_channel_id);
1440 GC.KeepAlive(failed_next_destination);
1441 if (ret >= 0 && ret <= 4096) { return null; }
1442 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1443 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1444 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(prev_channel_id); };
1445 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(failed_next_destination); };
1450 * Utility method to constructs a new BumpTransaction-variant Event
1452 public static Event bump_transaction(org.ldk.structs.BumpTransactionEvent a) {
1453 long ret = bindings.Event_bump_transaction(a.ptr);
1455 if (ret >= 0 && ret <= 4096) { return null; }
1456 org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret);
1457 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
1458 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); };
1463 * Checks if two Events contain equal inner contents.
1464 * This ignores pointers and is_owned flags and looks at the values in fields.
1466 public bool eq(org.ldk.structs.Event b) {
1467 bool ret = bindings.Event_eq(this.ptr, b.ptr);
1473 public override bool Equals(object o) {
1474 if (!(o is Event)) return false;
1475 return this.eq((Event)o);
1478 * Serialize the Event object into a byte array which can be read by Event_read
1480 public byte[] write() {
1481 long ret = bindings.Event_write(this.ptr);
1483 if (ret >= 0 && ret <= 4096) { return null; }
1484 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);