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