Re-generate auto-generated bindings + add Mac OS generated bindings
[ldk-java] / src / main / java / org / ldk / structs / ChannelConfig.java
index f465f6cf27f82684a6fc9f536f1268c5c6cfc5e4..2056615cc6df1487e9f65a3f1b9f153ce3779c6c 100644 (file)
@@ -42,6 +42,57 @@ public class ChannelConfig extends CommonBase {
                bindings.ChannelConfig_set_fee_proportional_millionths(this.ptr, val);
        }
 
+       /**
+        * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
+        * the channel this config applies to.
+        * 
+        * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
+        * HTLC balance when a channel appears on-chain whereas
+        * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
+        * (non-HTLC-encumbered) balance.
+        * 
+        * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
+        * we (or one of our watchtowers) MUST be online to check for broadcast of the current
+        * commitment transaction at least once per this many blocks (minus some margin to allow us
+        * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
+        * the spending transaction).
+        * 
+        * Default value: 72 (12 hours at an average of 6 blocks/hour).
+        * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
+        * [`MIN_CLTV_EXPIRY_DELTA`] instead.
+        * 
+        * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
+        */
+       public short get_cltv_expiry_delta() {
+               short ret = bindings.ChannelConfig_get_cltv_expiry_delta(this.ptr);
+               return ret;
+       }
+
+       /**
+        * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
+        * the channel this config applies to.
+        * 
+        * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
+        * HTLC balance when a channel appears on-chain whereas
+        * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
+        * (non-HTLC-encumbered) balance.
+        * 
+        * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
+        * we (or one of our watchtowers) MUST be online to check for broadcast of the current
+        * commitment transaction at least once per this many blocks (minus some margin to allow us
+        * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
+        * the spending transaction).
+        * 
+        * Default value: 72 (12 hours at an average of 6 blocks/hour).
+        * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
+        * [`MIN_CLTV_EXPIRY_DELTA`] instead.
+        * 
+        * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
+        */
+       public void set_cltv_expiry_delta(short val) {
+               bindings.ChannelConfig_set_cltv_expiry_delta(this.ptr, val);
+       }
+
        /**
         * Set to announce the channel publicly and notify all nodes that they can route via this
         * channel.
@@ -115,8 +166,8 @@ public class ChannelConfig extends CommonBase {
        /**
         * Constructs a new ChannelConfig given each field
         */
-       public static ChannelConfig constructor_new(int fee_proportional_millionths_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg) {
-               long ret = bindings.ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
+       public static ChannelConfig of(int fee_proportional_millionths_arg, short cltv_expiry_delta_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg) {
+               long ret = bindings.ChannelConfig_new(fee_proportional_millionths_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
                ChannelConfig ret_hu_conv = new ChannelConfig(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -133,9 +184,9 @@ public class ChannelConfig extends CommonBase {
        }
 
        /**
-        * Creates a "default" ChannelConfig. See other documentaiton for details on what this implies.
+        * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
         */
-       public static ChannelConfig constructor_default() {
+       public static ChannelConfig with_default() {
                long ret = bindings.ChannelConfig_default();
                ChannelConfig ret_hu_conv = new ChannelConfig(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
@@ -153,7 +204,7 @@ public class ChannelConfig extends CommonBase {
        /**
         * Read a ChannelConfig from a byte array, created by ChannelConfig_write
         */
-       public static Result_ChannelConfigDecodeErrorZ constructor_read(byte[] ser) {
+       public static Result_ChannelConfigDecodeErrorZ read(byte[] ser) {
                long ret = bindings.ChannelConfig_read(ser);
                Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;