84f4ac7ce011c3e201955493cc84d811e483c720
[ldk-java] / src / main / java / org / ldk / structs / ChannelDetails.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
9
10
11 /**
12  * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`]
13  * 
14  * [`ChannelManager::list_channels`]: crate::ln::channelmanager::ChannelManager::list_channels
15  * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
16  */
17 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
18 public class ChannelDetails extends CommonBase {
19         ChannelDetails(Object _dummy, long ptr) { super(ptr); }
20         @Override @SuppressWarnings("deprecation")
21         protected void finalize() throws Throwable {
22                 super.finalize();
23                 if (ptr != 0) { bindings.ChannelDetails_free(ptr); }
24         }
25
26         /**
27          * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
28          * thereafter this is the txid of the funding transaction xor the funding transaction output).
29          * Note that this means this value is *not* persistent - it can change once during the
30          * lifetime of the channel.
31          */
32         public ChannelId get_channel_id() {
33                 long ret = bindings.ChannelDetails_get_channel_id(this.ptr);
34                 Reference.reachabilityFence(this);
35                 if (ret >= 0 && ret <= 4096) { return null; }
36                 org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); }
37                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
38                 return ret_hu_conv;
39         }
40
41         /**
42          * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
43          * thereafter this is the txid of the funding transaction xor the funding transaction output).
44          * Note that this means this value is *not* persistent - it can change once during the
45          * lifetime of the channel.
46          */
47         public void set_channel_id(org.ldk.structs.ChannelId val) {
48                 bindings.ChannelDetails_set_channel_id(this.ptr, val.ptr);
49                 Reference.reachabilityFence(this);
50                 Reference.reachabilityFence(val);
51                 if (this != null) { this.ptrs_to.add(val); };
52         }
53
54         /**
55          * Parameters which apply to our counterparty. See individual fields for more information.
56          */
57         public ChannelCounterparty get_counterparty() {
58                 long ret = bindings.ChannelDetails_get_counterparty(this.ptr);
59                 Reference.reachabilityFence(this);
60                 if (ret >= 0 && ret <= 4096) { return null; }
61                 org.ldk.structs.ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelCounterparty(null, ret); }
62                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
63                 return ret_hu_conv;
64         }
65
66         /**
67          * Parameters which apply to our counterparty. See individual fields for more information.
68          */
69         public void set_counterparty(org.ldk.structs.ChannelCounterparty val) {
70                 bindings.ChannelDetails_set_counterparty(this.ptr, val.ptr);
71                 Reference.reachabilityFence(this);
72                 Reference.reachabilityFence(val);
73                 if (this != null) { this.ptrs_to.add(val); };
74         }
75
76         /**
77          * The Channel's funding transaction output, if we've negotiated the funding transaction with
78          * our counterparty already.
79          * 
80          * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
81          */
82         @Nullable
83         public OutPoint get_funding_txo() {
84                 long ret = bindings.ChannelDetails_get_funding_txo(this.ptr);
85                 Reference.reachabilityFence(this);
86                 if (ret >= 0 && ret <= 4096) { return null; }
87                 org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); }
88                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
89                 return ret_hu_conv;
90         }
91
92         /**
93          * The Channel's funding transaction output, if we've negotiated the funding transaction with
94          * our counterparty already.
95          * 
96          * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
97          */
98         public void set_funding_txo(@Nullable org.ldk.structs.OutPoint val) {
99                 bindings.ChannelDetails_set_funding_txo(this.ptr, val == null ? 0 : val.ptr);
100                 Reference.reachabilityFence(this);
101                 Reference.reachabilityFence(val);
102                 if (this != null) { this.ptrs_to.add(val); };
103         }
104
105         /**
106          * The features which this channel operates with. See individual features for more info.
107          * 
108          * `None` until negotiation completes and the channel type is finalized.
109          * 
110          * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
111          */
112         @Nullable
113         public ChannelTypeFeatures get_channel_type() {
114                 long ret = bindings.ChannelDetails_get_channel_type(this.ptr);
115                 Reference.reachabilityFence(this);
116                 if (ret >= 0 && ret <= 4096) { return null; }
117                 org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); }
118                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
119                 return ret_hu_conv;
120         }
121
122         /**
123          * The features which this channel operates with. See individual features for more info.
124          * 
125          * `None` until negotiation completes and the channel type is finalized.
126          * 
127          * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
128          */
129         public void set_channel_type(@Nullable org.ldk.structs.ChannelTypeFeatures val) {
130                 bindings.ChannelDetails_set_channel_type(this.ptr, val == null ? 0 : val.ptr);
131                 Reference.reachabilityFence(this);
132                 Reference.reachabilityFence(val);
133                 if (this != null) { this.ptrs_to.add(val); };
134         }
135
136         /**
137          * The position of the funding transaction in the chain. None if the funding transaction has
138          * not yet been confirmed and the channel fully opened.
139          * 
140          * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
141          * payments instead of this. See [`get_inbound_payment_scid`].
142          * 
143          * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
144          * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
145          * 
146          * [`inbound_scid_alias`]: Self::inbound_scid_alias
147          * [`outbound_scid_alias`]: Self::outbound_scid_alias
148          * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
149          * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
150          * [`confirmations_required`]: Self::confirmations_required
151          */
152         public Option_u64Z get_short_channel_id() {
153                 long ret = bindings.ChannelDetails_get_short_channel_id(this.ptr);
154                 Reference.reachabilityFence(this);
155                 if (ret >= 0 && ret <= 4096) { return null; }
156                 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
157                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
158                 return ret_hu_conv;
159         }
160
161         /**
162          * The position of the funding transaction in the chain. None if the funding transaction has
163          * not yet been confirmed and the channel fully opened.
164          * 
165          * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
166          * payments instead of this. See [`get_inbound_payment_scid`].
167          * 
168          * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
169          * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
170          * 
171          * [`inbound_scid_alias`]: Self::inbound_scid_alias
172          * [`outbound_scid_alias`]: Self::outbound_scid_alias
173          * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
174          * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
175          * [`confirmations_required`]: Self::confirmations_required
176          */
177         public void set_short_channel_id(org.ldk.structs.Option_u64Z val) {
178                 bindings.ChannelDetails_set_short_channel_id(this.ptr, val.ptr);
179                 Reference.reachabilityFence(this);
180                 Reference.reachabilityFence(val);
181                 if (this != null) { this.ptrs_to.add(val); };
182         }
183
184         /**
185          * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
186          * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
187          * the channel has not yet been confirmed (as long as [`confirmations_required`] is
188          * `Some(0)`).
189          * 
190          * This will be `None` as long as the channel is not available for routing outbound payments.
191          * 
192          * [`short_channel_id`]: Self::short_channel_id
193          * [`confirmations_required`]: Self::confirmations_required
194          */
195         public Option_u64Z get_outbound_scid_alias() {
196                 long ret = bindings.ChannelDetails_get_outbound_scid_alias(this.ptr);
197                 Reference.reachabilityFence(this);
198                 if (ret >= 0 && ret <= 4096) { return null; }
199                 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
200                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
201                 return ret_hu_conv;
202         }
203
204         /**
205          * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
206          * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
207          * the channel has not yet been confirmed (as long as [`confirmations_required`] is
208          * `Some(0)`).
209          * 
210          * This will be `None` as long as the channel is not available for routing outbound payments.
211          * 
212          * [`short_channel_id`]: Self::short_channel_id
213          * [`confirmations_required`]: Self::confirmations_required
214          */
215         public void set_outbound_scid_alias(org.ldk.structs.Option_u64Z val) {
216                 bindings.ChannelDetails_set_outbound_scid_alias(this.ptr, val.ptr);
217                 Reference.reachabilityFence(this);
218                 Reference.reachabilityFence(val);
219                 if (this != null) { this.ptrs_to.add(val); };
220         }
221
222         /**
223          * An optional [`short_channel_id`] alias for this channel, randomly generated by our
224          * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
225          * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
226          * when they see a payment to be routed to us.
227          * 
228          * Our counterparty may choose to rotate this value at any time, though will always recognize
229          * previous values for inbound payment forwarding.
230          * 
231          * [`short_channel_id`]: Self::short_channel_id
232          */
233         public Option_u64Z get_inbound_scid_alias() {
234                 long ret = bindings.ChannelDetails_get_inbound_scid_alias(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                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
239                 return ret_hu_conv;
240         }
241
242         /**
243          * An optional [`short_channel_id`] alias for this channel, randomly generated by our
244          * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
245          * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
246          * when they see a payment to be routed to us.
247          * 
248          * Our counterparty may choose to rotate this value at any time, though will always recognize
249          * previous values for inbound payment forwarding.
250          * 
251          * [`short_channel_id`]: Self::short_channel_id
252          */
253         public void set_inbound_scid_alias(org.ldk.structs.Option_u64Z val) {
254                 bindings.ChannelDetails_set_inbound_scid_alias(this.ptr, val.ptr);
255                 Reference.reachabilityFence(this);
256                 Reference.reachabilityFence(val);
257                 if (this != null) { this.ptrs_to.add(val); };
258         }
259
260         /**
261          * The value, in satoshis, of this channel as appears in the funding output
262          */
263         public long get_channel_value_satoshis() {
264                 long ret = bindings.ChannelDetails_get_channel_value_satoshis(this.ptr);
265                 Reference.reachabilityFence(this);
266                 return ret;
267         }
268
269         /**
270          * The value, in satoshis, of this channel as appears in the funding output
271          */
272         public void set_channel_value_satoshis(long val) {
273                 bindings.ChannelDetails_set_channel_value_satoshis(this.ptr, val);
274                 Reference.reachabilityFence(this);
275                 Reference.reachabilityFence(val);
276         }
277
278         /**
279          * The value, in satoshis, that must always be held in the channel for us. This value ensures
280          * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
281          * this value on chain.
282          * 
283          * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
284          * 
285          * This value will be `None` for outbound channels until the counterparty accepts the channel.
286          * 
287          * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
288          */
289         public Option_u64Z get_unspendable_punishment_reserve() {
290                 long ret = bindings.ChannelDetails_get_unspendable_punishment_reserve(this.ptr);
291                 Reference.reachabilityFence(this);
292                 if (ret >= 0 && ret <= 4096) { return null; }
293                 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
294                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
295                 return ret_hu_conv;
296         }
297
298         /**
299          * The value, in satoshis, that must always be held in the channel for us. This value ensures
300          * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
301          * this value on chain.
302          * 
303          * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
304          * 
305          * This value will be `None` for outbound channels until the counterparty accepts the channel.
306          * 
307          * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
308          */
309         public void set_unspendable_punishment_reserve(org.ldk.structs.Option_u64Z val) {
310                 bindings.ChannelDetails_set_unspendable_punishment_reserve(this.ptr, val.ptr);
311                 Reference.reachabilityFence(this);
312                 Reference.reachabilityFence(val);
313                 if (this != null) { this.ptrs_to.add(val); };
314         }
315
316         /**
317          * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
318          * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
319          * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
320          * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
321          * serialized with LDK versions prior to 0.0.113.
322          * 
323          * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
324          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
325          * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
326          */
327         public UInt128 get_user_channel_id() {
328                 byte[] ret = bindings.ChannelDetails_get_user_channel_id(this.ptr);
329                 Reference.reachabilityFence(this);
330                 org.ldk.util.UInt128 ret_conv = new org.ldk.util.UInt128(ret);
331                 return ret_conv;
332         }
333
334         /**
335          * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
336          * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
337          * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
338          * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
339          * serialized with LDK versions prior to 0.0.113.
340          * 
341          * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
342          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
343          * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
344          */
345         public void set_user_channel_id(org.ldk.util.UInt128 val) {
346                 bindings.ChannelDetails_set_user_channel_id(this.ptr, val.getLEBytes());
347                 Reference.reachabilityFence(this);
348                 Reference.reachabilityFence(val);
349         }
350
351         /**
352          * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
353          * which is applied to commitment and HTLC transactions.
354          * 
355          * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
356          */
357         public Option_u32Z get_feerate_sat_per_1000_weight() {
358                 long ret = bindings.ChannelDetails_get_feerate_sat_per_1000_weight(this.ptr);
359                 Reference.reachabilityFence(this);
360                 if (ret >= 0 && ret <= 4096) { return null; }
361                 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
362                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
363                 return ret_hu_conv;
364         }
365
366         /**
367          * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
368          * which is applied to commitment and HTLC transactions.
369          * 
370          * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
371          */
372         public void set_feerate_sat_per_1000_weight(org.ldk.structs.Option_u32Z val) {
373                 bindings.ChannelDetails_set_feerate_sat_per_1000_weight(this.ptr, val.ptr);
374                 Reference.reachabilityFence(this);
375                 Reference.reachabilityFence(val);
376                 if (this != null) { this.ptrs_to.add(val); };
377         }
378
379         /**
380          * Our total balance.  This is the amount we would get if we close the channel.
381          * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
382          * amount is not likely to be recoverable on close.
383          * 
384          * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
385          * balance is not available for inclusion in new outbound HTLCs). This further does not include
386          * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
387          * This does not consider any on-chain fees.
388          * 
389          * See also [`ChannelDetails::outbound_capacity_msat`]
390          */
391         public long get_balance_msat() {
392                 long ret = bindings.ChannelDetails_get_balance_msat(this.ptr);
393                 Reference.reachabilityFence(this);
394                 return ret;
395         }
396
397         /**
398          * Our total balance.  This is the amount we would get if we close the channel.
399          * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
400          * amount is not likely to be recoverable on close.
401          * 
402          * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
403          * balance is not available for inclusion in new outbound HTLCs). This further does not include
404          * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
405          * This does not consider any on-chain fees.
406          * 
407          * See also [`ChannelDetails::outbound_capacity_msat`]
408          */
409         public void set_balance_msat(long val) {
410                 bindings.ChannelDetails_set_balance_msat(this.ptr, val);
411                 Reference.reachabilityFence(this);
412                 Reference.reachabilityFence(val);
413         }
414
415         /**
416          * The available outbound capacity for sending HTLCs to the remote peer. This does not include
417          * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
418          * available for inclusion in new outbound HTLCs). This further does not include any pending
419          * outgoing HTLCs which are awaiting some other resolution to be sent.
420          * 
421          * See also [`ChannelDetails::balance_msat`]
422          * 
423          * This value is not exact. Due to various in-flight changes, feerate changes, and our
424          * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
425          * should be able to spend nearly this amount.
426          */
427         public long get_outbound_capacity_msat() {
428                 long ret = bindings.ChannelDetails_get_outbound_capacity_msat(this.ptr);
429                 Reference.reachabilityFence(this);
430                 return ret;
431         }
432
433         /**
434          * The available outbound capacity for sending HTLCs to the remote peer. This does not include
435          * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
436          * available for inclusion in new outbound HTLCs). This further does not include any pending
437          * outgoing HTLCs which are awaiting some other resolution to be sent.
438          * 
439          * See also [`ChannelDetails::balance_msat`]
440          * 
441          * This value is not exact. Due to various in-flight changes, feerate changes, and our
442          * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
443          * should be able to spend nearly this amount.
444          */
445         public void set_outbound_capacity_msat(long val) {
446                 bindings.ChannelDetails_set_outbound_capacity_msat(this.ptr, val);
447                 Reference.reachabilityFence(this);
448                 Reference.reachabilityFence(val);
449         }
450
451         /**
452          * The available outbound capacity for sending a single HTLC to the remote peer. This is
453          * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
454          * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
455          * to use a limit as close as possible to the HTLC limit we can currently send.
456          * 
457          * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
458          * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
459          */
460         public long get_next_outbound_htlc_limit_msat() {
461                 long ret = bindings.ChannelDetails_get_next_outbound_htlc_limit_msat(this.ptr);
462                 Reference.reachabilityFence(this);
463                 return ret;
464         }
465
466         /**
467          * The available outbound capacity for sending a single HTLC to the remote peer. This is
468          * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
469          * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
470          * to use a limit as close as possible to the HTLC limit we can currently send.
471          * 
472          * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
473          * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
474          */
475         public void set_next_outbound_htlc_limit_msat(long val) {
476                 bindings.ChannelDetails_set_next_outbound_htlc_limit_msat(this.ptr, val);
477                 Reference.reachabilityFence(this);
478                 Reference.reachabilityFence(val);
479         }
480
481         /**
482          * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
483          * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
484          * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
485          * route which is valid.
486          */
487         public long get_next_outbound_htlc_minimum_msat() {
488                 long ret = bindings.ChannelDetails_get_next_outbound_htlc_minimum_msat(this.ptr);
489                 Reference.reachabilityFence(this);
490                 return ret;
491         }
492
493         /**
494          * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
495          * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
496          * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
497          * route which is valid.
498          */
499         public void set_next_outbound_htlc_minimum_msat(long val) {
500                 bindings.ChannelDetails_set_next_outbound_htlc_minimum_msat(this.ptr, val);
501                 Reference.reachabilityFence(this);
502                 Reference.reachabilityFence(val);
503         }
504
505         /**
506          * The available inbound capacity for the remote peer to send HTLCs to us. This does not
507          * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
508          * available for inclusion in new inbound HTLCs).
509          * Note that there are some corner cases not fully handled here, so the actual available
510          * inbound capacity may be slightly higher than this.
511          * 
512          * This value is not exact. Due to various in-flight changes, feerate changes, and our
513          * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
514          * However, our counterparty should be able to spend nearly this amount.
515          */
516         public long get_inbound_capacity_msat() {
517                 long ret = bindings.ChannelDetails_get_inbound_capacity_msat(this.ptr);
518                 Reference.reachabilityFence(this);
519                 return ret;
520         }
521
522         /**
523          * The available inbound capacity for the remote peer to send HTLCs to us. This does not
524          * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
525          * available for inclusion in new inbound HTLCs).
526          * Note that there are some corner cases not fully handled here, so the actual available
527          * inbound capacity may be slightly higher than this.
528          * 
529          * This value is not exact. Due to various in-flight changes, feerate changes, and our
530          * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
531          * However, our counterparty should be able to spend nearly this amount.
532          */
533         public void set_inbound_capacity_msat(long val) {
534                 bindings.ChannelDetails_set_inbound_capacity_msat(this.ptr, val);
535                 Reference.reachabilityFence(this);
536                 Reference.reachabilityFence(val);
537         }
538
539         /**
540          * The number of required confirmations on the funding transaction before the funding will be
541          * considered \"locked\". This number is selected by the channel fundee (i.e. us if
542          * [`is_outbound`] is *not* set), and can be selected for inbound channels with
543          * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
544          * [`ChannelHandshakeLimits::max_minimum_depth`].
545          * 
546          * This value will be `None` for outbound channels until the counterparty accepts the channel.
547          * 
548          * [`is_outbound`]: ChannelDetails::is_outbound
549          * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
550          * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
551          */
552         public Option_u32Z get_confirmations_required() {
553                 long ret = bindings.ChannelDetails_get_confirmations_required(this.ptr);
554                 Reference.reachabilityFence(this);
555                 if (ret >= 0 && ret <= 4096) { return null; }
556                 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
557                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
558                 return ret_hu_conv;
559         }
560
561         /**
562          * The number of required confirmations on the funding transaction before the funding will be
563          * considered \"locked\". This number is selected by the channel fundee (i.e. us if
564          * [`is_outbound`] is *not* set), and can be selected for inbound channels with
565          * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
566          * [`ChannelHandshakeLimits::max_minimum_depth`].
567          * 
568          * This value will be `None` for outbound channels until the counterparty accepts the channel.
569          * 
570          * [`is_outbound`]: ChannelDetails::is_outbound
571          * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
572          * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
573          */
574         public void set_confirmations_required(org.ldk.structs.Option_u32Z val) {
575                 bindings.ChannelDetails_set_confirmations_required(this.ptr, val.ptr);
576                 Reference.reachabilityFence(this);
577                 Reference.reachabilityFence(val);
578                 if (this != null) { this.ptrs_to.add(val); };
579         }
580
581         /**
582          * The current number of confirmations on the funding transaction.
583          * 
584          * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
585          */
586         public Option_u32Z get_confirmations() {
587                 long ret = bindings.ChannelDetails_get_confirmations(this.ptr);
588                 Reference.reachabilityFence(this);
589                 if (ret >= 0 && ret <= 4096) { return null; }
590                 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
591                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
592                 return ret_hu_conv;
593         }
594
595         /**
596          * The current number of confirmations on the funding transaction.
597          * 
598          * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
599          */
600         public void set_confirmations(org.ldk.structs.Option_u32Z val) {
601                 bindings.ChannelDetails_set_confirmations(this.ptr, val.ptr);
602                 Reference.reachabilityFence(this);
603                 Reference.reachabilityFence(val);
604                 if (this != null) { this.ptrs_to.add(val); };
605         }
606
607         /**
608          * The number of blocks (after our commitment transaction confirms) that we will need to wait
609          * until we can claim our funds after we force-close the channel. During this time our
610          * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
611          * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
612          * time to claim our non-HTLC-encumbered funds.
613          * 
614          * This value will be `None` for outbound channels until the counterparty accepts the channel.
615          */
616         public Option_u16Z get_force_close_spend_delay() {
617                 long ret = bindings.ChannelDetails_get_force_close_spend_delay(this.ptr);
618                 Reference.reachabilityFence(this);
619                 if (ret >= 0 && ret <= 4096) { return null; }
620                 org.ldk.structs.Option_u16Z ret_hu_conv = org.ldk.structs.Option_u16Z.constr_from_ptr(ret);
621                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
622                 return ret_hu_conv;
623         }
624
625         /**
626          * The number of blocks (after our commitment transaction confirms) that we will need to wait
627          * until we can claim our funds after we force-close the channel. During this time our
628          * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
629          * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
630          * time to claim our non-HTLC-encumbered funds.
631          * 
632          * This value will be `None` for outbound channels until the counterparty accepts the channel.
633          */
634         public void set_force_close_spend_delay(org.ldk.structs.Option_u16Z val) {
635                 bindings.ChannelDetails_set_force_close_spend_delay(this.ptr, val.ptr);
636                 Reference.reachabilityFence(this);
637                 Reference.reachabilityFence(val);
638                 if (this != null) { this.ptrs_to.add(val); };
639         }
640
641         /**
642          * True if the channel was initiated (and thus funded) by us.
643          */
644         public boolean get_is_outbound() {
645                 boolean ret = bindings.ChannelDetails_get_is_outbound(this.ptr);
646                 Reference.reachabilityFence(this);
647                 return ret;
648         }
649
650         /**
651          * True if the channel was initiated (and thus funded) by us.
652          */
653         public void set_is_outbound(boolean val) {
654                 bindings.ChannelDetails_set_is_outbound(this.ptr, val);
655                 Reference.reachabilityFence(this);
656                 Reference.reachabilityFence(val);
657         }
658
659         /**
660          * True if the channel is confirmed, channel_ready messages have been exchanged, and the
661          * channel is not currently being shut down. `channel_ready` message exchange implies the
662          * required confirmation count has been reached (and we were connected to the peer at some
663          * point after the funding transaction received enough confirmations). The required
664          * confirmation count is provided in [`confirmations_required`].
665          * 
666          * [`confirmations_required`]: ChannelDetails::confirmations_required
667          */
668         public boolean get_is_channel_ready() {
669                 boolean ret = bindings.ChannelDetails_get_is_channel_ready(this.ptr);
670                 Reference.reachabilityFence(this);
671                 return ret;
672         }
673
674         /**
675          * True if the channel is confirmed, channel_ready messages have been exchanged, and the
676          * channel is not currently being shut down. `channel_ready` message exchange implies the
677          * required confirmation count has been reached (and we were connected to the peer at some
678          * point after the funding transaction received enough confirmations). The required
679          * confirmation count is provided in [`confirmations_required`].
680          * 
681          * [`confirmations_required`]: ChannelDetails::confirmations_required
682          */
683         public void set_is_channel_ready(boolean val) {
684                 bindings.ChannelDetails_set_is_channel_ready(this.ptr, val);
685                 Reference.reachabilityFence(this);
686                 Reference.reachabilityFence(val);
687         }
688
689         /**
690          * The stage of the channel's shutdown.
691          * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
692          * 
693          * Returns a copy of the field.
694          */
695         public Option_ChannelShutdownStateZ get_channel_shutdown_state() {
696                 long ret = bindings.ChannelDetails_get_channel_shutdown_state(this.ptr);
697                 Reference.reachabilityFence(this);
698                 if (ret >= 0 && ret <= 4096) { return null; }
699                 org.ldk.structs.Option_ChannelShutdownStateZ ret_hu_conv = org.ldk.structs.Option_ChannelShutdownStateZ.constr_from_ptr(ret);
700                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
701                 return ret_hu_conv;
702         }
703
704         /**
705          * The stage of the channel's shutdown.
706          * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
707          */
708         public void set_channel_shutdown_state(org.ldk.structs.Option_ChannelShutdownStateZ val) {
709                 bindings.ChannelDetails_set_channel_shutdown_state(this.ptr, val.ptr);
710                 Reference.reachabilityFence(this);
711                 Reference.reachabilityFence(val);
712                 if (this != null) { this.ptrs_to.add(val); };
713         }
714
715         /**
716          * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
717          * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
718          * 
719          * This is a strict superset of `is_channel_ready`.
720          */
721         public boolean get_is_usable() {
722                 boolean ret = bindings.ChannelDetails_get_is_usable(this.ptr);
723                 Reference.reachabilityFence(this);
724                 return ret;
725         }
726
727         /**
728          * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
729          * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
730          * 
731          * This is a strict superset of `is_channel_ready`.
732          */
733         public void set_is_usable(boolean val) {
734                 bindings.ChannelDetails_set_is_usable(this.ptr, val);
735                 Reference.reachabilityFence(this);
736                 Reference.reachabilityFence(val);
737         }
738
739         /**
740          * True if this channel is (or will be) publicly-announced.
741          */
742         public boolean get_is_public() {
743                 boolean ret = bindings.ChannelDetails_get_is_public(this.ptr);
744                 Reference.reachabilityFence(this);
745                 return ret;
746         }
747
748         /**
749          * True if this channel is (or will be) publicly-announced.
750          */
751         public void set_is_public(boolean val) {
752                 bindings.ChannelDetails_set_is_public(this.ptr, val);
753                 Reference.reachabilityFence(this);
754                 Reference.reachabilityFence(val);
755         }
756
757         /**
758          * The smallest value HTLC (in msat) we will accept, for this channel. This field
759          * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
760          */
761         public Option_u64Z get_inbound_htlc_minimum_msat() {
762                 long ret = bindings.ChannelDetails_get_inbound_htlc_minimum_msat(this.ptr);
763                 Reference.reachabilityFence(this);
764                 if (ret >= 0 && ret <= 4096) { return null; }
765                 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
766                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
767                 return ret_hu_conv;
768         }
769
770         /**
771          * The smallest value HTLC (in msat) we will accept, for this channel. This field
772          * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
773          */
774         public void set_inbound_htlc_minimum_msat(org.ldk.structs.Option_u64Z val) {
775                 bindings.ChannelDetails_set_inbound_htlc_minimum_msat(this.ptr, val.ptr);
776                 Reference.reachabilityFence(this);
777                 Reference.reachabilityFence(val);
778                 if (this != null) { this.ptrs_to.add(val); };
779         }
780
781         /**
782          * The largest value HTLC (in msat) we currently will accept, for this channel.
783          */
784         public Option_u64Z get_inbound_htlc_maximum_msat() {
785                 long ret = bindings.ChannelDetails_get_inbound_htlc_maximum_msat(this.ptr);
786                 Reference.reachabilityFence(this);
787                 if (ret >= 0 && ret <= 4096) { return null; }
788                 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
789                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
790                 return ret_hu_conv;
791         }
792
793         /**
794          * The largest value HTLC (in msat) we currently will accept, for this channel.
795          */
796         public void set_inbound_htlc_maximum_msat(org.ldk.structs.Option_u64Z val) {
797                 bindings.ChannelDetails_set_inbound_htlc_maximum_msat(this.ptr, val.ptr);
798                 Reference.reachabilityFence(this);
799                 Reference.reachabilityFence(val);
800                 if (this != null) { this.ptrs_to.add(val); };
801         }
802
803         /**
804          * Set of configurable parameters that affect channel operation.
805          * 
806          * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
807          * 
808          * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
809          */
810         @Nullable
811         public ChannelConfig get_config() {
812                 long ret = bindings.ChannelDetails_get_config(this.ptr);
813                 Reference.reachabilityFence(this);
814                 if (ret >= 0 && ret <= 4096) { return null; }
815                 org.ldk.structs.ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfig(null, ret); }
816                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
817                 return ret_hu_conv;
818         }
819
820         /**
821          * Set of configurable parameters that affect channel operation.
822          * 
823          * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
824          * 
825          * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
826          */
827         public void set_config(@Nullable org.ldk.structs.ChannelConfig val) {
828                 bindings.ChannelDetails_set_config(this.ptr, val == null ? 0 : val.ptr);
829                 Reference.reachabilityFence(this);
830                 Reference.reachabilityFence(val);
831                 if (this != null) { this.ptrs_to.add(val); };
832         }
833
834         /**
835          * Pending inbound HTLCs.
836          * 
837          * This field is empty for objects serialized with LDK versions prior to 0.0.122.
838          */
839         public InboundHTLCDetails[] get_pending_inbound_htlcs() {
840                 long[] ret = bindings.ChannelDetails_get_pending_inbound_htlcs(this.ptr);
841                 Reference.reachabilityFence(this);
842                 int ret_conv_20_len = ret.length;
843                 InboundHTLCDetails[] ret_conv_20_arr = new InboundHTLCDetails[ret_conv_20_len];
844                 for (int u = 0; u < ret_conv_20_len; u++) {
845                         long ret_conv_20 = ret[u];
846                         org.ldk.structs.InboundHTLCDetails ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.InboundHTLCDetails(null, ret_conv_20); }
847                         if (ret_conv_20_hu_conv != null) { ret_conv_20_hu_conv.ptrs_to.add(this); };
848                         ret_conv_20_arr[u] = ret_conv_20_hu_conv;
849                 }
850                 return ret_conv_20_arr;
851         }
852
853         /**
854          * Pending inbound HTLCs.
855          * 
856          * This field is empty for objects serialized with LDK versions prior to 0.0.122.
857          */
858         public void set_pending_inbound_htlcs(InboundHTLCDetails[] val) {
859                 bindings.ChannelDetails_set_pending_inbound_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_20 -> val_conv_20.ptr).toArray() : null);
860                 Reference.reachabilityFence(this);
861                 Reference.reachabilityFence(val);
862                 for (InboundHTLCDetails val_conv_20: val) { if (this != null) { this.ptrs_to.add(val_conv_20); }; };
863         }
864
865         /**
866          * Pending outbound HTLCs.
867          * 
868          * This field is empty for objects serialized with LDK versions prior to 0.0.122.
869          */
870         public OutboundHTLCDetails[] get_pending_outbound_htlcs() {
871                 long[] ret = bindings.ChannelDetails_get_pending_outbound_htlcs(this.ptr);
872                 Reference.reachabilityFence(this);
873                 int ret_conv_21_len = ret.length;
874                 OutboundHTLCDetails[] ret_conv_21_arr = new OutboundHTLCDetails[ret_conv_21_len];
875                 for (int v = 0; v < ret_conv_21_len; v++) {
876                         long ret_conv_21 = ret[v];
877                         org.ldk.structs.OutboundHTLCDetails ret_conv_21_hu_conv = null; if (ret_conv_21 < 0 || ret_conv_21 > 4096) { ret_conv_21_hu_conv = new org.ldk.structs.OutboundHTLCDetails(null, ret_conv_21); }
878                         if (ret_conv_21_hu_conv != null) { ret_conv_21_hu_conv.ptrs_to.add(this); };
879                         ret_conv_21_arr[v] = ret_conv_21_hu_conv;
880                 }
881                 return ret_conv_21_arr;
882         }
883
884         /**
885          * Pending outbound HTLCs.
886          * 
887          * This field is empty for objects serialized with LDK versions prior to 0.0.122.
888          */
889         public void set_pending_outbound_htlcs(OutboundHTLCDetails[] val) {
890                 bindings.ChannelDetails_set_pending_outbound_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_21 -> val_conv_21.ptr).toArray() : null);
891                 Reference.reachabilityFence(this);
892                 Reference.reachabilityFence(val);
893                 for (OutboundHTLCDetails val_conv_21: val) { if (this != null) { this.ptrs_to.add(val_conv_21); }; };
894         }
895
896         /**
897          * Constructs a new ChannelDetails given each field
898          * 
899          * Note that funding_txo_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
900          * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
901          * Note that config_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
902          */
903         public static ChannelDetails of(org.ldk.structs.ChannelId channel_id_arg, org.ldk.structs.ChannelCounterparty counterparty_arg, @Nullable org.ldk.structs.OutPoint funding_txo_arg, @Nullable org.ldk.structs.ChannelTypeFeatures channel_type_arg, org.ldk.structs.Option_u64Z short_channel_id_arg, org.ldk.structs.Option_u64Z outbound_scid_alias_arg, org.ldk.structs.Option_u64Z inbound_scid_alias_arg, long channel_value_satoshis_arg, org.ldk.structs.Option_u64Z unspendable_punishment_reserve_arg, org.ldk.util.UInt128 user_channel_id_arg, org.ldk.structs.Option_u32Z feerate_sat_per_1000_weight_arg, long balance_msat_arg, long outbound_capacity_msat_arg, long next_outbound_htlc_limit_msat_arg, long next_outbound_htlc_minimum_msat_arg, long inbound_capacity_msat_arg, org.ldk.structs.Option_u32Z confirmations_required_arg, org.ldk.structs.Option_u32Z confirmations_arg, org.ldk.structs.Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_channel_ready_arg, org.ldk.structs.Option_ChannelShutdownStateZ channel_shutdown_state_arg, boolean is_usable_arg, boolean is_public_arg, org.ldk.structs.Option_u64Z inbound_htlc_minimum_msat_arg, org.ldk.structs.Option_u64Z inbound_htlc_maximum_msat_arg, @Nullable org.ldk.structs.ChannelConfig config_arg, InboundHTLCDetails[] pending_inbound_htlcs_arg, OutboundHTLCDetails[] pending_outbound_htlcs_arg) {
904                 long ret = bindings.ChannelDetails_new(channel_id_arg.ptr, counterparty_arg.ptr, funding_txo_arg == null ? 0 : funding_txo_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr, short_channel_id_arg.ptr, outbound_scid_alias_arg.ptr, inbound_scid_alias_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg.getLEBytes(), feerate_sat_per_1000_weight_arg.ptr, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, next_outbound_htlc_minimum_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, confirmations_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_channel_ready_arg, channel_shutdown_state_arg.ptr, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg.ptr, inbound_htlc_maximum_msat_arg.ptr, config_arg == null ? 0 : config_arg.ptr, pending_inbound_htlcs_arg != null ? Arrays.stream(pending_inbound_htlcs_arg).mapToLong(pending_inbound_htlcs_arg_conv_20 -> pending_inbound_htlcs_arg_conv_20.ptr).toArray() : null, pending_outbound_htlcs_arg != null ? Arrays.stream(pending_outbound_htlcs_arg).mapToLong(pending_outbound_htlcs_arg_conv_21 -> pending_outbound_htlcs_arg_conv_21.ptr).toArray() : null);
905                 Reference.reachabilityFence(channel_id_arg);
906                 Reference.reachabilityFence(counterparty_arg);
907                 Reference.reachabilityFence(funding_txo_arg);
908                 Reference.reachabilityFence(channel_type_arg);
909                 Reference.reachabilityFence(short_channel_id_arg);
910                 Reference.reachabilityFence(outbound_scid_alias_arg);
911                 Reference.reachabilityFence(inbound_scid_alias_arg);
912                 Reference.reachabilityFence(channel_value_satoshis_arg);
913                 Reference.reachabilityFence(unspendable_punishment_reserve_arg);
914                 Reference.reachabilityFence(user_channel_id_arg);
915                 Reference.reachabilityFence(feerate_sat_per_1000_weight_arg);
916                 Reference.reachabilityFence(balance_msat_arg);
917                 Reference.reachabilityFence(outbound_capacity_msat_arg);
918                 Reference.reachabilityFence(next_outbound_htlc_limit_msat_arg);
919                 Reference.reachabilityFence(next_outbound_htlc_minimum_msat_arg);
920                 Reference.reachabilityFence(inbound_capacity_msat_arg);
921                 Reference.reachabilityFence(confirmations_required_arg);
922                 Reference.reachabilityFence(confirmations_arg);
923                 Reference.reachabilityFence(force_close_spend_delay_arg);
924                 Reference.reachabilityFence(is_outbound_arg);
925                 Reference.reachabilityFence(is_channel_ready_arg);
926                 Reference.reachabilityFence(channel_shutdown_state_arg);
927                 Reference.reachabilityFence(is_usable_arg);
928                 Reference.reachabilityFence(is_public_arg);
929                 Reference.reachabilityFence(inbound_htlc_minimum_msat_arg);
930                 Reference.reachabilityFence(inbound_htlc_maximum_msat_arg);
931                 Reference.reachabilityFence(config_arg);
932                 Reference.reachabilityFence(pending_inbound_htlcs_arg);
933                 Reference.reachabilityFence(pending_outbound_htlcs_arg);
934                 if (ret >= 0 && ret <= 4096) { return null; }
935                 org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); }
936                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
937                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_id_arg); };
938                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(counterparty_arg); };
939                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(funding_txo_arg); };
940                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_type_arg); };
941                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(short_channel_id_arg); };
942                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(outbound_scid_alias_arg); };
943                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(inbound_scid_alias_arg); };
944                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(unspendable_punishment_reserve_arg); };
945                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(feerate_sat_per_1000_weight_arg); };
946                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(confirmations_required_arg); };
947                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(confirmations_arg); };
948                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(force_close_spend_delay_arg); };
949                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_shutdown_state_arg); };
950                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(inbound_htlc_minimum_msat_arg); };
951                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(inbound_htlc_maximum_msat_arg); };
952                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(config_arg); };
953                 for (InboundHTLCDetails pending_inbound_htlcs_arg_conv_20: pending_inbound_htlcs_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(pending_inbound_htlcs_arg_conv_20); }; };
954                 for (OutboundHTLCDetails pending_outbound_htlcs_arg_conv_21: pending_outbound_htlcs_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(pending_outbound_htlcs_arg_conv_21); }; };
955                 return ret_hu_conv;
956         }
957
958         long clone_ptr() {
959                 long ret = bindings.ChannelDetails_clone_ptr(this.ptr);
960                 Reference.reachabilityFence(this);
961                 return ret;
962         }
963
964         /**
965          * Creates a copy of the ChannelDetails
966          */
967         public ChannelDetails clone() {
968                 long ret = bindings.ChannelDetails_clone(this.ptr);
969                 Reference.reachabilityFence(this);
970                 if (ret >= 0 && ret <= 4096) { return null; }
971                 org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); }
972                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
973                 return ret_hu_conv;
974         }
975
976         /**
977          * Gets the current SCID which should be used to identify this channel for inbound payments.
978          * This should be used for providing invoice hints or in any other context where our
979          * counterparty will forward a payment to us.
980          * 
981          * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
982          * [`ChannelDetails::short_channel_id`]. See those for more information.
983          */
984         public Option_u64Z get_inbound_payment_scid() {
985                 long ret = bindings.ChannelDetails_get_inbound_payment_scid(this.ptr);
986                 Reference.reachabilityFence(this);
987                 if (ret >= 0 && ret <= 4096) { return null; }
988                 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
989                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
990                 return ret_hu_conv;
991         }
992
993         /**
994          * Gets the current SCID which should be used to identify this channel for outbound payments.
995          * This should be used in [`Route`]s to describe the first hop or in other contexts where
996          * we're sending or forwarding a payment outbound over this channel.
997          * 
998          * This is either the [`ChannelDetails::short_channel_id`], if set, or the
999          * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
1000          * 
1001          * [`Route`]: crate::routing::router::Route
1002          */
1003         public Option_u64Z get_outbound_payment_scid() {
1004                 long ret = bindings.ChannelDetails_get_outbound_payment_scid(this.ptr);
1005                 Reference.reachabilityFence(this);
1006                 if (ret >= 0 && ret <= 4096) { return null; }
1007                 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
1008                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
1009                 return ret_hu_conv;
1010         }
1011
1012         /**
1013          * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
1014          */
1015         public byte[] write() {
1016                 byte[] ret = bindings.ChannelDetails_write(this.ptr);
1017                 Reference.reachabilityFence(this);
1018                 return ret;
1019         }
1020
1021         /**
1022          * Read a ChannelDetails from a byte array, created by ChannelDetails_write
1023          */
1024         public static Result_ChannelDetailsDecodeErrorZ read(byte[] ser) {
1025                 long ret = bindings.ChannelDetails_read(ser);
1026                 Reference.reachabilityFence(ser);
1027                 if (ret >= 0 && ret <= 4096) { return null; }
1028                 Result_ChannelDetailsDecodeErrorZ ret_hu_conv = Result_ChannelDetailsDecodeErrorZ.constr_from_ptr(ret);
1029                 return ret_hu_conv;
1030         }
1031
1032 }