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