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 byte[] get_channel_id() {
25 byte[] ret = bindings.ChannelDetails_get_channel_id(this.ptr);
31 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
32 * thereafter this is the txid of the funding transaction xor the funding transaction output).
33 * Note that this means this value is *not* persistent - it can change once during the
34 * lifetime of the channel.
36 public void set_channel_id(byte[] val) {
37 bindings.ChannelDetails_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
43 * Parameters which apply to our counterparty. See individual fields for more information.
45 public ChannelCounterparty get_counterparty() {
46 long ret = bindings.ChannelDetails_get_counterparty(this.ptr);
48 if (ret >= 0 && ret <= 4096) { return null; }
49 org.ldk.structs.ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelCounterparty(null, ret); }
50 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
55 * Parameters which apply to our counterparty. See individual fields for more information.
57 public void set_counterparty(org.ldk.structs.ChannelCounterparty val) {
58 bindings.ChannelDetails_set_counterparty(this.ptr, val == null ? 0 : val.ptr);
61 if (this != null) { this.ptrs_to.AddLast(val); };
65 * The Channel's funding transaction output, if we've negotiated the funding transaction with
66 * our counterparty already.
68 * Note that, if this has been set, `channel_id` will be equivalent to
69 * `funding_txo.unwrap().to_channel_id()`.
71 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
73 public OutPoint get_funding_txo() {
74 long ret = bindings.ChannelDetails_get_funding_txo(this.ptr);
76 if (ret >= 0 && ret <= 4096) { return null; }
77 org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); }
78 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
83 * The Channel's funding transaction output, if we've negotiated the funding transaction with
84 * our counterparty already.
86 * Note that, if this has been set, `channel_id` will be equivalent to
87 * `funding_txo.unwrap().to_channel_id()`.
89 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
91 public void set_funding_txo(org.ldk.structs.OutPoint val) {
92 bindings.ChannelDetails_set_funding_txo(this.ptr, val == null ? 0 : val.ptr);
95 if (this != null) { this.ptrs_to.AddLast(val); };
99 * The features which this channel operates with. See individual features for more info.
101 * `None` until negotiation completes and the channel type is finalized.
103 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
105 public ChannelTypeFeatures get_channel_type() {
106 long ret = bindings.ChannelDetails_get_channel_type(this.ptr);
108 if (ret >= 0 && ret <= 4096) { return null; }
109 org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); }
110 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
115 * The features which this channel operates with. See individual features for more info.
117 * `None` until negotiation completes and the channel type is finalized.
119 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
121 public void set_channel_type(org.ldk.structs.ChannelTypeFeatures val) {
122 bindings.ChannelDetails_set_channel_type(this.ptr, val == null ? 0 : val.ptr);
125 if (this != null) { this.ptrs_to.AddLast(val); };
129 * The position of the funding transaction in the chain. None if the funding transaction has
130 * not yet been confirmed and the channel fully opened.
132 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
133 * payments instead of this. See [`get_inbound_payment_scid`].
135 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
136 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
138 * [`inbound_scid_alias`]: Self::inbound_scid_alias
139 * [`outbound_scid_alias`]: Self::outbound_scid_alias
140 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
141 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
142 * [`confirmations_required`]: Self::confirmations_required
144 public Option_u64Z get_short_channel_id() {
145 long ret = bindings.ChannelDetails_get_short_channel_id(this.ptr);
147 if (ret >= 0 && ret <= 4096) { return null; }
148 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
149 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
154 * The position of the funding transaction in the chain. None if the funding transaction has
155 * not yet been confirmed and the channel fully opened.
157 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
158 * payments instead of this. See [`get_inbound_payment_scid`].
160 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
161 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
163 * [`inbound_scid_alias`]: Self::inbound_scid_alias
164 * [`outbound_scid_alias`]: Self::outbound_scid_alias
165 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
166 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
167 * [`confirmations_required`]: Self::confirmations_required
169 public void set_short_channel_id(org.ldk.structs.Option_u64Z val) {
170 bindings.ChannelDetails_set_short_channel_id(this.ptr, val.ptr);
173 if (this != null) { this.ptrs_to.AddLast(val); };
177 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
178 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
179 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
182 * This will be `None` as long as the channel is not available for routing outbound payments.
184 * [`short_channel_id`]: Self::short_channel_id
185 * [`confirmations_required`]: Self::confirmations_required
187 public Option_u64Z get_outbound_scid_alias() {
188 long ret = bindings.ChannelDetails_get_outbound_scid_alias(this.ptr);
190 if (ret >= 0 && ret <= 4096) { return null; }
191 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
192 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
197 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
198 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
199 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
202 * This will be `None` as long as the channel is not available for routing outbound payments.
204 * [`short_channel_id`]: Self::short_channel_id
205 * [`confirmations_required`]: Self::confirmations_required
207 public void set_outbound_scid_alias(org.ldk.structs.Option_u64Z val) {
208 bindings.ChannelDetails_set_outbound_scid_alias(this.ptr, val.ptr);
211 if (this != null) { this.ptrs_to.AddLast(val); };
215 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
216 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
217 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
218 * when they see a payment to be routed to us.
220 * Our counterparty may choose to rotate this value at any time, though will always recognize
221 * previous values for inbound payment forwarding.
223 * [`short_channel_id`]: Self::short_channel_id
225 public Option_u64Z get_inbound_scid_alias() {
226 long ret = bindings.ChannelDetails_get_inbound_scid_alias(this.ptr);
228 if (ret >= 0 && ret <= 4096) { return null; }
229 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
230 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
235 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
236 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
237 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
238 * when they see a payment to be routed to us.
240 * Our counterparty may choose to rotate this value at any time, though will always recognize
241 * previous values for inbound payment forwarding.
243 * [`short_channel_id`]: Self::short_channel_id
245 public void set_inbound_scid_alias(org.ldk.structs.Option_u64Z val) {
246 bindings.ChannelDetails_set_inbound_scid_alias(this.ptr, val.ptr);
249 if (this != null) { this.ptrs_to.AddLast(val); };
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);
305 if (this != null) { this.ptrs_to.AddLast(val); };
309 * The `user_channel_id` passed in to create_channel, or a random value if the channel was
310 * inbound. This may be zero for inbound channels serialized with LDK versions prior to
313 public UInt128 get_user_channel_id() {
314 byte[] ret = bindings.ChannelDetails_get_user_channel_id(this.ptr);
316 org.ldk.util.UInt128 ret_conv = new org.ldk.util.UInt128(ret);
321 * The `user_channel_id` passed in to create_channel, or a random value if the channel was
322 * inbound. This may be zero for inbound channels serialized with LDK versions prior to
325 public void set_user_channel_id(org.ldk.util.UInt128 val) {
326 bindings.ChannelDetails_set_user_channel_id(this.ptr, val.getLEBytes());
332 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
333 * which is applied to commitment and HTLC transactions.
335 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
337 public Option_u32Z get_feerate_sat_per_1000_weight() {
338 long ret = bindings.ChannelDetails_get_feerate_sat_per_1000_weight(this.ptr);
340 if (ret >= 0 && ret <= 4096) { return null; }
341 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
342 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
347 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
348 * which is applied to commitment and HTLC transactions.
350 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
352 public void set_feerate_sat_per_1000_weight(org.ldk.structs.Option_u32Z val) {
353 bindings.ChannelDetails_set_feerate_sat_per_1000_weight(this.ptr, val.ptr);
356 if (this != null) { this.ptrs_to.AddLast(val); };
360 * Our total balance. This is the amount we would get if we close the channel.
361 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
362 * amount is not likely to be recoverable on close.
364 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
365 * balance is not available for inclusion in new outbound HTLCs). This further does not include
366 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
367 * This does not consider any on-chain fees.
369 * See also [`ChannelDetails::outbound_capacity_msat`]
371 public long get_balance_msat() {
372 long ret = bindings.ChannelDetails_get_balance_msat(this.ptr);
378 * Our total balance. This is the amount we would get if we close the channel.
379 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
380 * amount is not likely to be recoverable on close.
382 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
383 * balance is not available for inclusion in new outbound HTLCs). This further does not include
384 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
385 * This does not consider any on-chain fees.
387 * See also [`ChannelDetails::outbound_capacity_msat`]
389 public void set_balance_msat(long val) {
390 bindings.ChannelDetails_set_balance_msat(this.ptr, val);
396 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
397 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
398 * available for inclusion in new outbound HTLCs). This further does not include any pending
399 * outgoing HTLCs which are awaiting some other resolution to be sent.
401 * See also [`ChannelDetails::balance_msat`]
403 * This value is not exact. Due to various in-flight changes, feerate changes, and our
404 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
405 * should be able to spend nearly this amount.
407 public long get_outbound_capacity_msat() {
408 long ret = bindings.ChannelDetails_get_outbound_capacity_msat(this.ptr);
414 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
415 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
416 * available for inclusion in new outbound HTLCs). This further does not include any pending
417 * outgoing HTLCs which are awaiting some other resolution to be sent.
419 * See also [`ChannelDetails::balance_msat`]
421 * This value is not exact. Due to various in-flight changes, feerate changes, and our
422 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
423 * should be able to spend nearly this amount.
425 public void set_outbound_capacity_msat(long val) {
426 bindings.ChannelDetails_set_outbound_capacity_msat(this.ptr, val);
432 * The available outbound capacity for sending a single HTLC to the remote peer. This is
433 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
434 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
435 * to use a limit as close as possible to the HTLC limit we can currently send.
437 * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
438 * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
440 public long get_next_outbound_htlc_limit_msat() {
441 long ret = bindings.ChannelDetails_get_next_outbound_htlc_limit_msat(this.ptr);
447 * The available outbound capacity for sending a single HTLC to the remote peer. This is
448 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
449 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
450 * to use a limit as close as possible to the HTLC limit we can currently send.
452 * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
453 * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
455 public void set_next_outbound_htlc_limit_msat(long val) {
456 bindings.ChannelDetails_set_next_outbound_htlc_limit_msat(this.ptr, val);
462 * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
463 * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
464 * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
465 * route which is valid.
467 public long get_next_outbound_htlc_minimum_msat() {
468 long ret = bindings.ChannelDetails_get_next_outbound_htlc_minimum_msat(this.ptr);
474 * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
475 * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
476 * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
477 * route which is valid.
479 public void set_next_outbound_htlc_minimum_msat(long val) {
480 bindings.ChannelDetails_set_next_outbound_htlc_minimum_msat(this.ptr, val);
486 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
487 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
488 * available for inclusion in new inbound HTLCs).
489 * Note that there are some corner cases not fully handled here, so the actual available
490 * inbound capacity may be slightly higher than this.
492 * This value is not exact. Due to various in-flight changes, feerate changes, and our
493 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
494 * However, our counterparty should be able to spend nearly this amount.
496 public long get_inbound_capacity_msat() {
497 long ret = bindings.ChannelDetails_get_inbound_capacity_msat(this.ptr);
503 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
504 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
505 * available for inclusion in new inbound HTLCs).
506 * Note that there are some corner cases not fully handled here, so the actual available
507 * inbound capacity may be slightly higher than this.
509 * This value is not exact. Due to various in-flight changes, feerate changes, and our
510 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
511 * However, our counterparty should be able to spend nearly this amount.
513 public void set_inbound_capacity_msat(long val) {
514 bindings.ChannelDetails_set_inbound_capacity_msat(this.ptr, val);
520 * The number of required confirmations on the funding transaction before the funding will be
521 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
522 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
523 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
524 * [`ChannelHandshakeLimits::max_minimum_depth`].
526 * This value will be `None` for outbound channels until the counterparty accepts the channel.
528 * [`is_outbound`]: ChannelDetails::is_outbound
529 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
530 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
532 public Option_u32Z get_confirmations_required() {
533 long ret = bindings.ChannelDetails_get_confirmations_required(this.ptr);
535 if (ret >= 0 && ret <= 4096) { return null; }
536 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
537 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
542 * The number of required confirmations on the funding transaction before the funding will be
543 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
544 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
545 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
546 * [`ChannelHandshakeLimits::max_minimum_depth`].
548 * This value will be `None` for outbound channels until the counterparty accepts the channel.
550 * [`is_outbound`]: ChannelDetails::is_outbound
551 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
552 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
554 public void set_confirmations_required(org.ldk.structs.Option_u32Z val) {
555 bindings.ChannelDetails_set_confirmations_required(this.ptr, val.ptr);
558 if (this != null) { this.ptrs_to.AddLast(val); };
562 * The current number of confirmations on the funding transaction.
564 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
566 public Option_u32Z get_confirmations() {
567 long ret = bindings.ChannelDetails_get_confirmations(this.ptr);
569 if (ret >= 0 && ret <= 4096) { return null; }
570 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
571 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
576 * The current number of confirmations on the funding transaction.
578 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
580 public void set_confirmations(org.ldk.structs.Option_u32Z val) {
581 bindings.ChannelDetails_set_confirmations(this.ptr, val.ptr);
584 if (this != null) { this.ptrs_to.AddLast(val); };
588 * The number of blocks (after our commitment transaction confirms) that we will need to wait
589 * until we can claim our funds after we force-close the channel. During this time our
590 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
591 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
592 * time to claim our non-HTLC-encumbered funds.
594 * This value will be `None` for outbound channels until the counterparty accepts the channel.
596 public Option_u16Z get_force_close_spend_delay() {
597 long ret = bindings.ChannelDetails_get_force_close_spend_delay(this.ptr);
599 if (ret >= 0 && ret <= 4096) { return null; }
600 org.ldk.structs.Option_u16Z ret_hu_conv = org.ldk.structs.Option_u16Z.constr_from_ptr(ret);
601 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
606 * The number of blocks (after our commitment transaction confirms) that we will need to wait
607 * until we can claim our funds after we force-close the channel. During this time our
608 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
609 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
610 * time to claim our non-HTLC-encumbered funds.
612 * This value will be `None` for outbound channels until the counterparty accepts the channel.
614 public void set_force_close_spend_delay(org.ldk.structs.Option_u16Z val) {
615 bindings.ChannelDetails_set_force_close_spend_delay(this.ptr, val.ptr);
618 if (this != null) { this.ptrs_to.AddLast(val); };
622 * True if the channel was initiated (and thus funded) by us.
624 public bool get_is_outbound() {
625 bool ret = bindings.ChannelDetails_get_is_outbound(this.ptr);
631 * True if the channel was initiated (and thus funded) by us.
633 public void set_is_outbound(bool val) {
634 bindings.ChannelDetails_set_is_outbound(this.ptr, val);
640 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
641 * channel is not currently being shut down. `channel_ready` message exchange implies the
642 * required confirmation count has been reached (and we were connected to the peer at some
643 * point after the funding transaction received enough confirmations). The required
644 * confirmation count is provided in [`confirmations_required`].
646 * [`confirmations_required`]: ChannelDetails::confirmations_required
648 public bool get_is_channel_ready() {
649 bool ret = bindings.ChannelDetails_get_is_channel_ready(this.ptr);
655 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
656 * channel is not currently being shut down. `channel_ready` message exchange implies the
657 * required confirmation count has been reached (and we were connected to the peer at some
658 * point after the funding transaction received enough confirmations). The required
659 * confirmation count is provided in [`confirmations_required`].
661 * [`confirmations_required`]: ChannelDetails::confirmations_required
663 public void set_is_channel_ready(bool val) {
664 bindings.ChannelDetails_set_is_channel_ready(this.ptr, val);
670 * The stage of the channel's shutdown.
671 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
673 * Returns a copy of the field.
675 public Option_ChannelShutdownStateZ get_channel_shutdown_state() {
676 long ret = bindings.ChannelDetails_get_channel_shutdown_state(this.ptr);
678 if (ret >= 0 && ret <= 4096) { return null; }
679 org.ldk.structs.Option_ChannelShutdownStateZ ret_hu_conv = org.ldk.structs.Option_ChannelShutdownStateZ.constr_from_ptr(ret);
680 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
685 * The stage of the channel's shutdown.
686 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
688 public void set_channel_shutdown_state(org.ldk.structs.Option_ChannelShutdownStateZ val) {
689 bindings.ChannelDetails_set_channel_shutdown_state(this.ptr, val.ptr);
692 if (this != null) { this.ptrs_to.AddLast(val); };
696 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
697 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
699 * This is a strict superset of `is_channel_ready`.
701 public bool get_is_usable() {
702 bool ret = bindings.ChannelDetails_get_is_usable(this.ptr);
708 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
709 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
711 * This is a strict superset of `is_channel_ready`.
713 public void set_is_usable(bool val) {
714 bindings.ChannelDetails_set_is_usable(this.ptr, val);
720 * True if this channel is (or will be) publicly-announced.
722 public bool get_is_public() {
723 bool ret = bindings.ChannelDetails_get_is_public(this.ptr);
729 * True if this channel is (or will be) publicly-announced.
731 public void set_is_public(bool val) {
732 bindings.ChannelDetails_set_is_public(this.ptr, val);
738 * The smallest value HTLC (in msat) we will accept, for this channel. This field
739 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
741 public Option_u64Z get_inbound_htlc_minimum_msat() {
742 long ret = bindings.ChannelDetails_get_inbound_htlc_minimum_msat(this.ptr);
744 if (ret >= 0 && ret <= 4096) { return null; }
745 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
746 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
751 * The smallest value HTLC (in msat) we will accept, for this channel. This field
752 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
754 public void set_inbound_htlc_minimum_msat(org.ldk.structs.Option_u64Z val) {
755 bindings.ChannelDetails_set_inbound_htlc_minimum_msat(this.ptr, val.ptr);
758 if (this != null) { this.ptrs_to.AddLast(val); };
762 * The largest value HTLC (in msat) we currently will accept, for this channel.
764 public Option_u64Z get_inbound_htlc_maximum_msat() {
765 long ret = bindings.ChannelDetails_get_inbound_htlc_maximum_msat(this.ptr);
767 if (ret >= 0 && ret <= 4096) { return null; }
768 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
769 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
774 * The largest value HTLC (in msat) we currently will accept, for this channel.
776 public void set_inbound_htlc_maximum_msat(org.ldk.structs.Option_u64Z val) {
777 bindings.ChannelDetails_set_inbound_htlc_maximum_msat(this.ptr, val.ptr);
780 if (this != null) { this.ptrs_to.AddLast(val); };
784 * Set of configurable parameters that affect channel operation.
786 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
788 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
790 public ChannelConfig get_config() {
791 long ret = bindings.ChannelDetails_get_config(this.ptr);
793 if (ret >= 0 && ret <= 4096) { return null; }
794 org.ldk.structs.ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfig(null, ret); }
795 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
800 * Set of configurable parameters that affect channel operation.
802 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
804 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
806 public void set_config(org.ldk.structs.ChannelConfig val) {
807 bindings.ChannelDetails_set_config(this.ptr, val == null ? 0 : val.ptr);
810 if (this != null) { this.ptrs_to.AddLast(val); };
814 * Constructs a new ChannelDetails given each field
816 public static ChannelDetails of(byte[] 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_public_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) {
817 long ret = bindings.ChannelDetails_new(InternalUtils.check_arr_len(channel_id_arg, 32), counterparty_arg == null ? 0 : 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, 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_public_arg, inbound_htlc_minimum_msat_arg.ptr, inbound_htlc_maximum_msat_arg.ptr, config_arg == null ? 0 : config_arg.ptr);
818 GC.KeepAlive(channel_id_arg);
819 GC.KeepAlive(counterparty_arg);
820 GC.KeepAlive(funding_txo_arg);
821 GC.KeepAlive(channel_type_arg);
822 GC.KeepAlive(short_channel_id_arg);
823 GC.KeepAlive(outbound_scid_alias_arg);
824 GC.KeepAlive(inbound_scid_alias_arg);
825 GC.KeepAlive(channel_value_satoshis_arg);
826 GC.KeepAlive(unspendable_punishment_reserve_arg);
827 GC.KeepAlive(user_channel_id_arg);
828 GC.KeepAlive(feerate_sat_per_1000_weight_arg);
829 GC.KeepAlive(balance_msat_arg);
830 GC.KeepAlive(outbound_capacity_msat_arg);
831 GC.KeepAlive(next_outbound_htlc_limit_msat_arg);
832 GC.KeepAlive(next_outbound_htlc_minimum_msat_arg);
833 GC.KeepAlive(inbound_capacity_msat_arg);
834 GC.KeepAlive(confirmations_required_arg);
835 GC.KeepAlive(confirmations_arg);
836 GC.KeepAlive(force_close_spend_delay_arg);
837 GC.KeepAlive(is_outbound_arg);
838 GC.KeepAlive(is_channel_ready_arg);
839 GC.KeepAlive(channel_shutdown_state_arg);
840 GC.KeepAlive(is_usable_arg);
841 GC.KeepAlive(is_public_arg);
842 GC.KeepAlive(inbound_htlc_minimum_msat_arg);
843 GC.KeepAlive(inbound_htlc_maximum_msat_arg);
844 GC.KeepAlive(config_arg);
845 if (ret >= 0 && ret <= 4096) { return null; }
846 org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); }
847 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
848 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(counterparty_arg); };
849 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_txo_arg); };
850 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type_arg); };
851 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(short_channel_id_arg); };
852 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outbound_scid_alias_arg); };
853 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(inbound_scid_alias_arg); };
854 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(unspendable_punishment_reserve_arg); };
855 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(feerate_sat_per_1000_weight_arg); };
856 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(confirmations_required_arg); };
857 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(confirmations_arg); };
858 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(force_close_spend_delay_arg); };
859 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_shutdown_state_arg); };
860 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(inbound_htlc_minimum_msat_arg); };
861 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(inbound_htlc_maximum_msat_arg); };
862 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(config_arg); };
866 internal long clone_ptr() {
867 long ret = bindings.ChannelDetails_clone_ptr(this.ptr);
873 * Creates a copy of the ChannelDetails
875 public ChannelDetails clone() {
876 long ret = bindings.ChannelDetails_clone(this.ptr);
878 if (ret >= 0 && ret <= 4096) { return null; }
879 org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); }
880 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
885 * Gets the current SCID which should be used to identify this channel for inbound payments.
886 * This should be used for providing invoice hints or in any other context where our
887 * counterparty will forward a payment to us.
889 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
890 * [`ChannelDetails::short_channel_id`]. See those for more information.
892 public Option_u64Z get_inbound_payment_scid() {
893 long ret = bindings.ChannelDetails_get_inbound_payment_scid(this.ptr);
895 if (ret >= 0 && ret <= 4096) { return null; }
896 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
897 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
902 * Gets the current SCID which should be used to identify this channel for outbound payments.
903 * This should be used in [`Route`]s to describe the first hop or in other contexts where
904 * we're sending or forwarding a payment outbound over this channel.
906 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
907 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
909 public Option_u64Z get_outbound_payment_scid() {
910 long ret = bindings.ChannelDetails_get_outbound_payment_scid(this.ptr);
912 if (ret >= 0 && ret <= 4096) { return null; }
913 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
914 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
919 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
921 public byte[] write() {
922 byte[] ret = bindings.ChannelDetails_write(this.ptr);
928 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
930 public static Result_ChannelDetailsDecodeErrorZ read(byte[] ser) {
931 long ret = bindings.ChannelDetails_read(ser);
933 if (ret >= 0 && ret <= 4096) { return null; }
934 Result_ChannelDetailsDecodeErrorZ ret_hu_conv = Result_ChannelDetailsDecodeErrorZ.constr_from_ptr(ret);