6 namespace org { namespace ldk { namespace structs {
10 * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`]
12 public class ChannelDetails : CommonBase {
13 internal ChannelDetails(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.ChannelDetails_free(ptr); }
19 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
20 * thereafter this is the txid of the funding transaction xor the funding transaction output).
21 * Note that this means this value is *not* persistent - it can change once during the
22 * lifetime of the channel.
24 public ChannelId get_channel_id() {
25 long ret = bindings.ChannelDetails_get_channel_id(this.ptr);
27 if (ret >= 0 && ret <= 4096) { return null; }
28 org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); }
29 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
34 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
35 * thereafter this is the txid of the funding transaction xor the funding transaction output).
36 * Note that this means this value is *not* persistent - it can change once during the
37 * lifetime of the channel.
39 public void set_channel_id(org.ldk.structs.ChannelId val) {
40 bindings.ChannelDetails_set_channel_id(this.ptr, val.ptr);
43 if (this != null) { this.ptrs_to.AddLast(val); };
47 * Parameters which apply to our counterparty. See individual fields for more information.
49 public ChannelCounterparty get_counterparty() {
50 long ret = bindings.ChannelDetails_get_counterparty(this.ptr);
52 if (ret >= 0 && ret <= 4096) { return null; }
53 org.ldk.structs.ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelCounterparty(null, ret); }
54 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
59 * Parameters which apply to our counterparty. See individual fields for more information.
61 public void set_counterparty(org.ldk.structs.ChannelCounterparty val) {
62 bindings.ChannelDetails_set_counterparty(this.ptr, val.ptr);
65 if (this != null) { this.ptrs_to.AddLast(val); };
69 * The Channel's funding transaction output, if we've negotiated the funding transaction with
70 * our counterparty already.
72 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
74 public OutPoint get_funding_txo() {
75 long ret = bindings.ChannelDetails_get_funding_txo(this.ptr);
77 if (ret >= 0 && ret <= 4096) { return null; }
78 org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); }
79 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
84 * The Channel's funding transaction output, if we've negotiated the funding transaction with
85 * our counterparty already.
87 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
89 public void set_funding_txo(org.ldk.structs.OutPoint val) {
90 bindings.ChannelDetails_set_funding_txo(this.ptr, val == null ? 0 : val.ptr);
93 if (this != null) { this.ptrs_to.AddLast(val); };
97 * The features which this channel operates with. See individual features for more info.
99 * `None` until negotiation completes and the channel type is finalized.
101 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
103 public ChannelTypeFeatures get_channel_type() {
104 long ret = bindings.ChannelDetails_get_channel_type(this.ptr);
106 if (ret >= 0 && ret <= 4096) { return null; }
107 org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); }
108 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
113 * The features which this channel operates with. See individual features for more info.
115 * `None` until negotiation completes and the channel type is finalized.
117 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
119 public void set_channel_type(org.ldk.structs.ChannelTypeFeatures val) {
120 bindings.ChannelDetails_set_channel_type(this.ptr, val == null ? 0 : val.ptr);
123 if (this != null) { this.ptrs_to.AddLast(val); };
127 * The position of the funding transaction in the chain. None if the funding transaction has
128 * not yet been confirmed and the channel fully opened.
130 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
131 * payments instead of this. See [`get_inbound_payment_scid`].
133 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
134 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
136 * [`inbound_scid_alias`]: Self::inbound_scid_alias
137 * [`outbound_scid_alias`]: Self::outbound_scid_alias
138 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
139 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
140 * [`confirmations_required`]: Self::confirmations_required
142 public Option_u64Z get_short_channel_id() {
143 long ret = bindings.ChannelDetails_get_short_channel_id(this.ptr);
145 if (ret >= 0 && ret <= 4096) { return null; }
146 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
147 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
152 * The position of the funding transaction in the chain. None if the funding transaction has
153 * not yet been confirmed and the channel fully opened.
155 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
156 * payments instead of this. See [`get_inbound_payment_scid`].
158 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
159 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
161 * [`inbound_scid_alias`]: Self::inbound_scid_alias
162 * [`outbound_scid_alias`]: Self::outbound_scid_alias
163 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
164 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
165 * [`confirmations_required`]: Self::confirmations_required
167 public void set_short_channel_id(org.ldk.structs.Option_u64Z val) {
168 bindings.ChannelDetails_set_short_channel_id(this.ptr, val.ptr);
171 if (this != null) { this.ptrs_to.AddLast(val); };
175 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
176 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
177 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
180 * This will be `None` as long as the channel is not available for routing outbound payments.
182 * [`short_channel_id`]: Self::short_channel_id
183 * [`confirmations_required`]: Self::confirmations_required
185 public Option_u64Z get_outbound_scid_alias() {
186 long ret = bindings.ChannelDetails_get_outbound_scid_alias(this.ptr);
188 if (ret >= 0 && ret <= 4096) { return null; }
189 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
190 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
195 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
196 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
197 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
200 * This will be `None` as long as the channel is not available for routing outbound payments.
202 * [`short_channel_id`]: Self::short_channel_id
203 * [`confirmations_required`]: Self::confirmations_required
205 public void set_outbound_scid_alias(org.ldk.structs.Option_u64Z val) {
206 bindings.ChannelDetails_set_outbound_scid_alias(this.ptr, val.ptr);
209 if (this != null) { this.ptrs_to.AddLast(val); };
213 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
214 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
215 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
216 * when they see a payment to be routed to us.
218 * Our counterparty may choose to rotate this value at any time, though will always recognize
219 * previous values for inbound payment forwarding.
221 * [`short_channel_id`]: Self::short_channel_id
223 public Option_u64Z get_inbound_scid_alias() {
224 long ret = bindings.ChannelDetails_get_inbound_scid_alias(this.ptr);
226 if (ret >= 0 && ret <= 4096) { return null; }
227 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
228 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
233 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
234 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
235 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
236 * when they see a payment to be routed to us.
238 * Our counterparty may choose to rotate this value at any time, though will always recognize
239 * previous values for inbound payment forwarding.
241 * [`short_channel_id`]: Self::short_channel_id
243 public void set_inbound_scid_alias(org.ldk.structs.Option_u64Z val) {
244 bindings.ChannelDetails_set_inbound_scid_alias(this.ptr, val.ptr);
247 if (this != null) { this.ptrs_to.AddLast(val); };
251 * The value, in satoshis, of this channel as appears in the funding output
253 public long get_channel_value_satoshis() {
254 long ret = bindings.ChannelDetails_get_channel_value_satoshis(this.ptr);
260 * The value, in satoshis, of this channel as appears in the funding output
262 public void set_channel_value_satoshis(long val) {
263 bindings.ChannelDetails_set_channel_value_satoshis(this.ptr, val);
269 * The value, in satoshis, that must always be held in the channel for us. This value ensures
270 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
271 * this value on chain.
273 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
275 * This value will be `None` for outbound channels until the counterparty accepts the channel.
277 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
279 public Option_u64Z get_unspendable_punishment_reserve() {
280 long ret = bindings.ChannelDetails_get_unspendable_punishment_reserve(this.ptr);
282 if (ret >= 0 && ret <= 4096) { return null; }
283 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
284 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
289 * The value, in satoshis, that must always be held in the channel for us. This value ensures
290 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
291 * this value on chain.
293 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
295 * This value will be `None` for outbound channels until the counterparty accepts the channel.
297 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
299 public void set_unspendable_punishment_reserve(org.ldk.structs.Option_u64Z val) {
300 bindings.ChannelDetails_set_unspendable_punishment_reserve(this.ptr, val.ptr);
303 if (this != null) { this.ptrs_to.AddLast(val); };
307 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
308 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
309 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
310 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
311 * serialized with LDK versions prior to 0.0.113.
313 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
314 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
315 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
317 public UInt128 get_user_channel_id() {
318 long ret = bindings.ChannelDetails_get_user_channel_id(this.ptr);
320 if (ret >= 0 && ret <= 4096) { return null; }
321 org.ldk.util.UInt128 ret_conv = new org.ldk.util.UInt128(ret);
326 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
327 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
328 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
329 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
330 * serialized with LDK versions prior to 0.0.113.
332 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
333 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
334 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
336 public void set_user_channel_id(org.ldk.util.UInt128 val) {
337 bindings.ChannelDetails_set_user_channel_id(this.ptr, InternalUtils.encodeUint8Array(val.getLEBytes()));
343 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
344 * which is applied to commitment and HTLC transactions.
346 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
348 public Option_u32Z get_feerate_sat_per_1000_weight() {
349 long ret = bindings.ChannelDetails_get_feerate_sat_per_1000_weight(this.ptr);
351 if (ret >= 0 && ret <= 4096) { return null; }
352 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
353 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
358 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
359 * which is applied to commitment and HTLC transactions.
361 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
363 public void set_feerate_sat_per_1000_weight(org.ldk.structs.Option_u32Z val) {
364 bindings.ChannelDetails_set_feerate_sat_per_1000_weight(this.ptr, val.ptr);
367 if (this != null) { this.ptrs_to.AddLast(val); };
371 * Our total balance. This is the amount we would get if we close the channel.
372 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
373 * amount is not likely to be recoverable on close.
375 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
376 * balance is not available for inclusion in new outbound HTLCs). This further does not include
377 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
378 * This does not consider any on-chain fees.
380 * See also [`ChannelDetails::outbound_capacity_msat`]
382 public long get_balance_msat() {
383 long ret = bindings.ChannelDetails_get_balance_msat(this.ptr);
389 * Our total balance. This is the amount we would get if we close the channel.
390 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
391 * amount is not likely to be recoverable on close.
393 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
394 * balance is not available for inclusion in new outbound HTLCs). This further does not include
395 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
396 * This does not consider any on-chain fees.
398 * See also [`ChannelDetails::outbound_capacity_msat`]
400 public void set_balance_msat(long val) {
401 bindings.ChannelDetails_set_balance_msat(this.ptr, val);
407 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
408 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
409 * available for inclusion in new outbound HTLCs). This further does not include any pending
410 * outgoing HTLCs which are awaiting some other resolution to be sent.
412 * See also [`ChannelDetails::balance_msat`]
414 * This value is not exact. Due to various in-flight changes, feerate changes, and our
415 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
416 * should be able to spend nearly this amount.
418 public long get_outbound_capacity_msat() {
419 long ret = bindings.ChannelDetails_get_outbound_capacity_msat(this.ptr);
425 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
426 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
427 * available for inclusion in new outbound HTLCs). This further does not include any pending
428 * outgoing HTLCs which are awaiting some other resolution to be sent.
430 * See also [`ChannelDetails::balance_msat`]
432 * This value is not exact. Due to various in-flight changes, feerate changes, and our
433 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
434 * should be able to spend nearly this amount.
436 public void set_outbound_capacity_msat(long val) {
437 bindings.ChannelDetails_set_outbound_capacity_msat(this.ptr, val);
443 * The available outbound capacity for sending a single HTLC to the remote peer. This is
444 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
445 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
446 * to use a limit as close as possible to the HTLC limit we can currently send.
448 * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
449 * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
451 public long get_next_outbound_htlc_limit_msat() {
452 long ret = bindings.ChannelDetails_get_next_outbound_htlc_limit_msat(this.ptr);
458 * The available outbound capacity for sending a single HTLC to the remote peer. This is
459 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
460 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
461 * to use a limit as close as possible to the HTLC limit we can currently send.
463 * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
464 * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
466 public void set_next_outbound_htlc_limit_msat(long val) {
467 bindings.ChannelDetails_set_next_outbound_htlc_limit_msat(this.ptr, val);
473 * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
474 * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
475 * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
476 * route which is valid.
478 public long get_next_outbound_htlc_minimum_msat() {
479 long ret = bindings.ChannelDetails_get_next_outbound_htlc_minimum_msat(this.ptr);
485 * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
486 * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
487 * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
488 * route which is valid.
490 public void set_next_outbound_htlc_minimum_msat(long val) {
491 bindings.ChannelDetails_set_next_outbound_htlc_minimum_msat(this.ptr, val);
497 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
498 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
499 * available for inclusion in new inbound HTLCs).
500 * Note that there are some corner cases not fully handled here, so the actual available
501 * inbound capacity may be slightly higher than this.
503 * This value is not exact. Due to various in-flight changes, feerate changes, and our
504 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
505 * However, our counterparty should be able to spend nearly this amount.
507 public long get_inbound_capacity_msat() {
508 long ret = bindings.ChannelDetails_get_inbound_capacity_msat(this.ptr);
514 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
515 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
516 * available for inclusion in new inbound HTLCs).
517 * Note that there are some corner cases not fully handled here, so the actual available
518 * inbound capacity may be slightly higher than this.
520 * This value is not exact. Due to various in-flight changes, feerate changes, and our
521 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
522 * However, our counterparty should be able to spend nearly this amount.
524 public void set_inbound_capacity_msat(long val) {
525 bindings.ChannelDetails_set_inbound_capacity_msat(this.ptr, val);
531 * The number of required confirmations on the funding transaction before the funding will be
532 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
533 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
534 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
535 * [`ChannelHandshakeLimits::max_minimum_depth`].
537 * This value will be `None` for outbound channels until the counterparty accepts the channel.
539 * [`is_outbound`]: ChannelDetails::is_outbound
540 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
541 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
543 public Option_u32Z get_confirmations_required() {
544 long ret = bindings.ChannelDetails_get_confirmations_required(this.ptr);
546 if (ret >= 0 && ret <= 4096) { return null; }
547 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
548 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
553 * The number of required confirmations on the funding transaction before the funding will be
554 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
555 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
556 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
557 * [`ChannelHandshakeLimits::max_minimum_depth`].
559 * This value will be `None` for outbound channels until the counterparty accepts the channel.
561 * [`is_outbound`]: ChannelDetails::is_outbound
562 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
563 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
565 public void set_confirmations_required(org.ldk.structs.Option_u32Z val) {
566 bindings.ChannelDetails_set_confirmations_required(this.ptr, val.ptr);
569 if (this != null) { this.ptrs_to.AddLast(val); };
573 * The current number of confirmations on the funding transaction.
575 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
577 public Option_u32Z get_confirmations() {
578 long ret = bindings.ChannelDetails_get_confirmations(this.ptr);
580 if (ret >= 0 && ret <= 4096) { return null; }
581 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
582 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
587 * The current number of confirmations on the funding transaction.
589 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
591 public void set_confirmations(org.ldk.structs.Option_u32Z val) {
592 bindings.ChannelDetails_set_confirmations(this.ptr, val.ptr);
595 if (this != null) { this.ptrs_to.AddLast(val); };
599 * The number of blocks (after our commitment transaction confirms) that we will need to wait
600 * until we can claim our funds after we force-close the channel. During this time our
601 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
602 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
603 * time to claim our non-HTLC-encumbered funds.
605 * This value will be `None` for outbound channels until the counterparty accepts the channel.
607 public Option_u16Z get_force_close_spend_delay() {
608 long ret = bindings.ChannelDetails_get_force_close_spend_delay(this.ptr);
610 if (ret >= 0 && ret <= 4096) { return null; }
611 org.ldk.structs.Option_u16Z ret_hu_conv = org.ldk.structs.Option_u16Z.constr_from_ptr(ret);
612 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
617 * The number of blocks (after our commitment transaction confirms) that we will need to wait
618 * until we can claim our funds after we force-close the channel. During this time our
619 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
620 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
621 * time to claim our non-HTLC-encumbered funds.
623 * This value will be `None` for outbound channels until the counterparty accepts the channel.
625 public void set_force_close_spend_delay(org.ldk.structs.Option_u16Z val) {
626 bindings.ChannelDetails_set_force_close_spend_delay(this.ptr, val.ptr);
629 if (this != null) { this.ptrs_to.AddLast(val); };
633 * True if the channel was initiated (and thus funded) by us.
635 public bool get_is_outbound() {
636 bool ret = bindings.ChannelDetails_get_is_outbound(this.ptr);
642 * True if the channel was initiated (and thus funded) by us.
644 public void set_is_outbound(bool val) {
645 bindings.ChannelDetails_set_is_outbound(this.ptr, val);
651 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
652 * channel is not currently being shut down. `channel_ready` message exchange implies the
653 * required confirmation count has been reached (and we were connected to the peer at some
654 * point after the funding transaction received enough confirmations). The required
655 * confirmation count is provided in [`confirmations_required`].
657 * [`confirmations_required`]: ChannelDetails::confirmations_required
659 public bool get_is_channel_ready() {
660 bool ret = bindings.ChannelDetails_get_is_channel_ready(this.ptr);
666 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
667 * channel is not currently being shut down. `channel_ready` message exchange implies the
668 * required confirmation count has been reached (and we were connected to the peer at some
669 * point after the funding transaction received enough confirmations). The required
670 * confirmation count is provided in [`confirmations_required`].
672 * [`confirmations_required`]: ChannelDetails::confirmations_required
674 public void set_is_channel_ready(bool val) {
675 bindings.ChannelDetails_set_is_channel_ready(this.ptr, val);
681 * The stage of the channel's shutdown.
682 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
684 * Returns a copy of the field.
686 public Option_ChannelShutdownStateZ get_channel_shutdown_state() {
687 long ret = bindings.ChannelDetails_get_channel_shutdown_state(this.ptr);
689 if (ret >= 0 && ret <= 4096) { return null; }
690 org.ldk.structs.Option_ChannelShutdownStateZ ret_hu_conv = org.ldk.structs.Option_ChannelShutdownStateZ.constr_from_ptr(ret);
691 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
696 * The stage of the channel's shutdown.
697 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
699 public void set_channel_shutdown_state(org.ldk.structs.Option_ChannelShutdownStateZ val) {
700 bindings.ChannelDetails_set_channel_shutdown_state(this.ptr, val.ptr);
703 if (this != null) { this.ptrs_to.AddLast(val); };
707 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
708 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
710 * This is a strict superset of `is_channel_ready`.
712 public bool get_is_usable() {
713 bool ret = bindings.ChannelDetails_get_is_usable(this.ptr);
719 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
720 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
722 * This is a strict superset of `is_channel_ready`.
724 public void set_is_usable(bool val) {
725 bindings.ChannelDetails_set_is_usable(this.ptr, val);
731 * True if this channel is (or will be) publicly-announced.
733 public bool get_is_public() {
734 bool ret = bindings.ChannelDetails_get_is_public(this.ptr);
740 * True if this channel is (or will be) publicly-announced.
742 public void set_is_public(bool val) {
743 bindings.ChannelDetails_set_is_public(this.ptr, val);
749 * The smallest value HTLC (in msat) we will accept, for this channel. This field
750 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
752 public Option_u64Z get_inbound_htlc_minimum_msat() {
753 long ret = bindings.ChannelDetails_get_inbound_htlc_minimum_msat(this.ptr);
755 if (ret >= 0 && ret <= 4096) { return null; }
756 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
757 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
762 * The smallest value HTLC (in msat) we will accept, for this channel. This field
763 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
765 public void set_inbound_htlc_minimum_msat(org.ldk.structs.Option_u64Z val) {
766 bindings.ChannelDetails_set_inbound_htlc_minimum_msat(this.ptr, val.ptr);
769 if (this != null) { this.ptrs_to.AddLast(val); };
773 * The largest value HTLC (in msat) we currently will accept, for this channel.
775 public Option_u64Z get_inbound_htlc_maximum_msat() {
776 long ret = bindings.ChannelDetails_get_inbound_htlc_maximum_msat(this.ptr);
778 if (ret >= 0 && ret <= 4096) { return null; }
779 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
780 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
785 * The largest value HTLC (in msat) we currently will accept, for this channel.
787 public void set_inbound_htlc_maximum_msat(org.ldk.structs.Option_u64Z val) {
788 bindings.ChannelDetails_set_inbound_htlc_maximum_msat(this.ptr, val.ptr);
791 if (this != null) { this.ptrs_to.AddLast(val); };
795 * Set of configurable parameters that affect channel operation.
797 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
799 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
801 public ChannelConfig get_config() {
802 long ret = bindings.ChannelDetails_get_config(this.ptr);
804 if (ret >= 0 && ret <= 4096) { return null; }
805 org.ldk.structs.ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfig(null, ret); }
806 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
811 * Set of configurable parameters that affect channel operation.
813 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
815 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
817 public void set_config(org.ldk.structs.ChannelConfig val) {
818 bindings.ChannelDetails_set_config(this.ptr, val == null ? 0 : val.ptr);
821 if (this != null) { this.ptrs_to.AddLast(val); };
824 internal long clone_ptr() {
825 long ret = bindings.ChannelDetails_clone_ptr(this.ptr);
831 * Creates a copy of the ChannelDetails
833 public ChannelDetails clone() {
834 long ret = bindings.ChannelDetails_clone(this.ptr);
836 if (ret >= 0 && ret <= 4096) { return null; }
837 org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); }
838 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
843 * Gets the current SCID which should be used to identify this channel for inbound payments.
844 * This should be used for providing invoice hints or in any other context where our
845 * counterparty will forward a payment to us.
847 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
848 * [`ChannelDetails::short_channel_id`]. See those for more information.
850 public Option_u64Z get_inbound_payment_scid() {
851 long ret = bindings.ChannelDetails_get_inbound_payment_scid(this.ptr);
853 if (ret >= 0 && ret <= 4096) { return null; }
854 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
855 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
860 * Gets the current SCID which should be used to identify this channel for outbound payments.
861 * This should be used in [`Route`]s to describe the first hop or in other contexts where
862 * we're sending or forwarding a payment outbound over this channel.
864 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
865 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
867 public Option_u64Z get_outbound_payment_scid() {
868 long ret = bindings.ChannelDetails_get_outbound_payment_scid(this.ptr);
870 if (ret >= 0 && ret <= 4096) { return null; }
871 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
872 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
877 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
879 public byte[] write() {
880 long ret = bindings.ChannelDetails_write(this.ptr);
882 if (ret >= 0 && ret <= 4096) { return null; }
883 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
888 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
890 public static Result_ChannelDetailsDecodeErrorZ read(byte[] ser) {
891 long ret = bindings.ChannelDetails_read(InternalUtils.encodeUint8Array(ser));
893 if (ret >= 0 && ret <= 4096) { return null; }
894 Result_ChannelDetailsDecodeErrorZ ret_hu_conv = Result_ChannelDetailsDecodeErrorZ.constr_from_ptr(ret);