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 ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new 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 OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new 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 ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new 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 * [`inbound_scid_alias`]: Self::inbound_scid_alias
140 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
142 public Option_u64Z get_short_channel_id() {
143 long ret = bindings.ChannelDetails_get_short_channel_id(this.ptr);
144 Reference.reachabilityFence(this);
145 if (ret >= 0 && ret <= 4096) { return null; }
146 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
147 ret_hu_conv.ptrs_to.add(this);
152 * The position of the funding transaction in the chain. None if the funding transaction has
153 * not yet been confirmed and the channel fully opened.
155 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
156 * payments instead of this. See [`get_inbound_payment_scid`].
158 * [`inbound_scid_alias`]: Self::inbound_scid_alias
159 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
161 public void set_short_channel_id(Option_u64Z val) {
162 bindings.ChannelDetails_set_short_channel_id(this.ptr, val.ptr);
163 Reference.reachabilityFence(this);
164 Reference.reachabilityFence(val);
168 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
169 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
170 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
171 * when they see a payment to be routed to us.
173 * Our counterparty may choose to rotate this value at any time, though will always recognize
174 * previous values for inbound payment forwarding.
176 * [`short_channel_id`]: Self::short_channel_id
178 public Option_u64Z get_inbound_scid_alias() {
179 long ret = bindings.ChannelDetails_get_inbound_scid_alias(this.ptr);
180 Reference.reachabilityFence(this);
181 if (ret >= 0 && ret <= 4096) { return null; }
182 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
183 ret_hu_conv.ptrs_to.add(this);
188 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
189 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
190 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
191 * when they see a payment to be routed to us.
193 * Our counterparty may choose to rotate this value at any time, though will always recognize
194 * previous values for inbound payment forwarding.
196 * [`short_channel_id`]: Self::short_channel_id
198 public void set_inbound_scid_alias(Option_u64Z val) {
199 bindings.ChannelDetails_set_inbound_scid_alias(this.ptr, val.ptr);
200 Reference.reachabilityFence(this);
201 Reference.reachabilityFence(val);
205 * The value, in satoshis, of this channel as appears in the funding output
207 public long get_channel_value_satoshis() {
208 long ret = bindings.ChannelDetails_get_channel_value_satoshis(this.ptr);
209 Reference.reachabilityFence(this);
214 * The value, in satoshis, of this channel as appears in the funding output
216 public void set_channel_value_satoshis(long val) {
217 bindings.ChannelDetails_set_channel_value_satoshis(this.ptr, val);
218 Reference.reachabilityFence(this);
219 Reference.reachabilityFence(val);
223 * The value, in satoshis, that must always be held in the channel for us. This value ensures
224 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
225 * this value on chain.
227 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
229 * This value will be `None` for outbound channels until the counterparty accepts the channel.
231 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
233 public Option_u64Z get_unspendable_punishment_reserve() {
234 long ret = bindings.ChannelDetails_get_unspendable_punishment_reserve(this.ptr);
235 Reference.reachabilityFence(this);
236 if (ret >= 0 && ret <= 4096) { return null; }
237 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
238 ret_hu_conv.ptrs_to.add(this);
243 * The value, in satoshis, that must always be held in the channel for us. This value ensures
244 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
245 * this value on chain.
247 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
249 * This value will be `None` for outbound channels until the counterparty accepts the channel.
251 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
253 public void set_unspendable_punishment_reserve(Option_u64Z val) {
254 bindings.ChannelDetails_set_unspendable_punishment_reserve(this.ptr, val.ptr);
255 Reference.reachabilityFence(this);
256 Reference.reachabilityFence(val);
260 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
262 public long get_user_channel_id() {
263 long ret = bindings.ChannelDetails_get_user_channel_id(this.ptr);
264 Reference.reachabilityFence(this);
269 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
271 public void set_user_channel_id(long val) {
272 bindings.ChannelDetails_set_user_channel_id(this.ptr, val);
273 Reference.reachabilityFence(this);
274 Reference.reachabilityFence(val);
278 * Our total balance. This is the amount we would get if we close the channel.
279 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
280 * amount is not likely to be recoverable on close.
282 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
283 * balance is not available for inclusion in new outbound HTLCs). This further does not include
284 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
285 * This does not consider any on-chain fees.
287 * See also [`ChannelDetails::outbound_capacity_msat`]
289 public long get_balance_msat() {
290 long ret = bindings.ChannelDetails_get_balance_msat(this.ptr);
291 Reference.reachabilityFence(this);
296 * Our total balance. This is the amount we would get if we close the channel.
297 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
298 * amount is not likely to be recoverable on close.
300 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
301 * balance is not available for inclusion in new outbound HTLCs). This further does not include
302 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
303 * This does not consider any on-chain fees.
305 * See also [`ChannelDetails::outbound_capacity_msat`]
307 public void set_balance_msat(long val) {
308 bindings.ChannelDetails_set_balance_msat(this.ptr, val);
309 Reference.reachabilityFence(this);
310 Reference.reachabilityFence(val);
314 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
315 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
316 * available for inclusion in new outbound HTLCs). This further does not include any pending
317 * outgoing HTLCs which are awaiting some other resolution to be sent.
319 * See also [`ChannelDetails::balance_msat`]
321 * This value is not exact. Due to various in-flight changes, feerate changes, and our
322 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
323 * should be able to spend nearly this amount.
325 public long get_outbound_capacity_msat() {
326 long ret = bindings.ChannelDetails_get_outbound_capacity_msat(this.ptr);
327 Reference.reachabilityFence(this);
332 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
333 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
334 * available for inclusion in new outbound HTLCs). This further does not include any pending
335 * outgoing HTLCs which are awaiting some other resolution to be sent.
337 * See also [`ChannelDetails::balance_msat`]
339 * This value is not exact. Due to various in-flight changes, feerate changes, and our
340 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
341 * should be able to spend nearly this amount.
343 public void set_outbound_capacity_msat(long val) {
344 bindings.ChannelDetails_set_outbound_capacity_msat(this.ptr, val);
345 Reference.reachabilityFence(this);
346 Reference.reachabilityFence(val);
350 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
351 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
352 * available for inclusion in new inbound HTLCs).
353 * Note that there are some corner cases not fully handled here, so the actual available
354 * inbound capacity may be slightly higher than this.
356 * This value is not exact. Due to various in-flight changes, feerate changes, and our
357 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
358 * However, our counterparty should be able to spend nearly this amount.
360 public long get_inbound_capacity_msat() {
361 long ret = bindings.ChannelDetails_get_inbound_capacity_msat(this.ptr);
362 Reference.reachabilityFence(this);
367 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
368 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
369 * available for inclusion in new inbound HTLCs).
370 * Note that there are some corner cases not fully handled here, so the actual available
371 * inbound capacity may be slightly higher than this.
373 * This value is not exact. Due to various in-flight changes, feerate changes, and our
374 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
375 * However, our counterparty should be able to spend nearly this amount.
377 public void set_inbound_capacity_msat(long val) {
378 bindings.ChannelDetails_set_inbound_capacity_msat(this.ptr, val);
379 Reference.reachabilityFence(this);
380 Reference.reachabilityFence(val);
384 * The number of required confirmations on the funding transaction before the funding will be
385 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
386 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
387 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
388 * [`ChannelHandshakeLimits::max_minimum_depth`].
390 * This value will be `None` for outbound channels until the counterparty accepts the channel.
392 * [`is_outbound`]: ChannelDetails::is_outbound
393 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
394 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
396 public Option_u32Z get_confirmations_required() {
397 long ret = bindings.ChannelDetails_get_confirmations_required(this.ptr);
398 Reference.reachabilityFence(this);
399 if (ret >= 0 && ret <= 4096) { return null; }
400 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
401 ret_hu_conv.ptrs_to.add(this);
406 * The number of required confirmations on the funding transaction before the funding will be
407 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
408 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
409 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
410 * [`ChannelHandshakeLimits::max_minimum_depth`].
412 * This value will be `None` for outbound channels until the counterparty accepts the channel.
414 * [`is_outbound`]: ChannelDetails::is_outbound
415 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
416 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
418 public void set_confirmations_required(Option_u32Z val) {
419 bindings.ChannelDetails_set_confirmations_required(this.ptr, val.ptr);
420 Reference.reachabilityFence(this);
421 Reference.reachabilityFence(val);
425 * The number of blocks (after our commitment transaction confirms) that we will need to wait
426 * until we can claim our funds after we force-close the channel. During this time our
427 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
428 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
429 * time to claim our non-HTLC-encumbered funds.
431 * This value will be `None` for outbound channels until the counterparty accepts the channel.
433 public Option_u16Z get_force_close_spend_delay() {
434 long ret = bindings.ChannelDetails_get_force_close_spend_delay(this.ptr);
435 Reference.reachabilityFence(this);
436 if (ret >= 0 && ret <= 4096) { return null; }
437 org.ldk.structs.Option_u16Z ret_hu_conv = org.ldk.structs.Option_u16Z.constr_from_ptr(ret);
438 ret_hu_conv.ptrs_to.add(this);
443 * The number of blocks (after our commitment transaction confirms) that we will need to wait
444 * until we can claim our funds after we force-close the channel. During this time our
445 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
446 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
447 * time to claim our non-HTLC-encumbered funds.
449 * This value will be `None` for outbound channels until the counterparty accepts the channel.
451 public void set_force_close_spend_delay(Option_u16Z val) {
452 bindings.ChannelDetails_set_force_close_spend_delay(this.ptr, val.ptr);
453 Reference.reachabilityFence(this);
454 Reference.reachabilityFence(val);
458 * True if the channel was initiated (and thus funded) by us.
460 public boolean get_is_outbound() {
461 boolean ret = bindings.ChannelDetails_get_is_outbound(this.ptr);
462 Reference.reachabilityFence(this);
467 * True if the channel was initiated (and thus funded) by us.
469 public void set_is_outbound(boolean val) {
470 bindings.ChannelDetails_set_is_outbound(this.ptr, val);
471 Reference.reachabilityFence(this);
472 Reference.reachabilityFence(val);
476 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
477 * channel is not currently being shut down. `funding_locked` message exchange implies the
478 * required confirmation count has been reached (and we were connected to the peer at some
479 * point after the funding transaction received enough confirmations). The required
480 * confirmation count is provided in [`confirmations_required`].
482 * [`confirmations_required`]: ChannelDetails::confirmations_required
484 public boolean get_is_funding_locked() {
485 boolean ret = bindings.ChannelDetails_get_is_funding_locked(this.ptr);
486 Reference.reachabilityFence(this);
491 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
492 * channel is not currently being shut down. `funding_locked` message exchange implies the
493 * required confirmation count has been reached (and we were connected to the peer at some
494 * point after the funding transaction received enough confirmations). The required
495 * confirmation count is provided in [`confirmations_required`].
497 * [`confirmations_required`]: ChannelDetails::confirmations_required
499 public void set_is_funding_locked(boolean val) {
500 bindings.ChannelDetails_set_is_funding_locked(this.ptr, val);
501 Reference.reachabilityFence(this);
502 Reference.reachabilityFence(val);
506 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
507 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
509 * This is a strict superset of `is_funding_locked`.
511 public boolean get_is_usable() {
512 boolean ret = bindings.ChannelDetails_get_is_usable(this.ptr);
513 Reference.reachabilityFence(this);
518 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
519 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
521 * This is a strict superset of `is_funding_locked`.
523 public void set_is_usable(boolean val) {
524 bindings.ChannelDetails_set_is_usable(this.ptr, val);
525 Reference.reachabilityFence(this);
526 Reference.reachabilityFence(val);
530 * True if this channel is (or will be) publicly-announced.
532 public boolean get_is_public() {
533 boolean ret = bindings.ChannelDetails_get_is_public(this.ptr);
534 Reference.reachabilityFence(this);
539 * True if this channel is (or will be) publicly-announced.
541 public void set_is_public(boolean val) {
542 bindings.ChannelDetails_set_is_public(this.ptr, val);
543 Reference.reachabilityFence(this);
544 Reference.reachabilityFence(val);
548 * Constructs a new ChannelDetails given each field
550 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 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 inbound_capacity_msat_arg, Option_u32Z confirmations_required_arg, Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_funding_locked_arg, boolean is_usable_arg, boolean is_public_arg) {
551 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, 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, inbound_capacity_msat_arg, confirmations_required_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
552 Reference.reachabilityFence(channel_id_arg);
553 Reference.reachabilityFence(counterparty_arg);
554 Reference.reachabilityFence(funding_txo_arg);
555 Reference.reachabilityFence(channel_type_arg);
556 Reference.reachabilityFence(short_channel_id_arg);
557 Reference.reachabilityFence(inbound_scid_alias_arg);
558 Reference.reachabilityFence(channel_value_satoshis_arg);
559 Reference.reachabilityFence(unspendable_punishment_reserve_arg);
560 Reference.reachabilityFence(user_channel_id_arg);
561 Reference.reachabilityFence(balance_msat_arg);
562 Reference.reachabilityFence(outbound_capacity_msat_arg);
563 Reference.reachabilityFence(inbound_capacity_msat_arg);
564 Reference.reachabilityFence(confirmations_required_arg);
565 Reference.reachabilityFence(force_close_spend_delay_arg);
566 Reference.reachabilityFence(is_outbound_arg);
567 Reference.reachabilityFence(is_funding_locked_arg);
568 Reference.reachabilityFence(is_usable_arg);
569 Reference.reachabilityFence(is_public_arg);
570 if (ret >= 0 && ret <= 4096) { return null; }
571 ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelDetails(null, ret); }
572 ret_hu_conv.ptrs_to.add(ret_hu_conv);
577 long ret = bindings.ChannelDetails_clone_ptr(this.ptr);
578 Reference.reachabilityFence(this);
583 * Creates a copy of the ChannelDetails
585 public ChannelDetails clone() {
586 long ret = bindings.ChannelDetails_clone(this.ptr);
587 Reference.reachabilityFence(this);
588 if (ret >= 0 && ret <= 4096) { return null; }
589 ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelDetails(null, ret); }
590 ret_hu_conv.ptrs_to.add(this);
595 * Gets the current SCID which should be used to identify this channel for inbound payments.
596 * This should be used for providing invoice hints or in any other context where our
597 * counterparty will forward a payment to us.
599 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
600 * [`ChannelDetails::short_channel_id`]. See those for more information.
602 public Option_u64Z get_inbound_payment_scid() {
603 long ret = bindings.ChannelDetails_get_inbound_payment_scid(this.ptr);
604 Reference.reachabilityFence(this);
605 if (ret >= 0 && ret <= 4096) { return null; }
606 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
607 ret_hu_conv.ptrs_to.add(this);
612 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
614 public byte[] write() {
615 byte[] ret = bindings.ChannelDetails_write(this.ptr);
616 Reference.reachabilityFence(this);
621 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
623 public static Result_ChannelDetailsDecodeErrorZ read(byte[] ser) {
624 long ret = bindings.ChannelDetails_read(ser);
625 Reference.reachabilityFence(ser);
626 if (ret >= 0 && ret <= 4096) { return null; }
627 Result_ChannelDetailsDecodeErrorZ ret_hu_conv = Result_ChannelDetailsDecodeErrorZ.constr_from_ptr(ret);