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);
176 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
177 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
178 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
181 * This will be `None` as long as the channel is not available for routing outbound payments.
183 * [`short_channel_id`]: Self::short_channel_id
184 * [`confirmations_required`]: Self::confirmations_required
186 public Option_u64Z get_outbound_scid_alias() {
187 long ret = bindings.ChannelDetails_get_outbound_scid_alias(this.ptr);
189 if (ret >= 0 && ret <= 4096) { return null; }
190 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
191 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
196 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
197 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
198 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
201 * This will be `None` as long as the channel is not available for routing outbound payments.
203 * [`short_channel_id`]: Self::short_channel_id
204 * [`confirmations_required`]: Self::confirmations_required
206 public void set_outbound_scid_alias(org.ldk.structs.Option_u64Z val) {
207 bindings.ChannelDetails_set_outbound_scid_alias(this.ptr, val.ptr);
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);
250 * The value, in satoshis, of this channel as appears in the funding output
252 public long get_channel_value_satoshis() {
253 long ret = bindings.ChannelDetails_get_channel_value_satoshis(this.ptr);
259 * The value, in satoshis, of this channel as appears in the funding output
261 public void set_channel_value_satoshis(long val) {
262 bindings.ChannelDetails_set_channel_value_satoshis(this.ptr, val);
268 * The value, in satoshis, that must always be held in the channel for us. This value ensures
269 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
270 * this value on chain.
272 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
274 * This value will be `None` for outbound channels until the counterparty accepts the channel.
276 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
278 public Option_u64Z get_unspendable_punishment_reserve() {
279 long ret = bindings.ChannelDetails_get_unspendable_punishment_reserve(this.ptr);
281 if (ret >= 0 && ret <= 4096) { return null; }
282 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
283 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
288 * The value, in satoshis, that must always be held in the channel for us. This value ensures
289 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
290 * this value on chain.
292 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
294 * This value will be `None` for outbound channels until the counterparty accepts the channel.
296 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
298 public void set_unspendable_punishment_reserve(org.ldk.structs.Option_u64Z val) {
299 bindings.ChannelDetails_set_unspendable_punishment_reserve(this.ptr, val.ptr);
305 * The `user_channel_id` passed in to create_channel, or a random value if the channel was
306 * inbound. This may be zero for inbound channels serialized with LDK versions prior to
309 public UInt128 get_user_channel_id() {
310 byte[] ret = bindings.ChannelDetails_get_user_channel_id(this.ptr);
312 org.ldk.util.UInt128 ret_conv = new org.ldk.util.UInt128(ret);
317 * The `user_channel_id` passed in to create_channel, or a random value if the channel was
318 * inbound. This may be zero for inbound channels serialized with LDK versions prior to
321 public void set_user_channel_id(org.ldk.util.UInt128 val) {
322 bindings.ChannelDetails_set_user_channel_id(this.ptr, val.getLEBytes());
328 * Our total balance. This is the amount we would get if we close the channel.
329 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
330 * amount is not likely to be recoverable on close.
332 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
333 * balance is not available for inclusion in new outbound HTLCs). This further does not include
334 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
335 * This does not consider any on-chain fees.
337 * See also [`ChannelDetails::outbound_capacity_msat`]
339 public long get_balance_msat() {
340 long ret = bindings.ChannelDetails_get_balance_msat(this.ptr);
346 * Our total balance. This is the amount we would get if we close the channel.
347 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
348 * amount is not likely to be recoverable on close.
350 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
351 * balance is not available for inclusion in new outbound HTLCs). This further does not include
352 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
353 * This does not consider any on-chain fees.
355 * See also [`ChannelDetails::outbound_capacity_msat`]
357 public void set_balance_msat(long val) {
358 bindings.ChannelDetails_set_balance_msat(this.ptr, val);
364 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
365 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
366 * available for inclusion in new outbound HTLCs). This further does not include any pending
367 * outgoing HTLCs which are awaiting some other resolution to be sent.
369 * See also [`ChannelDetails::balance_msat`]
371 * This value is not exact. Due to various in-flight changes, feerate changes, and our
372 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
373 * should be able to spend nearly this amount.
375 public long get_outbound_capacity_msat() {
376 long ret = bindings.ChannelDetails_get_outbound_capacity_msat(this.ptr);
382 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
383 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
384 * available for inclusion in new outbound HTLCs). This further does not include any pending
385 * outgoing HTLCs which are awaiting some other resolution to be sent.
387 * See also [`ChannelDetails::balance_msat`]
389 * This value is not exact. Due to various in-flight changes, feerate changes, and our
390 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
391 * should be able to spend nearly this amount.
393 public void set_outbound_capacity_msat(long val) {
394 bindings.ChannelDetails_set_outbound_capacity_msat(this.ptr, val);
400 * The available outbound capacity for sending a single HTLC to the remote peer. This is
401 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
402 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
403 * to use a limit as close as possible to the HTLC limit we can currently send.
405 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
407 public long get_next_outbound_htlc_limit_msat() {
408 long ret = bindings.ChannelDetails_get_next_outbound_htlc_limit_msat(this.ptr);
414 * The available outbound capacity for sending a single HTLC to the remote peer. This is
415 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
416 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
417 * to use a limit as close as possible to the HTLC limit we can currently send.
419 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
421 public void set_next_outbound_htlc_limit_msat(long val) {
422 bindings.ChannelDetails_set_next_outbound_htlc_limit_msat(this.ptr, val);
428 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
429 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
430 * available for inclusion in new inbound HTLCs).
431 * Note that there are some corner cases not fully handled here, so the actual available
432 * inbound capacity may be slightly higher than this.
434 * This value is not exact. Due to various in-flight changes, feerate changes, and our
435 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
436 * However, our counterparty should be able to spend nearly this amount.
438 public long get_inbound_capacity_msat() {
439 long ret = bindings.ChannelDetails_get_inbound_capacity_msat(this.ptr);
445 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
446 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
447 * available for inclusion in new inbound HTLCs).
448 * Note that there are some corner cases not fully handled here, so the actual available
449 * inbound capacity may be slightly higher than this.
451 * This value is not exact. Due to various in-flight changes, feerate changes, and our
452 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
453 * However, our counterparty should be able to spend nearly this amount.
455 public void set_inbound_capacity_msat(long val) {
456 bindings.ChannelDetails_set_inbound_capacity_msat(this.ptr, val);
462 * The number of required confirmations on the funding transaction before the funding will be
463 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
464 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
465 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
466 * [`ChannelHandshakeLimits::max_minimum_depth`].
468 * This value will be `None` for outbound channels until the counterparty accepts the channel.
470 * [`is_outbound`]: ChannelDetails::is_outbound
471 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
472 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
474 public Option_u32Z get_confirmations_required() {
475 long ret = bindings.ChannelDetails_get_confirmations_required(this.ptr);
477 if (ret >= 0 && ret <= 4096) { return null; }
478 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
479 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
484 * The number of required confirmations on the funding transaction before the funding will be
485 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
486 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
487 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
488 * [`ChannelHandshakeLimits::max_minimum_depth`].
490 * This value will be `None` for outbound channels until the counterparty accepts the channel.
492 * [`is_outbound`]: ChannelDetails::is_outbound
493 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
494 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
496 public void set_confirmations_required(org.ldk.structs.Option_u32Z val) {
497 bindings.ChannelDetails_set_confirmations_required(this.ptr, val.ptr);
503 * The current number of confirmations on the funding transaction.
505 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
507 public Option_u32Z get_confirmations() {
508 long ret = bindings.ChannelDetails_get_confirmations(this.ptr);
510 if (ret >= 0 && ret <= 4096) { return null; }
511 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
512 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
517 * The current number of confirmations on the funding transaction.
519 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
521 public void set_confirmations(org.ldk.structs.Option_u32Z val) {
522 bindings.ChannelDetails_set_confirmations(this.ptr, val.ptr);
528 * The number of blocks (after our commitment transaction confirms) that we will need to wait
529 * until we can claim our funds after we force-close the channel. During this time our
530 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
531 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
532 * time to claim our non-HTLC-encumbered funds.
534 * This value will be `None` for outbound channels until the counterparty accepts the channel.
536 public Option_u16Z get_force_close_spend_delay() {
537 long ret = bindings.ChannelDetails_get_force_close_spend_delay(this.ptr);
539 if (ret >= 0 && ret <= 4096) { return null; }
540 org.ldk.structs.Option_u16Z ret_hu_conv = org.ldk.structs.Option_u16Z.constr_from_ptr(ret);
541 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
546 * The number of blocks (after our commitment transaction confirms) that we will need to wait
547 * until we can claim our funds after we force-close the channel. During this time our
548 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
549 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
550 * time to claim our non-HTLC-encumbered funds.
552 * This value will be `None` for outbound channels until the counterparty accepts the channel.
554 public void set_force_close_spend_delay(org.ldk.structs.Option_u16Z val) {
555 bindings.ChannelDetails_set_force_close_spend_delay(this.ptr, val.ptr);
561 * True if the channel was initiated (and thus funded) by us.
563 public bool get_is_outbound() {
564 bool ret = bindings.ChannelDetails_get_is_outbound(this.ptr);
570 * True if the channel was initiated (and thus funded) by us.
572 public void set_is_outbound(bool val) {
573 bindings.ChannelDetails_set_is_outbound(this.ptr, val);
579 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
580 * channel is not currently being shut down. `channel_ready` message exchange implies the
581 * required confirmation count has been reached (and we were connected to the peer at some
582 * point after the funding transaction received enough confirmations). The required
583 * confirmation count is provided in [`confirmations_required`].
585 * [`confirmations_required`]: ChannelDetails::confirmations_required
587 public bool get_is_channel_ready() {
588 bool ret = bindings.ChannelDetails_get_is_channel_ready(this.ptr);
594 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
595 * channel is not currently being shut down. `channel_ready` message exchange implies the
596 * required confirmation count has been reached (and we were connected to the peer at some
597 * point after the funding transaction received enough confirmations). The required
598 * confirmation count is provided in [`confirmations_required`].
600 * [`confirmations_required`]: ChannelDetails::confirmations_required
602 public void set_is_channel_ready(bool val) {
603 bindings.ChannelDetails_set_is_channel_ready(this.ptr, val);
609 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
610 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
612 * This is a strict superset of `is_channel_ready`.
614 public bool get_is_usable() {
615 bool ret = bindings.ChannelDetails_get_is_usable(this.ptr);
621 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
622 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
624 * This is a strict superset of `is_channel_ready`.
626 public void set_is_usable(bool val) {
627 bindings.ChannelDetails_set_is_usable(this.ptr, val);
633 * True if this channel is (or will be) publicly-announced.
635 public bool get_is_public() {
636 bool ret = bindings.ChannelDetails_get_is_public(this.ptr);
642 * True if this channel is (or will be) publicly-announced.
644 public void set_is_public(bool val) {
645 bindings.ChannelDetails_set_is_public(this.ptr, val);
651 * The smallest value HTLC (in msat) we will accept, for this channel. This field
652 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
654 public Option_u64Z get_inbound_htlc_minimum_msat() {
655 long ret = bindings.ChannelDetails_get_inbound_htlc_minimum_msat(this.ptr);
657 if (ret >= 0 && ret <= 4096) { return null; }
658 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
659 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
664 * The smallest value HTLC (in msat) we will accept, for this channel. This field
665 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
667 public void set_inbound_htlc_minimum_msat(org.ldk.structs.Option_u64Z val) {
668 bindings.ChannelDetails_set_inbound_htlc_minimum_msat(this.ptr, val.ptr);
674 * The largest value HTLC (in msat) we currently will accept, for this channel.
676 public Option_u64Z get_inbound_htlc_maximum_msat() {
677 long ret = bindings.ChannelDetails_get_inbound_htlc_maximum_msat(this.ptr);
679 if (ret >= 0 && ret <= 4096) { return null; }
680 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
681 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
686 * The largest value HTLC (in msat) we currently will accept, for this channel.
688 public void set_inbound_htlc_maximum_msat(org.ldk.structs.Option_u64Z val) {
689 bindings.ChannelDetails_set_inbound_htlc_maximum_msat(this.ptr, val.ptr);
695 * Set of configurable parameters that affect channel operation.
697 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
699 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
701 public ChannelConfig get_config() {
702 long ret = bindings.ChannelDetails_get_config(this.ptr);
704 if (ret >= 0 && ret <= 4096) { return null; }
705 org.ldk.structs.ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfig(null, ret); }
706 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
711 * Set of configurable parameters that affect channel operation.
713 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
715 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
717 public void set_config(org.ldk.structs.ChannelConfig val) {
718 bindings.ChannelDetails_set_config(this.ptr, val == null ? 0 : val.ptr);
721 if (this != null) { this.ptrs_to.AddLast(val); };
725 * Constructs a new ChannelDetails given each field
727 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, long balance_msat_arg, long outbound_capacity_msat_arg, long next_outbound_htlc_limit_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, 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) {
728 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(), balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_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, 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);
729 GC.KeepAlive(channel_id_arg);
730 GC.KeepAlive(counterparty_arg);
731 GC.KeepAlive(funding_txo_arg);
732 GC.KeepAlive(channel_type_arg);
733 GC.KeepAlive(short_channel_id_arg);
734 GC.KeepAlive(outbound_scid_alias_arg);
735 GC.KeepAlive(inbound_scid_alias_arg);
736 GC.KeepAlive(channel_value_satoshis_arg);
737 GC.KeepAlive(unspendable_punishment_reserve_arg);
738 GC.KeepAlive(user_channel_id_arg);
739 GC.KeepAlive(balance_msat_arg);
740 GC.KeepAlive(outbound_capacity_msat_arg);
741 GC.KeepAlive(next_outbound_htlc_limit_msat_arg);
742 GC.KeepAlive(inbound_capacity_msat_arg);
743 GC.KeepAlive(confirmations_required_arg);
744 GC.KeepAlive(confirmations_arg);
745 GC.KeepAlive(force_close_spend_delay_arg);
746 GC.KeepAlive(is_outbound_arg);
747 GC.KeepAlive(is_channel_ready_arg);
748 GC.KeepAlive(is_usable_arg);
749 GC.KeepAlive(is_public_arg);
750 GC.KeepAlive(inbound_htlc_minimum_msat_arg);
751 GC.KeepAlive(inbound_htlc_maximum_msat_arg);
752 GC.KeepAlive(config_arg);
753 if (ret >= 0 && ret <= 4096) { return null; }
754 org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); }
755 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
756 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(counterparty_arg); };
757 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_txo_arg); };
758 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type_arg); };
759 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(config_arg); };
763 internal long clone_ptr() {
764 long ret = bindings.ChannelDetails_clone_ptr(this.ptr);
770 * Creates a copy of the ChannelDetails
772 public ChannelDetails clone() {
773 long ret = bindings.ChannelDetails_clone(this.ptr);
775 if (ret >= 0 && ret <= 4096) { return null; }
776 org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); }
777 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
782 * Gets the current SCID which should be used to identify this channel for inbound payments.
783 * This should be used for providing invoice hints or in any other context where our
784 * counterparty will forward a payment to us.
786 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
787 * [`ChannelDetails::short_channel_id`]. See those for more information.
789 public Option_u64Z get_inbound_payment_scid() {
790 long ret = bindings.ChannelDetails_get_inbound_payment_scid(this.ptr);
792 if (ret >= 0 && ret <= 4096) { return null; }
793 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
794 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
799 * Gets the current SCID which should be used to identify this channel for outbound payments.
800 * This should be used in [`Route`]s to describe the first hop or in other contexts where
801 * we're sending or forwarding a payment outbound over this channel.
803 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
804 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
806 public Option_u64Z get_outbound_payment_scid() {
807 long ret = bindings.ChannelDetails_get_outbound_payment_scid(this.ptr);
809 if (ret >= 0 && ret <= 4096) { return null; }
810 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
811 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
816 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
818 public byte[] write() {
819 byte[] ret = bindings.ChannelDetails_write(this.ptr);
825 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
827 public static Result_ChannelDetailsDecodeErrorZ read(byte[] ser) {
828 long ret = bindings.ChannelDetails_read(ser);
830 if (ret >= 0 && ret <= 4096) { return null; }
831 Result_ChannelDetailsDecodeErrorZ ret_hu_conv = Result_ChannelDetailsDecodeErrorZ.constr_from_ptr(ret);