]> git.bitcoin.ninja Git - ldk-java/blob - c_sharp/src/org/ldk/structs/ChannelDetails.cs
Update CI references to LDK 0.0.124 drop stale memchr pins
[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  * Balances of a channel are available through [`ChainMonitor::get_claimable_balances`] and
13  * [`ChannelMonitor::get_claimable_balances`], calculated with respect to the corresponding on-chain
14  * transactions.
15  * 
16  * [`ChannelManager::list_channels`]: crate::ln::channelmanager::ChannelManager::list_channels
17  * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
18  * [`ChainMonitor::get_claimable_balances`]: crate::chain::chainmonitor::ChainMonitor::get_claimable_balances
19  * [`ChannelMonitor::get_claimable_balances`]: crate::chain::channelmonitor::ChannelMonitor::get_claimable_balances
20  */
21 public class ChannelDetails : CommonBase {
22         internal ChannelDetails(object _dummy, long ptr) : base(ptr) { }
23         ~ChannelDetails() {
24                 if (ptr != 0) { bindings.ChannelDetails_free(ptr); }
25         }
26
27         /**
28          * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
29          * thereafter this is the txid of the funding transaction xor the funding transaction output).
30          * Note that this means this value is *not* persistent - it can change once during the
31          * lifetime of the channel.
32          */
33         public ChannelId get_channel_id() {
34                 long ret = bindings.ChannelDetails_get_channel_id(this.ptr);
35                 GC.KeepAlive(this);
36                 if (ret >= 0 && ret <= 4096) { return null; }
37                 org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); }
38                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
39                 return ret_hu_conv;
40         }
41
42         /**
43          * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
44          * thereafter this is the txid of the funding transaction xor the funding transaction output).
45          * Note that this means this value is *not* persistent - it can change once during the
46          * lifetime of the channel.
47          */
48         public void set_channel_id(org.ldk.structs.ChannelId val) {
49                 bindings.ChannelDetails_set_channel_id(this.ptr, val.ptr);
50                 GC.KeepAlive(this);
51                 GC.KeepAlive(val);
52         }
53
54         /**
55          * Parameters which apply to our counterparty. See individual fields for more information.
56          */
57         public ChannelCounterparty get_counterparty() {
58                 long ret = bindings.ChannelDetails_get_counterparty(this.ptr);
59                 GC.KeepAlive(this);
60                 if (ret >= 0 && ret <= 4096) { return null; }
61                 org.ldk.structs.ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelCounterparty(null, ret); }
62                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
63                 return ret_hu_conv;
64         }
65
66         /**
67          * Parameters which apply to our counterparty. See individual fields for more information.
68          */
69         public void set_counterparty(org.ldk.structs.ChannelCounterparty val) {
70                 bindings.ChannelDetails_set_counterparty(this.ptr, val.ptr);
71                 GC.KeepAlive(this);
72                 GC.KeepAlive(val);
73         }
74
75         /**
76          * The Channel's funding transaction output, if we've negotiated the funding transaction with
77          * our counterparty already.
78          * 
79          * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
80          */
81         public OutPoint get_funding_txo() {
82                 long ret = bindings.ChannelDetails_get_funding_txo(this.ptr);
83                 GC.KeepAlive(this);
84                 if (ret >= 0 && ret <= 4096) { return null; }
85                 org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); }
86                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
87                 return ret_hu_conv;
88         }
89
90         /**
91          * The Channel's funding transaction output, if we've negotiated the funding transaction with
92          * our counterparty already.
93          * 
94          * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
95          */
96         public void set_funding_txo(org.ldk.structs.OutPoint val) {
97                 bindings.ChannelDetails_set_funding_txo(this.ptr, val == null ? 0 : val.ptr);
98                 GC.KeepAlive(this);
99                 GC.KeepAlive(val);
100         }
101
102         /**
103          * The features which this channel operates with. See individual features for more info.
104          * 
105          * `None` until negotiation completes and the channel type is finalized.
106          * 
107          * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
108          */
109         public ChannelTypeFeatures get_channel_type() {
110                 long ret = bindings.ChannelDetails_get_channel_type(this.ptr);
111                 GC.KeepAlive(this);
112                 if (ret >= 0 && ret <= 4096) { return null; }
113                 org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); }
114                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
115                 return ret_hu_conv;
116         }
117
118         /**
119          * The features which this channel operates with. See individual features for more info.
120          * 
121          * `None` until negotiation completes and the channel type is finalized.
122          * 
123          * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
124          */
125         public void set_channel_type(org.ldk.structs.ChannelTypeFeatures val) {
126                 bindings.ChannelDetails_set_channel_type(this.ptr, val == null ? 0 : val.ptr);
127                 GC.KeepAlive(this);
128                 GC.KeepAlive(val);
129         }
130
131         /**
132          * The position of the funding transaction in the chain. None if the funding transaction has
133          * not yet been confirmed and the channel fully opened.
134          * 
135          * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
136          * payments instead of this. See [`get_inbound_payment_scid`].
137          * 
138          * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
139          * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
140          * 
141          * [`inbound_scid_alias`]: Self::inbound_scid_alias
142          * [`outbound_scid_alias`]: Self::outbound_scid_alias
143          * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
144          * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
145          * [`confirmations_required`]: Self::confirmations_required
146          */
147         public Option_u64Z get_short_channel_id() {
148                 long ret = bindings.ChannelDetails_get_short_channel_id(this.ptr);
149                 GC.KeepAlive(this);
150                 if (ret >= 0 && ret <= 4096) { return null; }
151                 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
152                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
153                 return ret_hu_conv;
154         }
155
156         /**
157          * The position of the funding transaction in the chain. None if the funding transaction has
158          * not yet been confirmed and the channel fully opened.
159          * 
160          * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
161          * payments instead of this. See [`get_inbound_payment_scid`].
162          * 
163          * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
164          * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
165          * 
166          * [`inbound_scid_alias`]: Self::inbound_scid_alias
167          * [`outbound_scid_alias`]: Self::outbound_scid_alias
168          * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
169          * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
170          * [`confirmations_required`]: Self::confirmations_required
171          */
172         public void set_short_channel_id(org.ldk.structs.Option_u64Z val) {
173                 bindings.ChannelDetails_set_short_channel_id(this.ptr, val.ptr);
174                 GC.KeepAlive(this);
175                 GC.KeepAlive(val);
176         }
177
178         /**
179          * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
180          * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
181          * the channel has not yet been confirmed (as long as [`confirmations_required`] is
182          * `Some(0)`).
183          * 
184          * This will be `None` as long as the channel is not available for routing outbound payments.
185          * 
186          * [`short_channel_id`]: Self::short_channel_id
187          * [`confirmations_required`]: Self::confirmations_required
188          */
189         public Option_u64Z get_outbound_scid_alias() {
190                 long ret = bindings.ChannelDetails_get_outbound_scid_alias(this.ptr);
191                 GC.KeepAlive(this);
192                 if (ret >= 0 && ret <= 4096) { return null; }
193                 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
194                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
195                 return ret_hu_conv;
196         }
197
198         /**
199          * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
200          * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
201          * the channel has not yet been confirmed (as long as [`confirmations_required`] is
202          * `Some(0)`).
203          * 
204          * This will be `None` as long as the channel is not available for routing outbound payments.
205          * 
206          * [`short_channel_id`]: Self::short_channel_id
207          * [`confirmations_required`]: Self::confirmations_required
208          */
209         public void set_outbound_scid_alias(org.ldk.structs.Option_u64Z val) {
210                 bindings.ChannelDetails_set_outbound_scid_alias(this.ptr, val.ptr);
211                 GC.KeepAlive(this);
212                 GC.KeepAlive(val);
213         }
214
215         /**
216          * An optional [`short_channel_id`] alias for this channel, randomly generated by our
217          * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
218          * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
219          * when they see a payment to be routed to us.
220          * 
221          * Our counterparty may choose to rotate this value at any time, though will always recognize
222          * previous values for inbound payment forwarding.
223          * 
224          * [`short_channel_id`]: Self::short_channel_id
225          */
226         public Option_u64Z get_inbound_scid_alias() {
227                 long ret = bindings.ChannelDetails_get_inbound_scid_alias(this.ptr);
228                 GC.KeepAlive(this);
229                 if (ret >= 0 && ret <= 4096) { return null; }
230                 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
231                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
232                 return ret_hu_conv;
233         }
234
235         /**
236          * An optional [`short_channel_id`] alias for this channel, randomly generated by our
237          * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
238          * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
239          * when they see a payment to be routed to us.
240          * 
241          * Our counterparty may choose to rotate this value at any time, though will always recognize
242          * previous values for inbound payment forwarding.
243          * 
244          * [`short_channel_id`]: Self::short_channel_id
245          */
246         public void set_inbound_scid_alias(org.ldk.structs.Option_u64Z val) {
247                 bindings.ChannelDetails_set_inbound_scid_alias(this.ptr, val.ptr);
248                 GC.KeepAlive(this);
249                 GC.KeepAlive(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         }
306
307         /**
308          * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
309          * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
310          * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
311          * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
312          * serialized with LDK versions prior to 0.0.113.
313          * 
314          * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
315          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
316          * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
317          */
318         public UInt128 get_user_channel_id() {
319                 long ret = bindings.ChannelDetails_get_user_channel_id(this.ptr);
320                 GC.KeepAlive(this);
321                 if (ret >= 0 && ret <= 4096) { return null; }
322                 org.ldk.util.UInt128 ret_conv = new org.ldk.util.UInt128(ret);
323                 return ret_conv;
324         }
325
326         /**
327          * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
328          * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
329          * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
330          * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
331          * serialized with LDK versions prior to 0.0.113.
332          * 
333          * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
334          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
335          * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
336          */
337         public void set_user_channel_id(org.ldk.util.UInt128 val) {
338                 bindings.ChannelDetails_set_user_channel_id(this.ptr, InternalUtils.encodeUint8Array(val.getLEBytes()));
339                 GC.KeepAlive(this);
340                 GC.KeepAlive(val);
341         }
342
343         /**
344          * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
345          * which is applied to commitment and HTLC transactions.
346          * 
347          * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
348          */
349         public Option_u32Z get_feerate_sat_per_1000_weight() {
350                 long ret = bindings.ChannelDetails_get_feerate_sat_per_1000_weight(this.ptr);
351                 GC.KeepAlive(this);
352                 if (ret >= 0 && ret <= 4096) { return null; }
353                 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
354                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
355                 return ret_hu_conv;
356         }
357
358         /**
359          * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
360          * which is applied to commitment and HTLC transactions.
361          * 
362          * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
363          */
364         public void set_feerate_sat_per_1000_weight(org.ldk.structs.Option_u32Z val) {
365                 bindings.ChannelDetails_set_feerate_sat_per_1000_weight(this.ptr, val.ptr);
366                 GC.KeepAlive(this);
367                 GC.KeepAlive(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         }
570
571         /**
572          * The current number of confirmations on the funding transaction.
573          * 
574          * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
575          */
576         public Option_u32Z get_confirmations() {
577                 long ret = bindings.ChannelDetails_get_confirmations(this.ptr);
578                 GC.KeepAlive(this);
579                 if (ret >= 0 && ret <= 4096) { return null; }
580                 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
581                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
582                 return ret_hu_conv;
583         }
584
585         /**
586          * The current number of confirmations on the funding transaction.
587          * 
588          * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
589          */
590         public void set_confirmations(org.ldk.structs.Option_u32Z val) {
591                 bindings.ChannelDetails_set_confirmations(this.ptr, val.ptr);
592                 GC.KeepAlive(this);
593                 GC.KeepAlive(val);
594         }
595
596         /**
597          * The number of blocks (after our commitment transaction confirms) that we will need to wait
598          * until we can claim our funds after we force-close the channel. During this time our
599          * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
600          * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
601          * time to claim our non-HTLC-encumbered funds.
602          * 
603          * This value will be `None` for outbound channels until the counterparty accepts the channel.
604          */
605         public Option_u16Z get_force_close_spend_delay() {
606                 long ret = bindings.ChannelDetails_get_force_close_spend_delay(this.ptr);
607                 GC.KeepAlive(this);
608                 if (ret >= 0 && ret <= 4096) { return null; }
609                 org.ldk.structs.Option_u16Z ret_hu_conv = org.ldk.structs.Option_u16Z.constr_from_ptr(ret);
610                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
611                 return ret_hu_conv;
612         }
613
614         /**
615          * The number of blocks (after our commitment transaction confirms) that we will need to wait
616          * until we can claim our funds after we force-close the channel. During this time our
617          * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
618          * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
619          * time to claim our non-HTLC-encumbered funds.
620          * 
621          * This value will be `None` for outbound channels until the counterparty accepts the channel.
622          */
623         public void set_force_close_spend_delay(org.ldk.structs.Option_u16Z val) {
624                 bindings.ChannelDetails_set_force_close_spend_delay(this.ptr, val.ptr);
625                 GC.KeepAlive(this);
626                 GC.KeepAlive(val);
627         }
628
629         /**
630          * True if the channel was initiated (and thus funded) by us.
631          */
632         public bool get_is_outbound() {
633                 bool ret = bindings.ChannelDetails_get_is_outbound(this.ptr);
634                 GC.KeepAlive(this);
635                 return ret;
636         }
637
638         /**
639          * True if the channel was initiated (and thus funded) by us.
640          */
641         public void set_is_outbound(bool val) {
642                 bindings.ChannelDetails_set_is_outbound(this.ptr, val);
643                 GC.KeepAlive(this);
644                 GC.KeepAlive(val);
645         }
646
647         /**
648          * True if the channel is confirmed, channel_ready messages have been exchanged, and the
649          * channel is not currently being shut down. `channel_ready` message exchange implies the
650          * required confirmation count has been reached (and we were connected to the peer at some
651          * point after the funding transaction received enough confirmations). The required
652          * confirmation count is provided in [`confirmations_required`].
653          * 
654          * [`confirmations_required`]: ChannelDetails::confirmations_required
655          */
656         public bool get_is_channel_ready() {
657                 bool ret = bindings.ChannelDetails_get_is_channel_ready(this.ptr);
658                 GC.KeepAlive(this);
659                 return ret;
660         }
661
662         /**
663          * True if the channel is confirmed, channel_ready messages have been exchanged, and the
664          * channel is not currently being shut down. `channel_ready` message exchange implies the
665          * required confirmation count has been reached (and we were connected to the peer at some
666          * point after the funding transaction received enough confirmations). The required
667          * confirmation count is provided in [`confirmations_required`].
668          * 
669          * [`confirmations_required`]: ChannelDetails::confirmations_required
670          */
671         public void set_is_channel_ready(bool val) {
672                 bindings.ChannelDetails_set_is_channel_ready(this.ptr, val);
673                 GC.KeepAlive(this);
674                 GC.KeepAlive(val);
675         }
676
677         /**
678          * The stage of the channel's shutdown.
679          * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
680          * 
681          * Returns a copy of the field.
682          */
683         public Option_ChannelShutdownStateZ get_channel_shutdown_state() {
684                 long ret = bindings.ChannelDetails_get_channel_shutdown_state(this.ptr);
685                 GC.KeepAlive(this);
686                 if (ret >= 0 && ret <= 4096) { return null; }
687                 org.ldk.structs.Option_ChannelShutdownStateZ ret_hu_conv = org.ldk.structs.Option_ChannelShutdownStateZ.constr_from_ptr(ret);
688                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
689                 return ret_hu_conv;
690         }
691
692         /**
693          * The stage of the channel's shutdown.
694          * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
695          */
696         public void set_channel_shutdown_state(org.ldk.structs.Option_ChannelShutdownStateZ val) {
697                 bindings.ChannelDetails_set_channel_shutdown_state(this.ptr, val.ptr);
698                 GC.KeepAlive(this);
699                 GC.KeepAlive(val);
700         }
701
702         /**
703          * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
704          * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
705          * 
706          * This is a strict superset of `is_channel_ready`.
707          */
708         public bool get_is_usable() {
709                 bool ret = bindings.ChannelDetails_get_is_usable(this.ptr);
710                 GC.KeepAlive(this);
711                 return ret;
712         }
713
714         /**
715          * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
716          * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
717          * 
718          * This is a strict superset of `is_channel_ready`.
719          */
720         public void set_is_usable(bool val) {
721                 bindings.ChannelDetails_set_is_usable(this.ptr, val);
722                 GC.KeepAlive(this);
723                 GC.KeepAlive(val);
724         }
725
726         /**
727          * True if this channel is (or will be) publicly-announced.
728          */
729         public bool get_is_announced() {
730                 bool ret = bindings.ChannelDetails_get_is_announced(this.ptr);
731                 GC.KeepAlive(this);
732                 return ret;
733         }
734
735         /**
736          * True if this channel is (or will be) publicly-announced.
737          */
738         public void set_is_announced(bool val) {
739                 bindings.ChannelDetails_set_is_announced(this.ptr, val);
740                 GC.KeepAlive(this);
741                 GC.KeepAlive(val);
742         }
743
744         /**
745          * The smallest value HTLC (in msat) we will accept, for this channel. This field
746          * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
747          */
748         public Option_u64Z get_inbound_htlc_minimum_msat() {
749                 long ret = bindings.ChannelDetails_get_inbound_htlc_minimum_msat(this.ptr);
750                 GC.KeepAlive(this);
751                 if (ret >= 0 && ret <= 4096) { return null; }
752                 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
753                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
754                 return ret_hu_conv;
755         }
756
757         /**
758          * The smallest value HTLC (in msat) we will accept, for this channel. This field
759          * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
760          */
761         public void set_inbound_htlc_minimum_msat(org.ldk.structs.Option_u64Z val) {
762                 bindings.ChannelDetails_set_inbound_htlc_minimum_msat(this.ptr, val.ptr);
763                 GC.KeepAlive(this);
764                 GC.KeepAlive(val);
765         }
766
767         /**
768          * The largest value HTLC (in msat) we currently will accept, for this channel.
769          */
770         public Option_u64Z get_inbound_htlc_maximum_msat() {
771                 long ret = bindings.ChannelDetails_get_inbound_htlc_maximum_msat(this.ptr);
772                 GC.KeepAlive(this);
773                 if (ret >= 0 && ret <= 4096) { return null; }
774                 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
775                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
776                 return ret_hu_conv;
777         }
778
779         /**
780          * The largest value HTLC (in msat) we currently will accept, for this channel.
781          */
782         public void set_inbound_htlc_maximum_msat(org.ldk.structs.Option_u64Z val) {
783                 bindings.ChannelDetails_set_inbound_htlc_maximum_msat(this.ptr, val.ptr);
784                 GC.KeepAlive(this);
785                 GC.KeepAlive(val);
786         }
787
788         /**
789          * Set of configurable parameters that affect channel operation.
790          * 
791          * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
792          * 
793          * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
794          */
795         public ChannelConfig get_config() {
796                 long ret = bindings.ChannelDetails_get_config(this.ptr);
797                 GC.KeepAlive(this);
798                 if (ret >= 0 && ret <= 4096) { return null; }
799                 org.ldk.structs.ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfig(null, ret); }
800                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
801                 return ret_hu_conv;
802         }
803
804         /**
805          * Set of configurable parameters that affect channel operation.
806          * 
807          * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
808          * 
809          * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
810          */
811         public void set_config(org.ldk.structs.ChannelConfig val) {
812                 bindings.ChannelDetails_set_config(this.ptr, val == null ? 0 : val.ptr);
813                 GC.KeepAlive(this);
814                 GC.KeepAlive(val);
815         }
816
817         /**
818          * Pending inbound HTLCs.
819          * 
820          * This field is empty for objects serialized with LDK versions prior to 0.0.122.
821          */
822         public InboundHTLCDetails[] get_pending_inbound_htlcs() {
823                 long ret = bindings.ChannelDetails_get_pending_inbound_htlcs(this.ptr);
824                 GC.KeepAlive(this);
825                 if (ret >= 0 && ret <= 4096) { return null; }
826                 int ret_conv_20_len = InternalUtils.getArrayLength(ret);
827                 InboundHTLCDetails[] ret_conv_20_arr = new InboundHTLCDetails[ret_conv_20_len];
828                 for (int u = 0; u < ret_conv_20_len; u++) {
829                         long ret_conv_20 = InternalUtils.getU64ArrayElem(ret, u);
830                         org.ldk.structs.InboundHTLCDetails ret_conv_20_hu_conv = null; if (ret_conv_20 < 0 || ret_conv_20 > 4096) { ret_conv_20_hu_conv = new org.ldk.structs.InboundHTLCDetails(null, ret_conv_20); }
831                         if (ret_conv_20_hu_conv != null) { ret_conv_20_hu_conv.ptrs_to.AddLast(this); };
832                         ret_conv_20_arr[u] = ret_conv_20_hu_conv;
833                 }
834                 bindings.free_buffer(ret);
835                 return ret_conv_20_arr;
836         }
837
838         /**
839          * Pending inbound HTLCs.
840          * 
841          * This field is empty for objects serialized with LDK versions prior to 0.0.122.
842          */
843         public void set_pending_inbound_htlcs(InboundHTLCDetails[] val) {
844                 bindings.ChannelDetails_set_pending_inbound_htlcs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_20 => val_conv_20.ptr)));
845                 GC.KeepAlive(this);
846                 GC.KeepAlive(val);
847         }
848
849         /**
850          * Pending outbound HTLCs.
851          * 
852          * This field is empty for objects serialized with LDK versions prior to 0.0.122.
853          */
854         public OutboundHTLCDetails[] get_pending_outbound_htlcs() {
855                 long ret = bindings.ChannelDetails_get_pending_outbound_htlcs(this.ptr);
856                 GC.KeepAlive(this);
857                 if (ret >= 0 && ret <= 4096) { return null; }
858                 int ret_conv_21_len = InternalUtils.getArrayLength(ret);
859                 OutboundHTLCDetails[] ret_conv_21_arr = new OutboundHTLCDetails[ret_conv_21_len];
860                 for (int v = 0; v < ret_conv_21_len; v++) {
861                         long ret_conv_21 = InternalUtils.getU64ArrayElem(ret, v);
862                         org.ldk.structs.OutboundHTLCDetails ret_conv_21_hu_conv = null; if (ret_conv_21 < 0 || ret_conv_21 > 4096) { ret_conv_21_hu_conv = new org.ldk.structs.OutboundHTLCDetails(null, ret_conv_21); }
863                         if (ret_conv_21_hu_conv != null) { ret_conv_21_hu_conv.ptrs_to.AddLast(this); };
864                         ret_conv_21_arr[v] = ret_conv_21_hu_conv;
865                 }
866                 bindings.free_buffer(ret);
867                 return ret_conv_21_arr;
868         }
869
870         /**
871          * Pending outbound HTLCs.
872          * 
873          * This field is empty for objects serialized with LDK versions prior to 0.0.122.
874          */
875         public void set_pending_outbound_htlcs(OutboundHTLCDetails[] val) {
876                 bindings.ChannelDetails_set_pending_outbound_htlcs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_21 => val_conv_21.ptr)));
877                 GC.KeepAlive(this);
878                 GC.KeepAlive(val);
879         }
880
881         /**
882          * Constructs a new ChannelDetails given each field
883          * 
884          * Note that funding_txo_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
885          * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
886          * Note that config_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
887          */
888         public static ChannelDetails of(org.ldk.structs.ChannelId 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_announced_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, InboundHTLCDetails[] pending_inbound_htlcs_arg, OutboundHTLCDetails[] pending_outbound_htlcs_arg) {
889                 long ret = bindings.ChannelDetails_new(channel_id_arg.ptr, 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, InternalUtils.encodeUint8Array(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_announced_arg, inbound_htlc_minimum_msat_arg.ptr, inbound_htlc_maximum_msat_arg.ptr, config_arg == null ? 0 : config_arg.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(pending_inbound_htlcs_arg, pending_inbound_htlcs_arg_conv_20 => pending_inbound_htlcs_arg_conv_20.ptr)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(pending_outbound_htlcs_arg, pending_outbound_htlcs_arg_conv_21 => pending_outbound_htlcs_arg_conv_21.ptr)));
890                 GC.KeepAlive(channel_id_arg);
891                 GC.KeepAlive(counterparty_arg);
892                 GC.KeepAlive(funding_txo_arg);
893                 GC.KeepAlive(channel_type_arg);
894                 GC.KeepAlive(short_channel_id_arg);
895                 GC.KeepAlive(outbound_scid_alias_arg);
896                 GC.KeepAlive(inbound_scid_alias_arg);
897                 GC.KeepAlive(channel_value_satoshis_arg);
898                 GC.KeepAlive(unspendable_punishment_reserve_arg);
899                 GC.KeepAlive(user_channel_id_arg);
900                 GC.KeepAlive(feerate_sat_per_1000_weight_arg);
901                 GC.KeepAlive(balance_msat_arg);
902                 GC.KeepAlive(outbound_capacity_msat_arg);
903                 GC.KeepAlive(next_outbound_htlc_limit_msat_arg);
904                 GC.KeepAlive(next_outbound_htlc_minimum_msat_arg);
905                 GC.KeepAlive(inbound_capacity_msat_arg);
906                 GC.KeepAlive(confirmations_required_arg);
907                 GC.KeepAlive(confirmations_arg);
908                 GC.KeepAlive(force_close_spend_delay_arg);
909                 GC.KeepAlive(is_outbound_arg);
910                 GC.KeepAlive(is_channel_ready_arg);
911                 GC.KeepAlive(channel_shutdown_state_arg);
912                 GC.KeepAlive(is_usable_arg);
913                 GC.KeepAlive(is_announced_arg);
914                 GC.KeepAlive(inbound_htlc_minimum_msat_arg);
915                 GC.KeepAlive(inbound_htlc_maximum_msat_arg);
916                 GC.KeepAlive(config_arg);
917                 GC.KeepAlive(pending_inbound_htlcs_arg);
918                 GC.KeepAlive(pending_outbound_htlcs_arg);
919                 if (ret >= 0 && ret <= 4096) { return null; }
920                 org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); }
921                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
922                 return ret_hu_conv;
923         }
924
925         internal long clone_ptr() {
926                 long ret = bindings.ChannelDetails_clone_ptr(this.ptr);
927                 GC.KeepAlive(this);
928                 return ret;
929         }
930
931         /**
932          * Creates a copy of the ChannelDetails
933          */
934         public ChannelDetails clone() {
935                 long ret = bindings.ChannelDetails_clone(this.ptr);
936                 GC.KeepAlive(this);
937                 if (ret >= 0 && ret <= 4096) { return null; }
938                 org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); }
939                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
940                 return ret_hu_conv;
941         }
942
943         /**
944          * Gets the current SCID which should be used to identify this channel for inbound payments.
945          * This should be used for providing invoice hints or in any other context where our
946          * counterparty will forward a payment to us.
947          * 
948          * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
949          * [`ChannelDetails::short_channel_id`]. See those for more information.
950          */
951         public Option_u64Z get_inbound_payment_scid() {
952                 long ret = bindings.ChannelDetails_get_inbound_payment_scid(this.ptr);
953                 GC.KeepAlive(this);
954                 if (ret >= 0 && ret <= 4096) { return null; }
955                 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
956                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
957                 return ret_hu_conv;
958         }
959
960         /**
961          * Gets the current SCID which should be used to identify this channel for outbound payments.
962          * This should be used in [`Route`]s to describe the first hop or in other contexts where
963          * we're sending or forwarding a payment outbound over this channel.
964          * 
965          * This is either the [`ChannelDetails::short_channel_id`], if set, or the
966          * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
967          * 
968          * [`Route`]: crate::routing::router::Route
969          */
970         public Option_u64Z get_outbound_payment_scid() {
971                 long ret = bindings.ChannelDetails_get_outbound_payment_scid(this.ptr);
972                 GC.KeepAlive(this);
973                 if (ret >= 0 && ret <= 4096) { return null; }
974                 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
975                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
976                 return ret_hu_conv;
977         }
978
979         /**
980          * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
981          */
982         public byte[] write() {
983                 long ret = bindings.ChannelDetails_write(this.ptr);
984                 GC.KeepAlive(this);
985                 if (ret >= 0 && ret <= 4096) { return null; }
986                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
987                 return ret_conv;
988         }
989
990         /**
991          * Read a ChannelDetails from a byte array, created by ChannelDetails_write
992          */
993         public static Result_ChannelDetailsDecodeErrorZ read(byte[] ser) {
994                 long ret = bindings.ChannelDetails_read(InternalUtils.encodeUint8Array(ser));
995                 GC.KeepAlive(ser);
996                 if (ret >= 0 && ret <= 4096) { return null; }
997                 Result_ChannelDetailsDecodeErrorZ ret_hu_conv = Result_ChannelDetailsDecodeErrorZ.constr_from_ptr(ret);
998                 return ret_hu_conv;
999         }
1000
1001 }
1002 } } }