[Java] Update auto-generated Java bindings for 0.0.108
[ldk-java] / src / main / java / org / ldk / structs / ChannelHandshakeConfig.java
index 8f9fb17b34b3de5b8107e2fec8fa3bcfe1da4d9b..cea0ccc54fe02fa8f76462796e13c0a4ac7bb429 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import java.lang.ref.Reference;
 import javax.annotation.Nullable;
 
 
@@ -26,10 +27,19 @@ public class ChannelHandshakeConfig extends CommonBase {
         * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
         * equivalent limit applied to outbound channels).
         * 
+        * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
+        * transaction before operation. If you wish to accept channels with zero confirmations, see
+        * [`UserConfig::manually_accept_inbound_channels`] and
+        * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
+        * 
         * Default value: 6.
+        * 
+        * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+        * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
         */
        public int get_minimum_depth() {
                int ret = bindings.ChannelHandshakeConfig_get_minimum_depth(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
@@ -38,10 +48,20 @@ public class ChannelHandshakeConfig extends CommonBase {
         * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
         * equivalent limit applied to outbound channels).
         * 
+        * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
+        * transaction before operation. If you wish to accept channels with zero confirmations, see
+        * [`UserConfig::manually_accept_inbound_channels`] and
+        * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
+        * 
         * Default value: 6.
+        * 
+        * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+        * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
         */
        public void set_minimum_depth(int val) {
                bindings.ChannelHandshakeConfig_set_minimum_depth(this.ptr, val);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
@@ -63,6 +83,7 @@ public class ChannelHandshakeConfig extends CommonBase {
         */
        public short get_our_to_self_delay() {
                short ret = bindings.ChannelHandshakeConfig_get_our_to_self_delay(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
@@ -85,6 +106,8 @@ public class ChannelHandshakeConfig extends CommonBase {
         */
        public void set_our_to_self_delay(short val) {
                bindings.ChannelHandshakeConfig_set_our_to_self_delay(this.ptr, val);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
@@ -98,6 +121,7 @@ public class ChannelHandshakeConfig extends CommonBase {
         */
        public long get_our_htlc_minimum_msat() {
                long ret = bindings.ChannelHandshakeConfig_get_our_htlc_minimum_msat(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
@@ -112,26 +136,160 @@ public class ChannelHandshakeConfig extends CommonBase {
         */
        public void set_our_htlc_minimum_msat(long val) {
                bindings.ChannelHandshakeConfig_set_our_htlc_minimum_msat(this.ptr, val);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
+       }
+
+       /**
+        * Sets the percentage of the channel value we will cap the total value of outstanding inbound
+        * HTLCs to.
+        * 
+        * This can be set to a value between 1-100, where the value corresponds to the percent of the
+        * channel value in whole percentages.
+        * 
+        * Note that:
+        * If configured to another value than the default value 10, any new channels created with
+        * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
+        * `ChannelManager`.
+        * 
+        * This caps the total value for inbound HTLCs in-flight only, and there's currently
+        * no way to configure the cap for the total value of outbound HTLCs in-flight.
+        * 
+        * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
+        * are different from the non-HTLC-encumbered funds. This makes this an important knob to
+        * restrict exposure to loss due to being offline for too long.
+        * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
+        * for more information.
+        * 
+        * Default value: 10.
+        * Minimum value: 1, any values less than 1 will be treated as 1 instead.
+        * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
+        */
+       public byte get_max_inbound_htlc_value_in_flight_percent_of_channel() {
+               byte ret = bindings.ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
+       /**
+        * Sets the percentage of the channel value we will cap the total value of outstanding inbound
+        * HTLCs to.
+        * 
+        * This can be set to a value between 1-100, where the value corresponds to the percent of the
+        * channel value in whole percentages.
+        * 
+        * Note that:
+        * If configured to another value than the default value 10, any new channels created with
+        * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
+        * `ChannelManager`.
+        * 
+        * This caps the total value for inbound HTLCs in-flight only, and there's currently
+        * no way to configure the cap for the total value of outbound HTLCs in-flight.
+        * 
+        * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
+        * are different from the non-HTLC-encumbered funds. This makes this an important knob to
+        * restrict exposure to loss due to being offline for too long.
+        * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
+        * for more information.
+        * 
+        * Default value: 10.
+        * Minimum value: 1, any values less than 1 will be treated as 1 instead.
+        * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
+        */
+       public void set_max_inbound_htlc_value_in_flight_percent_of_channel(byte val) {
+               bindings.ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(this.ptr, val);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
+       }
+
+       /**
+        * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
+        * BOLTs) option for outbound private channels. This provides better privacy by not including
+        * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
+        * relay HTLCs to us using the channel's SCID alias.
+        * 
+        * If this option is set, channels may be created that will not be readable by LDK versions
+        * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
+        * [`DecodeError:InvalidValue`].
+        * 
+        * Note that setting this to true does *not* prevent us from opening channels with
+        * counterparties that do not support the `scid_alias` option; we will simply fall back to a
+        * private channel without that option.
+        * 
+        * Ignored if the channel is negotiated to be announced, see
+        * [`ChannelConfig::announced_channel`] and
+        * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
+        * 
+        * Default value: false. This value is likely to change to true in the future.
+        * 
+        * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+        * [`DecodeError:InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
+        */
+       public boolean get_negotiate_scid_privacy() {
+               boolean ret = bindings.ChannelHandshakeConfig_get_negotiate_scid_privacy(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
+       /**
+        * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
+        * BOLTs) option for outbound private channels. This provides better privacy by not including
+        * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
+        * relay HTLCs to us using the channel's SCID alias.
+        * 
+        * If this option is set, channels may be created that will not be readable by LDK versions
+        * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
+        * [`DecodeError:InvalidValue`].
+        * 
+        * Note that setting this to true does *not* prevent us from opening channels with
+        * counterparties that do not support the `scid_alias` option; we will simply fall back to a
+        * private channel without that option.
+        * 
+        * Ignored if the channel is negotiated to be announced, see
+        * [`ChannelConfig::announced_channel`] and
+        * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
+        * 
+        * Default value: false. This value is likely to change to true in the future.
+        * 
+        * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+        * [`DecodeError:InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
+        */
+       public void set_negotiate_scid_privacy(boolean val) {
+               bindings.ChannelHandshakeConfig_set_negotiate_scid_privacy(this.ptr, val);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
         * Constructs a new ChannelHandshakeConfig given each field
         */
-       public static ChannelHandshakeConfig of(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg) {
-               long ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg);
-               if (ret >= 0 && ret < 1024) { return null; }
-               ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret);
+       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, boolean negotiate_scid_privacy_arg) {
+               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);
+               Reference.reachabilityFence(minimum_depth_arg);
+               Reference.reachabilityFence(our_to_self_delay_arg);
+               Reference.reachabilityFence(our_htlc_minimum_msat_arg);
+               Reference.reachabilityFence(max_inbound_htlc_value_in_flight_percent_of_channel_arg);
+               Reference.reachabilityFence(negotiate_scid_privacy_arg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelHandshakeConfig(null, ret); }
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }
 
+       long clone_ptr() {
+               long ret = bindings.ChannelHandshakeConfig_clone_ptr(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
        /**
         * Creates a copy of the ChannelHandshakeConfig
         */
        public ChannelHandshakeConfig clone() {
                long ret = bindings.ChannelHandshakeConfig_clone(this.ptr);
-               if (ret >= 0 && ret < 1024) { return null; }
-               ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret);
+               Reference.reachabilityFence(this);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelHandshakeConfig(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
@@ -141,8 +299,8 @@ public class ChannelHandshakeConfig extends CommonBase {
         */
        public static ChannelHandshakeConfig with_default() {
                long ret = bindings.ChannelHandshakeConfig_default();
-               if (ret >= 0 && ret < 1024) { return null; }
-               ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelHandshakeConfig(null, ret); }
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }