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