1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
12 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class ChannelDetails extends CommonBase {
16 ChannelDetails(Object _dummy, long ptr) { super(ptr); }
17 @Override @SuppressWarnings("deprecation")
18 protected void finalize() throws Throwable {
20 if (ptr != 0) { bindings.ChannelDetails_free(ptr); }
24 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
25 * thereafter this is the txid of the funding transaction xor the funding transaction output).
26 * Note that this means this value is *not* persistent - it can change once during the
27 * lifetime of the channel.
29 public byte[] get_channel_id() {
30 byte[] ret = bindings.ChannelDetails_get_channel_id(this.ptr);
31 Reference.reachabilityFence(this);
36 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
37 * thereafter this is the txid of the funding transaction xor the funding transaction output).
38 * Note that this means this value is *not* persistent - it can change once during the
39 * lifetime of the channel.
41 public void set_channel_id(byte[] val) {
42 bindings.ChannelDetails_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
43 Reference.reachabilityFence(this);
44 Reference.reachabilityFence(val);
48 * Parameters which apply to our counterparty. See individual fields for more information.
50 public ChannelCounterparty get_counterparty() {
51 long ret = bindings.ChannelDetails_get_counterparty(this.ptr);
52 Reference.reachabilityFence(this);
53 if (ret >= 0 && ret <= 4096) { return null; }
54 org.ldk.structs.ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelCounterparty(null, ret); }
55 ret_hu_conv.ptrs_to.add(this);
60 * Parameters which apply to our counterparty. See individual fields for more information.
62 public void set_counterparty(ChannelCounterparty val) {
63 bindings.ChannelDetails_set_counterparty(this.ptr, val == null ? 0 : val.ptr & ~1);
64 Reference.reachabilityFence(this);
65 Reference.reachabilityFence(val);
69 * The Channel's funding transaction output, if we've negotiated the funding transaction with
70 * our counterparty already.
72 * Note that, if this has been set, `channel_id` will be equivalent to
73 * `funding_txo.unwrap().to_channel_id()`.
75 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
78 public OutPoint get_funding_txo() {
79 long ret = bindings.ChannelDetails_get_funding_txo(this.ptr);
80 Reference.reachabilityFence(this);
81 if (ret >= 0 && ret <= 4096) { return null; }
82 org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); }
83 ret_hu_conv.ptrs_to.add(this);
88 * The Channel's funding transaction output, if we've negotiated the funding transaction with
89 * our counterparty already.
91 * Note that, if this has been set, `channel_id` will be equivalent to
92 * `funding_txo.unwrap().to_channel_id()`.
94 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
96 public void set_funding_txo(@Nullable OutPoint val) {
97 bindings.ChannelDetails_set_funding_txo(this.ptr, val == null ? 0 : val.ptr & ~1);
98 Reference.reachabilityFence(this);
99 Reference.reachabilityFence(val);
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
110 public ChannelTypeFeatures get_channel_type() {
111 long ret = bindings.ChannelDetails_get_channel_type(this.ptr);
112 Reference.reachabilityFence(this);
113 if (ret >= 0 && ret <= 4096) { return null; }
114 org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); }
115 ret_hu_conv.ptrs_to.add(this);
120 * The features which this channel operates with. See individual features for more info.
122 * `None` until negotiation completes and the channel type is finalized.
124 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
126 public void set_channel_type(@Nullable ChannelTypeFeatures val) {
127 bindings.ChannelDetails_set_channel_type(this.ptr, val == null ? 0 : val.ptr & ~1);
128 Reference.reachabilityFence(this);
129 Reference.reachabilityFence(val);
133 * The position of the funding transaction in the chain. None if the funding transaction has
134 * not yet been confirmed and the channel fully opened.
136 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
137 * payments instead of this. See [`get_inbound_payment_scid`].
139 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
140 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
142 * [`inbound_scid_alias`]: Self::inbound_scid_alias
143 * [`outbound_scid_alias`]: Self::outbound_scid_alias
144 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
145 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
146 * [`confirmations_required`]: Self::confirmations_required
148 public Option_u64Z get_short_channel_id() {
149 long ret = bindings.ChannelDetails_get_short_channel_id(this.ptr);
150 Reference.reachabilityFence(this);
151 if (ret >= 0 && ret <= 4096) { return null; }
152 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
153 ret_hu_conv.ptrs_to.add(this);
158 * The position of the funding transaction in the chain. None if the funding transaction has
159 * not yet been confirmed and the channel fully opened.
161 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
162 * payments instead of this. See [`get_inbound_payment_scid`].
164 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
165 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
167 * [`inbound_scid_alias`]: Self::inbound_scid_alias
168 * [`outbound_scid_alias`]: Self::outbound_scid_alias
169 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
170 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
171 * [`confirmations_required`]: Self::confirmations_required
173 public void set_short_channel_id(Option_u64Z val) {
174 bindings.ChannelDetails_set_short_channel_id(this.ptr, val.ptr);
175 Reference.reachabilityFence(this);
176 Reference.reachabilityFence(val);
180 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
181 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
182 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
185 * This will be `None` as long as the channel is not available for routing outbound payments.
187 * [`short_channel_id`]: Self::short_channel_id
188 * [`confirmations_required`]: Self::confirmations_required
190 public Option_u64Z get_outbound_scid_alias() {
191 long ret = bindings.ChannelDetails_get_outbound_scid_alias(this.ptr);
192 Reference.reachabilityFence(this);
193 if (ret >= 0 && ret <= 4096) { return null; }
194 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
195 ret_hu_conv.ptrs_to.add(this);
200 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
201 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
202 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
205 * This will be `None` as long as the channel is not available for routing outbound payments.
207 * [`short_channel_id`]: Self::short_channel_id
208 * [`confirmations_required`]: Self::confirmations_required
210 public void set_outbound_scid_alias(Option_u64Z val) {
211 bindings.ChannelDetails_set_outbound_scid_alias(this.ptr, val.ptr);
212 Reference.reachabilityFence(this);
213 Reference.reachabilityFence(val);
217 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
218 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
219 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
220 * when they see a payment to be routed to us.
222 * Our counterparty may choose to rotate this value at any time, though will always recognize
223 * previous values for inbound payment forwarding.
225 * [`short_channel_id`]: Self::short_channel_id
227 public Option_u64Z get_inbound_scid_alias() {
228 long ret = bindings.ChannelDetails_get_inbound_scid_alias(this.ptr);
229 Reference.reachabilityFence(this);
230 if (ret >= 0 && ret <= 4096) { return null; }
231 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
232 ret_hu_conv.ptrs_to.add(this);
237 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
238 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
239 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
240 * when they see a payment to be routed to us.
242 * Our counterparty may choose to rotate this value at any time, though will always recognize
243 * previous values for inbound payment forwarding.
245 * [`short_channel_id`]: Self::short_channel_id
247 public void set_inbound_scid_alias(Option_u64Z val) {
248 bindings.ChannelDetails_set_inbound_scid_alias(this.ptr, val.ptr);
249 Reference.reachabilityFence(this);
250 Reference.reachabilityFence(val);
254 * The value, in satoshis, of this channel as appears in the funding output
256 public long get_channel_value_satoshis() {
257 long ret = bindings.ChannelDetails_get_channel_value_satoshis(this.ptr);
258 Reference.reachabilityFence(this);
263 * The value, in satoshis, of this channel as appears in the funding output
265 public void set_channel_value_satoshis(long val) {
266 bindings.ChannelDetails_set_channel_value_satoshis(this.ptr, val);
267 Reference.reachabilityFence(this);
268 Reference.reachabilityFence(val);
272 * The value, in satoshis, that must always be held in the channel for us. This value ensures
273 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
274 * this value on chain.
276 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
278 * This value will be `None` for outbound channels until the counterparty accepts the channel.
280 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
282 public Option_u64Z get_unspendable_punishment_reserve() {
283 long ret = bindings.ChannelDetails_get_unspendable_punishment_reserve(this.ptr);
284 Reference.reachabilityFence(this);
285 if (ret >= 0 && ret <= 4096) { return null; }
286 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
287 ret_hu_conv.ptrs_to.add(this);
292 * The value, in satoshis, that must always be held in the channel for us. This value ensures
293 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
294 * this value on chain.
296 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
298 * This value will be `None` for outbound channels until the counterparty accepts the channel.
300 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
302 public void set_unspendable_punishment_reserve(Option_u64Z val) {
303 bindings.ChannelDetails_set_unspendable_punishment_reserve(this.ptr, val.ptr);
304 Reference.reachabilityFence(this);
305 Reference.reachabilityFence(val);
309 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
311 public long get_user_channel_id() {
312 long ret = bindings.ChannelDetails_get_user_channel_id(this.ptr);
313 Reference.reachabilityFence(this);
318 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
320 public void set_user_channel_id(long val) {
321 bindings.ChannelDetails_set_user_channel_id(this.ptr, val);
322 Reference.reachabilityFence(this);
323 Reference.reachabilityFence(val);
327 * Our total balance. This is the amount we would get if we close the channel.
328 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
329 * amount is not likely to be recoverable on close.
331 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
332 * balance is not available for inclusion in new outbound HTLCs). This further does not include
333 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
334 * This does not consider any on-chain fees.
336 * See also [`ChannelDetails::outbound_capacity_msat`]
338 public long get_balance_msat() {
339 long ret = bindings.ChannelDetails_get_balance_msat(this.ptr);
340 Reference.reachabilityFence(this);
345 * Our total balance. This is the amount we would get if we close the channel.
346 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
347 * amount is not likely to be recoverable on close.
349 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
350 * balance is not available for inclusion in new outbound HTLCs). This further does not include
351 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
352 * This does not consider any on-chain fees.
354 * See also [`ChannelDetails::outbound_capacity_msat`]
356 public void set_balance_msat(long val) {
357 bindings.ChannelDetails_set_balance_msat(this.ptr, val);
358 Reference.reachabilityFence(this);
359 Reference.reachabilityFence(val);
363 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
364 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
365 * available for inclusion in new outbound HTLCs). This further does not include any pending
366 * outgoing HTLCs which are awaiting some other resolution to be sent.
368 * See also [`ChannelDetails::balance_msat`]
370 * This value is not exact. Due to various in-flight changes, feerate changes, and our
371 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
372 * should be able to spend nearly this amount.
374 public long get_outbound_capacity_msat() {
375 long ret = bindings.ChannelDetails_get_outbound_capacity_msat(this.ptr);
376 Reference.reachabilityFence(this);
381 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
382 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
383 * available for inclusion in new outbound HTLCs). This further does not include any pending
384 * outgoing HTLCs which are awaiting some other resolution to be sent.
386 * See also [`ChannelDetails::balance_msat`]
388 * This value is not exact. Due to various in-flight changes, feerate changes, and our
389 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
390 * should be able to spend nearly this amount.
392 public void set_outbound_capacity_msat(long val) {
393 bindings.ChannelDetails_set_outbound_capacity_msat(this.ptr, val);
394 Reference.reachabilityFence(this);
395 Reference.reachabilityFence(val);
399 * The available outbound capacity for sending a single HTLC to the remote peer. This is
400 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
401 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
402 * to use a limit as close as possible to the HTLC limit we can currently send.
404 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
406 public long get_next_outbound_htlc_limit_msat() {
407 long ret = bindings.ChannelDetails_get_next_outbound_htlc_limit_msat(this.ptr);
408 Reference.reachabilityFence(this);
413 * The available outbound capacity for sending a single HTLC to the remote peer. This is
414 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
415 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
416 * to use a limit as close as possible to the HTLC limit we can currently send.
418 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
420 public void set_next_outbound_htlc_limit_msat(long val) {
421 bindings.ChannelDetails_set_next_outbound_htlc_limit_msat(this.ptr, val);
422 Reference.reachabilityFence(this);
423 Reference.reachabilityFence(val);
427 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
428 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
429 * available for inclusion in new inbound HTLCs).
430 * Note that there are some corner cases not fully handled here, so the actual available
431 * inbound capacity may be slightly higher than this.
433 * This value is not exact. Due to various in-flight changes, feerate changes, and our
434 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
435 * However, our counterparty should be able to spend nearly this amount.
437 public long get_inbound_capacity_msat() {
438 long ret = bindings.ChannelDetails_get_inbound_capacity_msat(this.ptr);
439 Reference.reachabilityFence(this);
444 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
445 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
446 * available for inclusion in new inbound HTLCs).
447 * Note that there are some corner cases not fully handled here, so the actual available
448 * inbound capacity may be slightly higher than this.
450 * This value is not exact. Due to various in-flight changes, feerate changes, and our
451 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
452 * However, our counterparty should be able to spend nearly this amount.
454 public void set_inbound_capacity_msat(long val) {
455 bindings.ChannelDetails_set_inbound_capacity_msat(this.ptr, val);
456 Reference.reachabilityFence(this);
457 Reference.reachabilityFence(val);
461 * The number of required confirmations on the funding transaction before the funding will be
462 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
463 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
464 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
465 * [`ChannelHandshakeLimits::max_minimum_depth`].
467 * This value will be `None` for outbound channels until the counterparty accepts the channel.
469 * [`is_outbound`]: ChannelDetails::is_outbound
470 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
471 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
473 public Option_u32Z get_confirmations_required() {
474 long ret = bindings.ChannelDetails_get_confirmations_required(this.ptr);
475 Reference.reachabilityFence(this);
476 if (ret >= 0 && ret <= 4096) { return null; }
477 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
478 ret_hu_conv.ptrs_to.add(this);
483 * The number of required confirmations on the funding transaction before the funding will be
484 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
485 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
486 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
487 * [`ChannelHandshakeLimits::max_minimum_depth`].
489 * This value will be `None` for outbound channels until the counterparty accepts the channel.
491 * [`is_outbound`]: ChannelDetails::is_outbound
492 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
493 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
495 public void set_confirmations_required(Option_u32Z val) {
496 bindings.ChannelDetails_set_confirmations_required(this.ptr, val.ptr);
497 Reference.reachabilityFence(this);
498 Reference.reachabilityFence(val);
502 * The number of blocks (after our commitment transaction confirms) that we will need to wait
503 * until we can claim our funds after we force-close the channel. During this time our
504 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
505 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
506 * time to claim our non-HTLC-encumbered funds.
508 * This value will be `None` for outbound channels until the counterparty accepts the channel.
510 public Option_u16Z get_force_close_spend_delay() {
511 long ret = bindings.ChannelDetails_get_force_close_spend_delay(this.ptr);
512 Reference.reachabilityFence(this);
513 if (ret >= 0 && ret <= 4096) { return null; }
514 org.ldk.structs.Option_u16Z ret_hu_conv = org.ldk.structs.Option_u16Z.constr_from_ptr(ret);
515 ret_hu_conv.ptrs_to.add(this);
520 * The number of blocks (after our commitment transaction confirms) that we will need to wait
521 * until we can claim our funds after we force-close the channel. During this time our
522 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
523 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
524 * time to claim our non-HTLC-encumbered funds.
526 * This value will be `None` for outbound channels until the counterparty accepts the channel.
528 public void set_force_close_spend_delay(Option_u16Z val) {
529 bindings.ChannelDetails_set_force_close_spend_delay(this.ptr, val.ptr);
530 Reference.reachabilityFence(this);
531 Reference.reachabilityFence(val);
535 * True if the channel was initiated (and thus funded) by us.
537 public boolean get_is_outbound() {
538 boolean ret = bindings.ChannelDetails_get_is_outbound(this.ptr);
539 Reference.reachabilityFence(this);
544 * True if the channel was initiated (and thus funded) by us.
546 public void set_is_outbound(boolean val) {
547 bindings.ChannelDetails_set_is_outbound(this.ptr, val);
548 Reference.reachabilityFence(this);
549 Reference.reachabilityFence(val);
553 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
554 * channel is not currently being shut down. `channel_ready` message exchange implies the
555 * required confirmation count has been reached (and we were connected to the peer at some
556 * point after the funding transaction received enough confirmations). The required
557 * confirmation count is provided in [`confirmations_required`].
559 * [`confirmations_required`]: ChannelDetails::confirmations_required
561 public boolean get_is_channel_ready() {
562 boolean ret = bindings.ChannelDetails_get_is_channel_ready(this.ptr);
563 Reference.reachabilityFence(this);
568 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
569 * channel is not currently being shut down. `channel_ready` message exchange implies the
570 * required confirmation count has been reached (and we were connected to the peer at some
571 * point after the funding transaction received enough confirmations). The required
572 * confirmation count is provided in [`confirmations_required`].
574 * [`confirmations_required`]: ChannelDetails::confirmations_required
576 public void set_is_channel_ready(boolean val) {
577 bindings.ChannelDetails_set_is_channel_ready(this.ptr, val);
578 Reference.reachabilityFence(this);
579 Reference.reachabilityFence(val);
583 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
584 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
586 * This is a strict superset of `is_channel_ready`.
588 public boolean get_is_usable() {
589 boolean ret = bindings.ChannelDetails_get_is_usable(this.ptr);
590 Reference.reachabilityFence(this);
595 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
596 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
598 * This is a strict superset of `is_channel_ready`.
600 public void set_is_usable(boolean val) {
601 bindings.ChannelDetails_set_is_usable(this.ptr, val);
602 Reference.reachabilityFence(this);
603 Reference.reachabilityFence(val);
607 * True if this channel is (or will be) publicly-announced.
609 public boolean get_is_public() {
610 boolean ret = bindings.ChannelDetails_get_is_public(this.ptr);
611 Reference.reachabilityFence(this);
616 * True if this channel is (or will be) publicly-announced.
618 public void set_is_public(boolean val) {
619 bindings.ChannelDetails_set_is_public(this.ptr, val);
620 Reference.reachabilityFence(this);
621 Reference.reachabilityFence(val);
625 * The smallest value HTLC (in msat) we will accept, for this channel. This field
626 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
628 public Option_u64Z get_inbound_htlc_minimum_msat() {
629 long ret = bindings.ChannelDetails_get_inbound_htlc_minimum_msat(this.ptr);
630 Reference.reachabilityFence(this);
631 if (ret >= 0 && ret <= 4096) { return null; }
632 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
633 ret_hu_conv.ptrs_to.add(this);
638 * The smallest value HTLC (in msat) we will accept, for this channel. This field
639 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
641 public void set_inbound_htlc_minimum_msat(Option_u64Z val) {
642 bindings.ChannelDetails_set_inbound_htlc_minimum_msat(this.ptr, val.ptr);
643 Reference.reachabilityFence(this);
644 Reference.reachabilityFence(val);
648 * The largest value HTLC (in msat) we currently will accept, for this channel.
650 public Option_u64Z get_inbound_htlc_maximum_msat() {
651 long ret = bindings.ChannelDetails_get_inbound_htlc_maximum_msat(this.ptr);
652 Reference.reachabilityFence(this);
653 if (ret >= 0 && ret <= 4096) { return null; }
654 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
655 ret_hu_conv.ptrs_to.add(this);
660 * The largest value HTLC (in msat) we currently will accept, for this channel.
662 public void set_inbound_htlc_maximum_msat(Option_u64Z val) {
663 bindings.ChannelDetails_set_inbound_htlc_maximum_msat(this.ptr, val.ptr);
664 Reference.reachabilityFence(this);
665 Reference.reachabilityFence(val);
669 * Set of configurable parameters that affect channel operation.
671 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
673 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
676 public ChannelConfig get_config() {
677 long ret = bindings.ChannelDetails_get_config(this.ptr);
678 Reference.reachabilityFence(this);
679 if (ret >= 0 && ret <= 4096) { return null; }
680 org.ldk.structs.ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfig(null, ret); }
681 ret_hu_conv.ptrs_to.add(this);
686 * Set of configurable parameters that affect channel operation.
688 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
690 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
692 public void set_config(@Nullable ChannelConfig val) {
693 bindings.ChannelDetails_set_config(this.ptr, val == null ? 0 : val.ptr & ~1);
694 Reference.reachabilityFence(this);
695 Reference.reachabilityFence(val);
699 * Constructs a new ChannelDetails given each field
701 public static ChannelDetails of(byte[] channel_id_arg, ChannelCounterparty counterparty_arg, OutPoint funding_txo_arg, ChannelTypeFeatures channel_type_arg, Option_u64Z short_channel_id_arg, Option_u64Z outbound_scid_alias_arg, Option_u64Z inbound_scid_alias_arg, long channel_value_satoshis_arg, Option_u64Z unspendable_punishment_reserve_arg, long 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, Option_u32Z confirmations_required_arg, Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_channel_ready_arg, boolean is_usable_arg, boolean is_public_arg, Option_u64Z inbound_htlc_minimum_msat_arg, Option_u64Z inbound_htlc_maximum_msat_arg, ChannelConfig config_arg) {
702 long ret = bindings.ChannelDetails_new(InternalUtils.check_arr_len(channel_id_arg, 32), counterparty_arg == null ? 0 : counterparty_arg.ptr & ~1, funding_txo_arg == null ? 0 : funding_txo_arg.ptr & ~1, channel_type_arg == null ? 0 : channel_type_arg.ptr & ~1, 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, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, inbound_capacity_msat_arg, confirmations_required_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 & ~1);
703 Reference.reachabilityFence(channel_id_arg);
704 Reference.reachabilityFence(counterparty_arg);
705 Reference.reachabilityFence(funding_txo_arg);
706 Reference.reachabilityFence(channel_type_arg);
707 Reference.reachabilityFence(short_channel_id_arg);
708 Reference.reachabilityFence(outbound_scid_alias_arg);
709 Reference.reachabilityFence(inbound_scid_alias_arg);
710 Reference.reachabilityFence(channel_value_satoshis_arg);
711 Reference.reachabilityFence(unspendable_punishment_reserve_arg);
712 Reference.reachabilityFence(user_channel_id_arg);
713 Reference.reachabilityFence(balance_msat_arg);
714 Reference.reachabilityFence(outbound_capacity_msat_arg);
715 Reference.reachabilityFence(next_outbound_htlc_limit_msat_arg);
716 Reference.reachabilityFence(inbound_capacity_msat_arg);
717 Reference.reachabilityFence(confirmations_required_arg);
718 Reference.reachabilityFence(force_close_spend_delay_arg);
719 Reference.reachabilityFence(is_outbound_arg);
720 Reference.reachabilityFence(is_channel_ready_arg);
721 Reference.reachabilityFence(is_usable_arg);
722 Reference.reachabilityFence(is_public_arg);
723 Reference.reachabilityFence(inbound_htlc_minimum_msat_arg);
724 Reference.reachabilityFence(inbound_htlc_maximum_msat_arg);
725 Reference.reachabilityFence(config_arg);
726 if (ret >= 0 && ret <= 4096) { return null; }
727 org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); }
728 ret_hu_conv.ptrs_to.add(ret_hu_conv);
733 long ret = bindings.ChannelDetails_clone_ptr(this.ptr);
734 Reference.reachabilityFence(this);
739 * Creates a copy of the ChannelDetails
741 public ChannelDetails clone() {
742 long ret = bindings.ChannelDetails_clone(this.ptr);
743 Reference.reachabilityFence(this);
744 if (ret >= 0 && ret <= 4096) { return null; }
745 org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); }
746 ret_hu_conv.ptrs_to.add(this);
751 * Gets the current SCID which should be used to identify this channel for inbound payments.
752 * This should be used for providing invoice hints or in any other context where our
753 * counterparty will forward a payment to us.
755 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
756 * [`ChannelDetails::short_channel_id`]. See those for more information.
758 public Option_u64Z get_inbound_payment_scid() {
759 long ret = bindings.ChannelDetails_get_inbound_payment_scid(this.ptr);
760 Reference.reachabilityFence(this);
761 if (ret >= 0 && ret <= 4096) { return null; }
762 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
763 ret_hu_conv.ptrs_to.add(this);
768 * Gets the current SCID which should be used to identify this channel for outbound payments.
769 * This should be used in [`Route`]s to describe the first hop or in other contexts where
770 * we're sending or forwarding a payment outbound over this channel.
772 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
773 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
775 public Option_u64Z get_outbound_payment_scid() {
776 long ret = bindings.ChannelDetails_get_outbound_payment_scid(this.ptr);
777 Reference.reachabilityFence(this);
778 if (ret >= 0 && ret <= 4096) { return null; }
779 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
780 ret_hu_conv.ptrs_to.add(this);
785 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
787 public byte[] write() {
788 byte[] ret = bindings.ChannelDetails_write(this.ptr);
789 Reference.reachabilityFence(this);
794 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
796 public static Result_ChannelDetailsDecodeErrorZ read(byte[] ser) {
797 long ret = bindings.ChannelDetails_read(ser);
798 Reference.reachabilityFence(ser);
799 if (ret >= 0 && ret <= 4096) { return null; }
800 Result_ChannelDetailsDecodeErrorZ ret_hu_conv = Result_ChannelDetailsDecodeErrorZ.constr_from_ptr(ret);