6 namespace org { namespace ldk { namespace structs {
10 * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`]
12 * Balances of a channel are available through [`ChainMonitor::get_claimable_balances`] and
13 * [`ChannelMonitor::get_claimable_balances`], calculated with respect to the corresponding on-chain
16 * [`ChannelManager::list_channels`]: crate::ln::channelmanager::ChannelManager::list_channels
17 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
18 * [`ChainMonitor::get_claimable_balances`]: crate::chain::chainmonitor::ChainMonitor::get_claimable_balances
19 * [`ChannelMonitor::get_claimable_balances`]: crate::chain::channelmonitor::ChannelMonitor::get_claimable_balances
21 public class ChannelDetails : CommonBase {
22 internal ChannelDetails(object _dummy, long ptr) : base(ptr) { }
24 if (ptr != 0) { bindings.ChannelDetails_free(ptr); }
28 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
29 * thereafter this is the txid of the funding transaction xor the funding transaction output).
30 * Note that this means this value is *not* persistent - it can change once during the
31 * lifetime of the channel.
33 public ChannelId get_channel_id() {
34 long ret = bindings.ChannelDetails_get_channel_id(this.ptr);
36 if (ret >= 0 && ret <= 4096) { return null; }
37 org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); }
38 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
43 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
44 * thereafter this is the txid of the funding transaction xor the funding transaction output).
45 * Note that this means this value is *not* persistent - it can change once during the
46 * lifetime of the channel.
48 public void set_channel_id(org.ldk.structs.ChannelId val) {
49 bindings.ChannelDetails_set_channel_id(this.ptr, val.ptr);
55 * Parameters which apply to our counterparty. See individual fields for more information.
57 public ChannelCounterparty get_counterparty() {
58 long ret = bindings.ChannelDetails_get_counterparty(this.ptr);
60 if (ret >= 0 && ret <= 4096) { return null; }
61 org.ldk.structs.ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelCounterparty(null, ret); }
62 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
67 * Parameters which apply to our counterparty. See individual fields for more information.
69 public void set_counterparty(org.ldk.structs.ChannelCounterparty val) {
70 bindings.ChannelDetails_set_counterparty(this.ptr, val.ptr);
76 * The Channel's funding transaction output, if we've negotiated the funding transaction with
77 * our counterparty already.
79 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
81 public OutPoint get_funding_txo() {
82 long ret = bindings.ChannelDetails_get_funding_txo(this.ptr);
84 if (ret >= 0 && ret <= 4096) { return null; }
85 org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); }
86 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
91 * The Channel's funding transaction output, if we've negotiated the funding transaction with
92 * our counterparty already.
94 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
96 public void set_funding_txo(org.ldk.structs.OutPoint val) {
97 bindings.ChannelDetails_set_funding_txo(this.ptr, val == null ? 0 : val.ptr);
103 * The features which this channel operates with. See individual features for more info.
105 * `None` until negotiation completes and the channel type is finalized.
107 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
109 public ChannelTypeFeatures get_channel_type() {
110 long ret = bindings.ChannelDetails_get_channel_type(this.ptr);
112 if (ret >= 0 && ret <= 4096) { return null; }
113 org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); }
114 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
119 * The features which this channel operates with. See individual features for more info.
121 * `None` until negotiation completes and the channel type is finalized.
123 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
125 public void set_channel_type(org.ldk.structs.ChannelTypeFeatures val) {
126 bindings.ChannelDetails_set_channel_type(this.ptr, val == null ? 0 : val.ptr);
132 * The position of the funding transaction in the chain. None if the funding transaction has
133 * not yet been confirmed and the channel fully opened.
135 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
136 * payments instead of this. See [`get_inbound_payment_scid`].
138 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
139 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
141 * [`inbound_scid_alias`]: Self::inbound_scid_alias
142 * [`outbound_scid_alias`]: Self::outbound_scid_alias
143 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
144 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
145 * [`confirmations_required`]: Self::confirmations_required
147 public Option_u64Z get_short_channel_id() {
148 long ret = bindings.ChannelDetails_get_short_channel_id(this.ptr);
150 if (ret >= 0 && ret <= 4096) { return null; }
151 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
152 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
157 * The position of the funding transaction in the chain. None if the funding transaction has
158 * not yet been confirmed and the channel fully opened.
160 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
161 * payments instead of this. See [`get_inbound_payment_scid`].
163 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
164 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
166 * [`inbound_scid_alias`]: Self::inbound_scid_alias
167 * [`outbound_scid_alias`]: Self::outbound_scid_alias
168 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
169 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
170 * [`confirmations_required`]: Self::confirmations_required
172 public void set_short_channel_id(org.ldk.structs.Option_u64Z val) {
173 bindings.ChannelDetails_set_short_channel_id(this.ptr, val.ptr);
179 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
180 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
181 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
184 * This will be `None` as long as the channel is not available for routing outbound payments.
186 * [`short_channel_id`]: Self::short_channel_id
187 * [`confirmations_required`]: Self::confirmations_required
189 public Option_u64Z get_outbound_scid_alias() {
190 long ret = bindings.ChannelDetails_get_outbound_scid_alias(this.ptr);
192 if (ret >= 0 && ret <= 4096) { return null; }
193 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
194 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
199 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
200 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
201 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
204 * This will be `None` as long as the channel is not available for routing outbound payments.
206 * [`short_channel_id`]: Self::short_channel_id
207 * [`confirmations_required`]: Self::confirmations_required
209 public void set_outbound_scid_alias(org.ldk.structs.Option_u64Z val) {
210 bindings.ChannelDetails_set_outbound_scid_alias(this.ptr, val.ptr);
216 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
217 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
218 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
219 * when they see a payment to be routed to us.
221 * Our counterparty may choose to rotate this value at any time, though will always recognize
222 * previous values for inbound payment forwarding.
224 * [`short_channel_id`]: Self::short_channel_id
226 public Option_u64Z get_inbound_scid_alias() {
227 long ret = bindings.ChannelDetails_get_inbound_scid_alias(this.ptr);
229 if (ret >= 0 && ret <= 4096) { return null; }
230 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
231 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
236 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
237 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
238 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
239 * when they see a payment to be routed to us.
241 * Our counterparty may choose to rotate this value at any time, though will always recognize
242 * previous values for inbound payment forwarding.
244 * [`short_channel_id`]: Self::short_channel_id
246 public void set_inbound_scid_alias(org.ldk.structs.Option_u64Z val) {
247 bindings.ChannelDetails_set_inbound_scid_alias(this.ptr, val.ptr);
253 * The value, in satoshis, of this channel as appears in the funding output
255 public long get_channel_value_satoshis() {
256 long ret = bindings.ChannelDetails_get_channel_value_satoshis(this.ptr);
262 * The value, in satoshis, of this channel as appears in the funding output
264 public void set_channel_value_satoshis(long val) {
265 bindings.ChannelDetails_set_channel_value_satoshis(this.ptr, val);
271 * The value, in satoshis, that must always be held in the channel for us. This value ensures
272 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
273 * this value on chain.
275 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
277 * This value will be `None` for outbound channels until the counterparty accepts the channel.
279 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
281 public Option_u64Z get_unspendable_punishment_reserve() {
282 long ret = bindings.ChannelDetails_get_unspendable_punishment_reserve(this.ptr);
284 if (ret >= 0 && ret <= 4096) { return null; }
285 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
286 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
291 * The value, in satoshis, that must always be held in the channel for us. This value ensures
292 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
293 * this value on chain.
295 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
297 * This value will be `None` for outbound channels until the counterparty accepts the channel.
299 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
301 public void set_unspendable_punishment_reserve(org.ldk.structs.Option_u64Z val) {
302 bindings.ChannelDetails_set_unspendable_punishment_reserve(this.ptr, val.ptr);
308 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
309 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
310 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
311 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
312 * serialized with LDK versions prior to 0.0.113.
314 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
315 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
316 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
318 public UInt128 get_user_channel_id() {
319 long ret = bindings.ChannelDetails_get_user_channel_id(this.ptr);
321 if (ret >= 0 && ret <= 4096) { return null; }
322 org.ldk.util.UInt128 ret_conv = new org.ldk.util.UInt128(ret);
327 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
328 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
329 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
330 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
331 * serialized with LDK versions prior to 0.0.113.
333 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
334 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
335 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
337 public void set_user_channel_id(org.ldk.util.UInt128 val) {
338 bindings.ChannelDetails_set_user_channel_id(this.ptr, InternalUtils.encodeUint8Array(val.getLEBytes()));
344 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
345 * which is applied to commitment and HTLC transactions.
347 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
349 public Option_u32Z get_feerate_sat_per_1000_weight() {
350 long ret = bindings.ChannelDetails_get_feerate_sat_per_1000_weight(this.ptr);
352 if (ret >= 0 && ret <= 4096) { return null; }
353 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
354 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
359 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
360 * which is applied to commitment and HTLC transactions.
362 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
364 public void set_feerate_sat_per_1000_weight(org.ldk.structs.Option_u32Z val) {
365 bindings.ChannelDetails_set_feerate_sat_per_1000_weight(this.ptr, val.ptr);
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);
572 * The current number of confirmations on the funding transaction.
574 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
576 public Option_u32Z get_confirmations() {
577 long ret = bindings.ChannelDetails_get_confirmations(this.ptr);
579 if (ret >= 0 && ret <= 4096) { return null; }
580 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
581 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
586 * The current number of confirmations on the funding transaction.
588 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
590 public void set_confirmations(org.ldk.structs.Option_u32Z val) {
591 bindings.ChannelDetails_set_confirmations(this.ptr, val.ptr);
597 * The number of blocks (after our commitment transaction confirms) that we will need to wait
598 * until we can claim our funds after we force-close the channel. During this time our
599 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
600 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
601 * time to claim our non-HTLC-encumbered funds.
603 * This value will be `None` for outbound channels until the counterparty accepts the channel.
605 public Option_u16Z get_force_close_spend_delay() {
606 long ret = bindings.ChannelDetails_get_force_close_spend_delay(this.ptr);
608 if (ret >= 0 && ret <= 4096) { return null; }
609 org.ldk.structs.Option_u16Z ret_hu_conv = org.ldk.structs.Option_u16Z.constr_from_ptr(ret);
610 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
615 * The number of blocks (after our commitment transaction confirms) that we will need to wait
616 * until we can claim our funds after we force-close the channel. During this time our
617 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
618 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
619 * time to claim our non-HTLC-encumbered funds.
621 * This value will be `None` for outbound channels until the counterparty accepts the channel.
623 public void set_force_close_spend_delay(org.ldk.structs.Option_u16Z val) {
624 bindings.ChannelDetails_set_force_close_spend_delay(this.ptr, val.ptr);
630 * True if the channel was initiated (and thus funded) by us.
632 public bool get_is_outbound() {
633 bool ret = bindings.ChannelDetails_get_is_outbound(this.ptr);
639 * True if the channel was initiated (and thus funded) by us.
641 public void set_is_outbound(bool val) {
642 bindings.ChannelDetails_set_is_outbound(this.ptr, val);
648 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
649 * channel is not currently being shut down. `channel_ready` message exchange implies the
650 * required confirmation count has been reached (and we were connected to the peer at some
651 * point after the funding transaction received enough confirmations). The required
652 * confirmation count is provided in [`confirmations_required`].
654 * [`confirmations_required`]: ChannelDetails::confirmations_required
656 public bool get_is_channel_ready() {
657 bool ret = bindings.ChannelDetails_get_is_channel_ready(this.ptr);
663 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
664 * channel is not currently being shut down. `channel_ready` message exchange implies the
665 * required confirmation count has been reached (and we were connected to the peer at some
666 * point after the funding transaction received enough confirmations). The required
667 * confirmation count is provided in [`confirmations_required`].
669 * [`confirmations_required`]: ChannelDetails::confirmations_required
671 public void set_is_channel_ready(bool val) {
672 bindings.ChannelDetails_set_is_channel_ready(this.ptr, val);
678 * The stage of the channel's shutdown.
679 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
681 * Returns a copy of the field.
683 public Option_ChannelShutdownStateZ get_channel_shutdown_state() {
684 long ret = bindings.ChannelDetails_get_channel_shutdown_state(this.ptr);
686 if (ret >= 0 && ret <= 4096) { return null; }
687 org.ldk.structs.Option_ChannelShutdownStateZ ret_hu_conv = org.ldk.structs.Option_ChannelShutdownStateZ.constr_from_ptr(ret);
688 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
693 * The stage of the channel's shutdown.
694 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
696 public void set_channel_shutdown_state(org.ldk.structs.Option_ChannelShutdownStateZ val) {
697 bindings.ChannelDetails_set_channel_shutdown_state(this.ptr, val.ptr);
703 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
704 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
706 * This is a strict superset of `is_channel_ready`.
708 public bool get_is_usable() {
709 bool ret = bindings.ChannelDetails_get_is_usable(this.ptr);
715 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
716 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
718 * This is a strict superset of `is_channel_ready`.
720 public void set_is_usable(bool val) {
721 bindings.ChannelDetails_set_is_usable(this.ptr, val);
727 * True if this channel is (or will be) publicly-announced.
729 public bool get_is_announced() {
730 bool ret = bindings.ChannelDetails_get_is_announced(this.ptr);
736 * True if this channel is (or will be) publicly-announced.
738 public void set_is_announced(bool val) {
739 bindings.ChannelDetails_set_is_announced(this.ptr, val);
745 * The smallest value HTLC (in msat) we will accept, for this channel. This field
746 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
748 public Option_u64Z get_inbound_htlc_minimum_msat() {
749 long ret = bindings.ChannelDetails_get_inbound_htlc_minimum_msat(this.ptr);
751 if (ret >= 0 && ret <= 4096) { return null; }
752 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
753 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
758 * The smallest value HTLC (in msat) we will accept, for this channel. This field
759 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
761 public void set_inbound_htlc_minimum_msat(org.ldk.structs.Option_u64Z val) {
762 bindings.ChannelDetails_set_inbound_htlc_minimum_msat(this.ptr, val.ptr);
768 * The largest value HTLC (in msat) we currently will accept, for this channel.
770 public Option_u64Z get_inbound_htlc_maximum_msat() {
771 long ret = bindings.ChannelDetails_get_inbound_htlc_maximum_msat(this.ptr);
773 if (ret >= 0 && ret <= 4096) { return null; }
774 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
775 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
780 * The largest value HTLC (in msat) we currently will accept, for this channel.
782 public void set_inbound_htlc_maximum_msat(org.ldk.structs.Option_u64Z val) {
783 bindings.ChannelDetails_set_inbound_htlc_maximum_msat(this.ptr, val.ptr);
789 * Set of configurable parameters that affect channel operation.
791 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
793 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
795 public ChannelConfig get_config() {
796 long ret = bindings.ChannelDetails_get_config(this.ptr);
798 if (ret >= 0 && ret <= 4096) { return null; }
799 org.ldk.structs.ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfig(null, ret); }
800 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
805 * Set of configurable parameters that affect channel operation.
807 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
809 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
811 public void set_config(org.ldk.structs.ChannelConfig val) {
812 bindings.ChannelDetails_set_config(this.ptr, val == null ? 0 : val.ptr);
818 * Pending inbound HTLCs.
820 * This field is empty for objects serialized with LDK versions prior to 0.0.122.
822 public InboundHTLCDetails[] get_pending_inbound_htlcs() {
823 long ret = bindings.ChannelDetails_get_pending_inbound_htlcs(this.ptr);
825 if (ret >= 0 && ret <= 4096) { return null; }
826 int ret_conv_20_len = InternalUtils.getArrayLength(ret);
827 InboundHTLCDetails[] ret_conv_20_arr = new InboundHTLCDetails[ret_conv_20_len];
828 for (int u = 0; u < ret_conv_20_len; u++) {
829 long ret_conv_20 = InternalUtils.getU64ArrayElem(ret, u);
830 org.ldk.structs.InboundHTLCDetails ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.InboundHTLCDetails(null, ret_conv_20); }
831 if (ret_conv_20_hu_conv != null) { ret_conv_20_hu_conv.ptrs_to.AddLast(this); };
832 ret_conv_20_arr[u] = ret_conv_20_hu_conv;
834 bindings.free_buffer(ret);
835 return ret_conv_20_arr;
839 * Pending inbound HTLCs.
841 * This field is empty for objects serialized with LDK versions prior to 0.0.122.
843 public void set_pending_inbound_htlcs(InboundHTLCDetails[] val) {
844 bindings.ChannelDetails_set_pending_inbound_htlcs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_20 => val_conv_20.ptr)));
850 * Pending outbound HTLCs.
852 * This field is empty for objects serialized with LDK versions prior to 0.0.122.
854 public OutboundHTLCDetails[] get_pending_outbound_htlcs() {
855 long ret = bindings.ChannelDetails_get_pending_outbound_htlcs(this.ptr);
857 if (ret >= 0 && ret <= 4096) { return null; }
858 int ret_conv_21_len = InternalUtils.getArrayLength(ret);
859 OutboundHTLCDetails[] ret_conv_21_arr = new OutboundHTLCDetails[ret_conv_21_len];
860 for (int v = 0; v < ret_conv_21_len; v++) {
861 long ret_conv_21 = InternalUtils.getU64ArrayElem(ret, v);
862 org.ldk.structs.OutboundHTLCDetails ret_conv_21_hu_conv = null; if (ret_conv_21 < 0 || ret_conv_21 > 4096) { ret_conv_21_hu_conv = new org.ldk.structs.OutboundHTLCDetails(null, ret_conv_21); }
863 if (ret_conv_21_hu_conv != null) { ret_conv_21_hu_conv.ptrs_to.AddLast(this); };
864 ret_conv_21_arr[v] = ret_conv_21_hu_conv;
866 bindings.free_buffer(ret);
867 return ret_conv_21_arr;
871 * Pending outbound HTLCs.
873 * This field is empty for objects serialized with LDK versions prior to 0.0.122.
875 public void set_pending_outbound_htlcs(OutboundHTLCDetails[] val) {
876 bindings.ChannelDetails_set_pending_outbound_htlcs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_21 => val_conv_21.ptr)));
882 * Constructs a new ChannelDetails given each field
884 * Note that funding_txo_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
885 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
886 * Note that config_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
888 public static ChannelDetails of(org.ldk.structs.ChannelId channel_id_arg, org.ldk.structs.ChannelCounterparty counterparty_arg, org.ldk.structs.OutPoint funding_txo_arg, org.ldk.structs.ChannelTypeFeatures channel_type_arg, org.ldk.structs.Option_u64Z short_channel_id_arg, org.ldk.structs.Option_u64Z outbound_scid_alias_arg, org.ldk.structs.Option_u64Z inbound_scid_alias_arg, long channel_value_satoshis_arg, org.ldk.structs.Option_u64Z unspendable_punishment_reserve_arg, org.ldk.util.UInt128 user_channel_id_arg, org.ldk.structs.Option_u32Z feerate_sat_per_1000_weight_arg, long balance_msat_arg, long outbound_capacity_msat_arg, long next_outbound_htlc_limit_msat_arg, long next_outbound_htlc_minimum_msat_arg, long inbound_capacity_msat_arg, org.ldk.structs.Option_u32Z confirmations_required_arg, org.ldk.structs.Option_u32Z confirmations_arg, org.ldk.structs.Option_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_channel_ready_arg, org.ldk.structs.Option_ChannelShutdownStateZ channel_shutdown_state_arg, bool is_usable_arg, bool is_announced_arg, org.ldk.structs.Option_u64Z inbound_htlc_minimum_msat_arg, org.ldk.structs.Option_u64Z inbound_htlc_maximum_msat_arg, org.ldk.structs.ChannelConfig config_arg, InboundHTLCDetails[] pending_inbound_htlcs_arg, OutboundHTLCDetails[] pending_outbound_htlcs_arg) {
889 long ret = bindings.ChannelDetails_new(channel_id_arg.ptr, counterparty_arg.ptr, funding_txo_arg == null ? 0 : funding_txo_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr, short_channel_id_arg.ptr, outbound_scid_alias_arg.ptr, inbound_scid_alias_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, InternalUtils.encodeUint8Array(user_channel_id_arg.getLEBytes()), feerate_sat_per_1000_weight_arg.ptr, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, next_outbound_htlc_minimum_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, confirmations_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_channel_ready_arg, channel_shutdown_state_arg.ptr, is_usable_arg, is_announced_arg, inbound_htlc_minimum_msat_arg.ptr, inbound_htlc_maximum_msat_arg.ptr, config_arg == null ? 0 : config_arg.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(pending_inbound_htlcs_arg, pending_inbound_htlcs_arg_conv_20 => pending_inbound_htlcs_arg_conv_20.ptr)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(pending_outbound_htlcs_arg, pending_outbound_htlcs_arg_conv_21 => pending_outbound_htlcs_arg_conv_21.ptr)));
890 GC.KeepAlive(channel_id_arg);
891 GC.KeepAlive(counterparty_arg);
892 GC.KeepAlive(funding_txo_arg);
893 GC.KeepAlive(channel_type_arg);
894 GC.KeepAlive(short_channel_id_arg);
895 GC.KeepAlive(outbound_scid_alias_arg);
896 GC.KeepAlive(inbound_scid_alias_arg);
897 GC.KeepAlive(channel_value_satoshis_arg);
898 GC.KeepAlive(unspendable_punishment_reserve_arg);
899 GC.KeepAlive(user_channel_id_arg);
900 GC.KeepAlive(feerate_sat_per_1000_weight_arg);
901 GC.KeepAlive(balance_msat_arg);
902 GC.KeepAlive(outbound_capacity_msat_arg);
903 GC.KeepAlive(next_outbound_htlc_limit_msat_arg);
904 GC.KeepAlive(next_outbound_htlc_minimum_msat_arg);
905 GC.KeepAlive(inbound_capacity_msat_arg);
906 GC.KeepAlive(confirmations_required_arg);
907 GC.KeepAlive(confirmations_arg);
908 GC.KeepAlive(force_close_spend_delay_arg);
909 GC.KeepAlive(is_outbound_arg);
910 GC.KeepAlive(is_channel_ready_arg);
911 GC.KeepAlive(channel_shutdown_state_arg);
912 GC.KeepAlive(is_usable_arg);
913 GC.KeepAlive(is_announced_arg);
914 GC.KeepAlive(inbound_htlc_minimum_msat_arg);
915 GC.KeepAlive(inbound_htlc_maximum_msat_arg);
916 GC.KeepAlive(config_arg);
917 GC.KeepAlive(pending_inbound_htlcs_arg);
918 GC.KeepAlive(pending_outbound_htlcs_arg);
919 if (ret >= 0 && ret <= 4096) { return null; }
920 org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); }
921 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
925 internal long clone_ptr() {
926 long ret = bindings.ChannelDetails_clone_ptr(this.ptr);
932 * Creates a copy of the ChannelDetails
934 public ChannelDetails clone() {
935 long ret = bindings.ChannelDetails_clone(this.ptr);
937 if (ret >= 0 && ret <= 4096) { return null; }
938 org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); }
939 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
944 * Gets the current SCID which should be used to identify this channel for inbound payments.
945 * This should be used for providing invoice hints or in any other context where our
946 * counterparty will forward a payment to us.
948 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
949 * [`ChannelDetails::short_channel_id`]. See those for more information.
951 public Option_u64Z get_inbound_payment_scid() {
952 long ret = bindings.ChannelDetails_get_inbound_payment_scid(this.ptr);
954 if (ret >= 0 && ret <= 4096) { return null; }
955 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
956 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
961 * Gets the current SCID which should be used to identify this channel for outbound payments.
962 * This should be used in [`Route`]s to describe the first hop or in other contexts where
963 * we're sending or forwarding a payment outbound over this channel.
965 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
966 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
968 * [`Route`]: crate::routing::router::Route
970 public Option_u64Z get_outbound_payment_scid() {
971 long ret = bindings.ChannelDetails_get_outbound_payment_scid(this.ptr);
973 if (ret >= 0 && ret <= 4096) { return null; }
974 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
975 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
980 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
982 public byte[] write() {
983 long ret = bindings.ChannelDetails_write(this.ptr);
985 if (ret >= 0 && ret <= 4096) { return null; }
986 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
991 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
993 public static Result_ChannelDetailsDecodeErrorZ read(byte[] ser) {
994 long ret = bindings.ChannelDetails_read(InternalUtils.encodeUint8Array(ser));
996 if (ret >= 0 && ret <= 4096) { return null; }
997 Result_ChannelDetailsDecodeErrorZ ret_hu_conv = Result_ChannelDetailsDecodeErrorZ.constr_from_ptr(ret);