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