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