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