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