CSharp: fix LDKStr array decoding
[ldk-java] / c_sharp / src / org / ldk / structs / ChannelHandshakeConfig.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  * Configuration we set when applicable.
11  * 
12  * Default::default() provides sane defaults.
13  */
14 public class ChannelHandshakeConfig : CommonBase {
15         internal ChannelHandshakeConfig(object _dummy, long ptr) : base(ptr) { }
16         ~ChannelHandshakeConfig() {
17                 if (ptr != 0) { bindings.ChannelHandshakeConfig_free(ptr); }
18         }
19
20         /**
21          * Confirmations we will wait for before considering the channel locked in.
22          * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
23          * equivalent limit applied to outbound channels).
24          * 
25          * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
26          * transaction before operation. If you wish to accept channels with zero confirmations, see
27          * [`UserConfig::manually_accept_inbound_channels`] and
28          * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
29          * 
30          * Default value: 6.
31          * 
32          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
33          * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
34          */
35         public int get_minimum_depth() {
36                 int ret = bindings.ChannelHandshakeConfig_get_minimum_depth(this.ptr);
37                 GC.KeepAlive(this);
38                 return ret;
39         }
40
41         /**
42          * Confirmations we will wait for before considering the channel locked in.
43          * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
44          * equivalent limit applied to outbound channels).
45          * 
46          * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
47          * transaction before operation. If you wish to accept channels with zero confirmations, see
48          * [`UserConfig::manually_accept_inbound_channels`] and
49          * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
50          * 
51          * Default value: 6.
52          * 
53          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
54          * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
55          */
56         public void set_minimum_depth(int val) {
57                 bindings.ChannelHandshakeConfig_set_minimum_depth(this.ptr, val);
58                 GC.KeepAlive(this);
59                 GC.KeepAlive(val);
60         }
61
62         /**
63          * Set to the number of blocks we require our counterparty to wait to claim their money (ie
64          * the number of blocks we have to punish our counterparty if they broadcast a revoked
65          * transaction).
66          * 
67          * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
68          * be online to check for revoked transactions on-chain at least once every our_to_self_delay
69          * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
70          * possibly with time in between to RBF the spending transaction).
71          * 
72          * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
73          * case of an honest unilateral channel close, which implicitly decrease the economic value of
74          * our channel.
75          * 
76          * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
77          * can tweak config to ask for more security, not less.
78          */
79         public short get_our_to_self_delay() {
80                 short ret = bindings.ChannelHandshakeConfig_get_our_to_self_delay(this.ptr);
81                 GC.KeepAlive(this);
82                 return ret;
83         }
84
85         /**
86          * Set to the number of blocks we require our counterparty to wait to claim their money (ie
87          * the number of blocks we have to punish our counterparty if they broadcast a revoked
88          * transaction).
89          * 
90          * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
91          * be online to check for revoked transactions on-chain at least once every our_to_self_delay
92          * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
93          * possibly with time in between to RBF the spending transaction).
94          * 
95          * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
96          * case of an honest unilateral channel close, which implicitly decrease the economic value of
97          * our channel.
98          * 
99          * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
100          * can tweak config to ask for more security, not less.
101          */
102         public void set_our_to_self_delay(short val) {
103                 bindings.ChannelHandshakeConfig_set_our_to_self_delay(this.ptr, val);
104                 GC.KeepAlive(this);
105                 GC.KeepAlive(val);
106         }
107
108         /**
109          * Set to the smallest value HTLC we will accept to process.
110          * 
111          * This value is sent to our counterparty on channel-open and we close the channel any time
112          * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
113          * 
114          * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
115          * by the protocol.
116          */
117         public long get_our_htlc_minimum_msat() {
118                 long ret = bindings.ChannelHandshakeConfig_get_our_htlc_minimum_msat(this.ptr);
119                 GC.KeepAlive(this);
120                 return ret;
121         }
122
123         /**
124          * Set to the smallest value HTLC we will accept to process.
125          * 
126          * This value is sent to our counterparty on channel-open and we close the channel any time
127          * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
128          * 
129          * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
130          * by the protocol.
131          */
132         public void set_our_htlc_minimum_msat(long val) {
133                 bindings.ChannelHandshakeConfig_set_our_htlc_minimum_msat(this.ptr, val);
134                 GC.KeepAlive(this);
135                 GC.KeepAlive(val);
136         }
137
138         /**
139          * Sets the percentage of the channel value we will cap the total value of outstanding inbound
140          * HTLCs to.
141          * 
142          * This can be set to a value between 1-100, where the value corresponds to the percent of the
143          * channel value in whole percentages.
144          * 
145          * Note that:
146          * If configured to another value than the default value 10, any new channels created with
147          * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
148          * `ChannelManager`.
149          * 
150          * This caps the total value for inbound HTLCs in-flight only, and there's currently
151          * no way to configure the cap for the total value of outbound HTLCs in-flight.
152          * 
153          * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
154          * are different from the non-HTLC-encumbered funds. This makes this an important knob to
155          * restrict exposure to loss due to being offline for too long.
156          * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
157          * for more information.
158          * 
159          * Default value: 10.
160          * Minimum value: 1, any values less than 1 will be treated as 1 instead.
161          * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
162          */
163         public byte get_max_inbound_htlc_value_in_flight_percent_of_channel() {
164                 byte ret = bindings.ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(this.ptr);
165                 GC.KeepAlive(this);
166                 return ret;
167         }
168
169         /**
170          * Sets the percentage of the channel value we will cap the total value of outstanding inbound
171          * HTLCs to.
172          * 
173          * This can be set to a value between 1-100, where the value corresponds to the percent of the
174          * channel value in whole percentages.
175          * 
176          * Note that:
177          * If configured to another value than the default value 10, any new channels created with
178          * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
179          * `ChannelManager`.
180          * 
181          * This caps the total value for inbound HTLCs in-flight only, and there's currently
182          * no way to configure the cap for the total value of outbound HTLCs in-flight.
183          * 
184          * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
185          * are different from the non-HTLC-encumbered funds. This makes this an important knob to
186          * restrict exposure to loss due to being offline for too long.
187          * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
188          * for more information.
189          * 
190          * Default value: 10.
191          * Minimum value: 1, any values less than 1 will be treated as 1 instead.
192          * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
193          */
194         public void set_max_inbound_htlc_value_in_flight_percent_of_channel(byte val) {
195                 bindings.ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(this.ptr, val);
196                 GC.KeepAlive(this);
197                 GC.KeepAlive(val);
198         }
199
200         /**
201          * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
202          * BOLTs) option for outbound private channels. This provides better privacy by not including
203          * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
204          * relay HTLCs to us using the channel's SCID alias.
205          * 
206          * If this option is set, channels may be created that will not be readable by LDK versions
207          * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
208          * [`DecodeError::InvalidValue`].
209          * 
210          * Note that setting this to true does *not* prevent us from opening channels with
211          * counterparties that do not support the `scid_alias` option; we will simply fall back to a
212          * private channel without that option.
213          * 
214          * Ignored if the channel is negotiated to be announced, see
215          * [`ChannelHandshakeConfig::announced_channel`] and
216          * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
217          * 
218          * Default value: false. This value is likely to change to true in the future.
219          * 
220          * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
221          * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
222          */
223         public bool get_negotiate_scid_privacy() {
224                 bool ret = bindings.ChannelHandshakeConfig_get_negotiate_scid_privacy(this.ptr);
225                 GC.KeepAlive(this);
226                 return ret;
227         }
228
229         /**
230          * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
231          * BOLTs) option for outbound private channels. This provides better privacy by not including
232          * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
233          * relay HTLCs to us using the channel's SCID alias.
234          * 
235          * If this option is set, channels may be created that will not be readable by LDK versions
236          * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
237          * [`DecodeError::InvalidValue`].
238          * 
239          * Note that setting this to true does *not* prevent us from opening channels with
240          * counterparties that do not support the `scid_alias` option; we will simply fall back to a
241          * private channel without that option.
242          * 
243          * Ignored if the channel is negotiated to be announced, see
244          * [`ChannelHandshakeConfig::announced_channel`] and
245          * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
246          * 
247          * Default value: false. This value is likely to change to true in the future.
248          * 
249          * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
250          * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
251          */
252         public void set_negotiate_scid_privacy(bool val) {
253                 bindings.ChannelHandshakeConfig_set_negotiate_scid_privacy(this.ptr, val);
254                 GC.KeepAlive(this);
255                 GC.KeepAlive(val);
256         }
257
258         /**
259          * Set to announce the channel publicly and notify all nodes that they can route via this
260          * channel.
261          * 
262          * This should only be set to true for nodes which expect to be online reliably.
263          * 
264          * As the node which funds a channel picks this value this will only apply for new outbound
265          * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
266          * 
267          * Default value: false.
268          */
269         public bool get_announced_channel() {
270                 bool ret = bindings.ChannelHandshakeConfig_get_announced_channel(this.ptr);
271                 GC.KeepAlive(this);
272                 return ret;
273         }
274
275         /**
276          * Set to announce the channel publicly and notify all nodes that they can route via this
277          * channel.
278          * 
279          * This should only be set to true for nodes which expect to be online reliably.
280          * 
281          * As the node which funds a channel picks this value this will only apply for new outbound
282          * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
283          * 
284          * Default value: false.
285          */
286         public void set_announced_channel(bool val) {
287                 bindings.ChannelHandshakeConfig_set_announced_channel(this.ptr, val);
288                 GC.KeepAlive(this);
289                 GC.KeepAlive(val);
290         }
291
292         /**
293          * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
294          * supports it, they will then enforce the mutual-close output to us matches what we provided
295          * at intialization, preventing us from closing to an alternate pubkey.
296          * 
297          * This is set to true by default to provide a slight increase in security, though ultimately
298          * any attacker who is able to take control of a channel can just as easily send the funds via
299          * lightning payments, so we never require that our counterparties support this option.
300          * 
301          * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
302          * 
303          * Default value: true.
304          * 
305          * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
306          */
307         public bool get_commit_upfront_shutdown_pubkey() {
308                 bool ret = bindings.ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(this.ptr);
309                 GC.KeepAlive(this);
310                 return ret;
311         }
312
313         /**
314          * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
315          * supports it, they will then enforce the mutual-close output to us matches what we provided
316          * at intialization, preventing us from closing to an alternate pubkey.
317          * 
318          * This is set to true by default to provide a slight increase in security, though ultimately
319          * any attacker who is able to take control of a channel can just as easily send the funds via
320          * lightning payments, so we never require that our counterparties support this option.
321          * 
322          * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
323          * 
324          * Default value: true.
325          * 
326          * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
327          */
328         public void set_commit_upfront_shutdown_pubkey(bool val) {
329                 bindings.ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(this.ptr, val);
330                 GC.KeepAlive(this);
331                 GC.KeepAlive(val);
332         }
333
334         /**
335          * The Proportion of the channel value to configure as counterparty's channel reserve,
336          * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
337          * 
338          * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
339          * on their side, at all times.
340          * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
341          * claiming at least this value on chain.
342          * 
343          * Channel reserve values greater than 30% could be considered highly unreasonable, since that
344          * amount can never be used for payments.
345          * Also, if our selected channel reserve for counterparty and counterparty's selected
346          * channel reserve for us sum up to equal or greater than channel value, channel negotiations
347          * will fail.
348          * 
349          * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
350          * other than the default value.
351          * 
352          * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
353          * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
354          * as 1000 sats instead, which is a safe implementation-specific lower bound.
355          * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
356          * instead, although channel negotiations will fail in that case.
357          */
358         public int get_their_channel_reserve_proportional_millionths() {
359                 int ret = bindings.ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(this.ptr);
360                 GC.KeepAlive(this);
361                 return ret;
362         }
363
364         /**
365          * The Proportion of the channel value to configure as counterparty's channel reserve,
366          * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
367          * 
368          * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
369          * on their side, at all times.
370          * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
371          * claiming at least this value on chain.
372          * 
373          * Channel reserve values greater than 30% could be considered highly unreasonable, since that
374          * amount can never be used for payments.
375          * Also, if our selected channel reserve for counterparty and counterparty's selected
376          * channel reserve for us sum up to equal or greater than channel value, channel negotiations
377          * will fail.
378          * 
379          * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
380          * other than the default value.
381          * 
382          * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
383          * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
384          * as 1000 sats instead, which is a safe implementation-specific lower bound.
385          * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
386          * instead, although channel negotiations will fail in that case.
387          */
388         public void set_their_channel_reserve_proportional_millionths(int val) {
389                 bindings.ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(this.ptr, val);
390                 GC.KeepAlive(this);
391                 GC.KeepAlive(val);
392         }
393
394         /**
395          * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
396          * channels. This feature requires having a reserve of onchain funds readily available to bump
397          * transactions in the event of a channel force close to avoid the possibility of losing funds.
398          * 
399          * Note that if you wish accept inbound channels with anchor outputs, you must enable
400          * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
401          * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
402          * whether your reserve of onchain funds is enough to cover the fees for all existing and new
403          * channels featuring anchor outputs in the event of a force close.
404          * 
405          * If this option is set, channels may be created that will not be readable by LDK versions
406          * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
407          * [`DecodeError::InvalidValue`].
408          * 
409          * Note that setting this to true does *not* prevent us from opening channels with
410          * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
411          * fall back to a `static_remote_key` channel.
412          * 
413          * LDK will not support the legacy `option_anchors` commitment version due to a discovered
414          * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
415          * Considered Harmful`] mailing list post.
416          * 
417          * Default value: false. This value is likely to change to true in the future.
418          * 
419          * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
420          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
421          * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
422          * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
423          */
424         public bool get_negotiate_anchors_zero_fee_htlc_tx() {
425                 bool ret = bindings.ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(this.ptr);
426                 GC.KeepAlive(this);
427                 return ret;
428         }
429
430         /**
431          * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
432          * channels. This feature requires having a reserve of onchain funds readily available to bump
433          * transactions in the event of a channel force close to avoid the possibility of losing funds.
434          * 
435          * Note that if you wish accept inbound channels with anchor outputs, you must enable
436          * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
437          * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
438          * whether your reserve of onchain funds is enough to cover the fees for all existing and new
439          * channels featuring anchor outputs in the event of a force close.
440          * 
441          * If this option is set, channels may be created that will not be readable by LDK versions
442          * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
443          * [`DecodeError::InvalidValue`].
444          * 
445          * Note that setting this to true does *not* prevent us from opening channels with
446          * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
447          * fall back to a `static_remote_key` channel.
448          * 
449          * LDK will not support the legacy `option_anchors` commitment version due to a discovered
450          * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
451          * Considered Harmful`] mailing list post.
452          * 
453          * Default value: false. This value is likely to change to true in the future.
454          * 
455          * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
456          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
457          * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
458          * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
459          */
460         public void set_negotiate_anchors_zero_fee_htlc_tx(bool val) {
461                 bindings.ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(this.ptr, val);
462                 GC.KeepAlive(this);
463                 GC.KeepAlive(val);
464         }
465
466         /**
467          * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
468          * 
469          * Increasing the value can help improve liquidity and stability in
470          * routing at the cost of higher long term disk / DB usage.
471          * 
472          * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
473          * other than the default value.
474          * 
475          * Default value: 50
476          * Maximum value: 483, any values larger will be treated as 483.
477          * This is the BOLT #2 spec limit on `max_accepted_htlcs`.
478          */
479         public short get_our_max_accepted_htlcs() {
480                 short ret = bindings.ChannelHandshakeConfig_get_our_max_accepted_htlcs(this.ptr);
481                 GC.KeepAlive(this);
482                 return ret;
483         }
484
485         /**
486          * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
487          * 
488          * Increasing the value can help improve liquidity and stability in
489          * routing at the cost of higher long term disk / DB usage.
490          * 
491          * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
492          * other than the default value.
493          * 
494          * Default value: 50
495          * Maximum value: 483, any values larger will be treated as 483.
496          * This is the BOLT #2 spec limit on `max_accepted_htlcs`.
497          */
498         public void set_our_max_accepted_htlcs(short val) {
499                 bindings.ChannelHandshakeConfig_set_our_max_accepted_htlcs(this.ptr, val);
500                 GC.KeepAlive(this);
501                 GC.KeepAlive(val);
502         }
503
504         /**
505          * Constructs a new ChannelHandshakeConfig given each field
506          */
507         public static ChannelHandshakeConfig of(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg, byte max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool negotiate_scid_privacy_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg, int their_channel_reserve_proportional_millionths_arg, bool negotiate_anchors_zero_fee_htlc_tx_arg, short our_max_accepted_htlcs_arg) {
508                 long ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, their_channel_reserve_proportional_millionths_arg, negotiate_anchors_zero_fee_htlc_tx_arg, our_max_accepted_htlcs_arg);
509                 GC.KeepAlive(minimum_depth_arg);
510                 GC.KeepAlive(our_to_self_delay_arg);
511                 GC.KeepAlive(our_htlc_minimum_msat_arg);
512                 GC.KeepAlive(max_inbound_htlc_value_in_flight_percent_of_channel_arg);
513                 GC.KeepAlive(negotiate_scid_privacy_arg);
514                 GC.KeepAlive(announced_channel_arg);
515                 GC.KeepAlive(commit_upfront_shutdown_pubkey_arg);
516                 GC.KeepAlive(their_channel_reserve_proportional_millionths_arg);
517                 GC.KeepAlive(negotiate_anchors_zero_fee_htlc_tx_arg);
518                 GC.KeepAlive(our_max_accepted_htlcs_arg);
519                 if (ret >= 0 && ret <= 4096) { return null; }
520                 org.ldk.structs.ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelHandshakeConfig(null, ret); }
521                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
522                 return ret_hu_conv;
523         }
524
525         internal long clone_ptr() {
526                 long ret = bindings.ChannelHandshakeConfig_clone_ptr(this.ptr);
527                 GC.KeepAlive(this);
528                 return ret;
529         }
530
531         /**
532          * Creates a copy of the ChannelHandshakeConfig
533          */
534         public ChannelHandshakeConfig clone() {
535                 long ret = bindings.ChannelHandshakeConfig_clone(this.ptr);
536                 GC.KeepAlive(this);
537                 if (ret >= 0 && ret <= 4096) { return null; }
538                 org.ldk.structs.ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelHandshakeConfig(null, ret); }
539                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
540                 return ret_hu_conv;
541         }
542
543         /**
544          * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
545          */
546         public static ChannelHandshakeConfig with_default() {
547                 long ret = bindings.ChannelHandshakeConfig_default();
548                 if (ret >= 0 && ret <= 4096) { return null; }
549                 org.ldk.structs.ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelHandshakeConfig(null, ret); }
550                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
551                 return ret_hu_conv;
552         }
553
554 }
555 } } }