[C#] Update auto-generated files
[ldk-java] / c_sharp / src / org / ldk / structs / ChannelDetails.cs
index eb84c835f3a3e259c75567a67ff48f720d304816..b806226b8a4fff17e599da3d8f7e59310e452ceb 100644 (file)
@@ -7,7 +7,7 @@ namespace org { namespace ldk { namespace structs {
 
 
 /**
- * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
+ * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`]
  */
 public class ChannelDetails : CommonBase {
        internal ChannelDetails(object _dummy, long ptr) : base(ptr) { }
@@ -170,6 +170,7 @@ public class ChannelDetails : CommonBase {
                bindings.ChannelDetails_set_short_channel_id(this.ptr, val.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(val);
+               if (this != null) { this.ptrs_to.AddLast(val); };
        }
 
        /**
@@ -207,6 +208,7 @@ public class ChannelDetails : CommonBase {
                bindings.ChannelDetails_set_outbound_scid_alias(this.ptr, val.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(val);
+               if (this != null) { this.ptrs_to.AddLast(val); };
        }
 
        /**
@@ -244,6 +246,7 @@ public class ChannelDetails : CommonBase {
                bindings.ChannelDetails_set_inbound_scid_alias(this.ptr, val.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(val);
+               if (this != null) { this.ptrs_to.AddLast(val); };
        }
 
        /**
@@ -299,6 +302,7 @@ public class ChannelDetails : CommonBase {
                bindings.ChannelDetails_set_unspendable_punishment_reserve(this.ptr, val.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(val);
+               if (this != null) { this.ptrs_to.AddLast(val); };
        }
 
        /**
@@ -324,6 +328,34 @@ public class ChannelDetails : CommonBase {
                GC.KeepAlive(val);
        }
 
+       /**
+        * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
+        * which is applied to commitment and HTLC transactions.
+        * 
+        * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
+        */
+       public Option_u32Z get_feerate_sat_per_1000_weight() {
+               long ret = bindings.ChannelDetails_get_feerate_sat_per_1000_weight(this.ptr);
+               GC.KeepAlive(this);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
+        * which is applied to commitment and HTLC transactions.
+        * 
+        * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
+        */
+       public void set_feerate_sat_per_1000_weight(org.ldk.structs.Option_u32Z val) {
+               bindings.ChannelDetails_set_feerate_sat_per_1000_weight(this.ptr, val.ptr);
+               GC.KeepAlive(this);
+               GC.KeepAlive(val);
+               if (this != null) { this.ptrs_to.AddLast(val); };
+       }
+
        /**
         * Our total balance.  This is the amount we would get if we close the channel.
         * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
@@ -402,7 +434,8 @@ public class ChannelDetails : CommonBase {
         * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
         * to use a limit as close as possible to the HTLC limit we can currently send.
         * 
-        * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
+        * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
+        * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
         */
        public long get_next_outbound_htlc_limit_msat() {
                long ret = bindings.ChannelDetails_get_next_outbound_htlc_limit_msat(this.ptr);
@@ -416,7 +449,8 @@ public class ChannelDetails : CommonBase {
         * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
         * to use a limit as close as possible to the HTLC limit we can currently send.
         * 
-        * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
+        * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
+        * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
         */
        public void set_next_outbound_htlc_limit_msat(long val) {
                bindings.ChannelDetails_set_next_outbound_htlc_limit_msat(this.ptr, val);
@@ -424,6 +458,30 @@ public class ChannelDetails : CommonBase {
                GC.KeepAlive(val);
        }
 
+       /**
+        * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
+        * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
+        * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
+        * route which is valid.
+        */
+       public long get_next_outbound_htlc_minimum_msat() {
+               long ret = bindings.ChannelDetails_get_next_outbound_htlc_minimum_msat(this.ptr);
+               GC.KeepAlive(this);
+               return ret;
+       }
+
+       /**
+        * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
+        * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
+        * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
+        * route which is valid.
+        */
+       public void set_next_outbound_htlc_minimum_msat(long val) {
+               bindings.ChannelDetails_set_next_outbound_htlc_minimum_msat(this.ptr, val);
+               GC.KeepAlive(this);
+               GC.KeepAlive(val);
+       }
+
        /**
         * The available inbound capacity for the remote peer to send HTLCs to us. This does not
         * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
@@ -497,6 +555,7 @@ public class ChannelDetails : CommonBase {
                bindings.ChannelDetails_set_confirmations_required(this.ptr, val.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(val);
+               if (this != null) { this.ptrs_to.AddLast(val); };
        }
 
        /**
@@ -522,6 +581,7 @@ public class ChannelDetails : CommonBase {
                bindings.ChannelDetails_set_confirmations(this.ptr, val.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(val);
+               if (this != null) { this.ptrs_to.AddLast(val); };
        }
 
        /**
@@ -555,6 +615,7 @@ public class ChannelDetails : CommonBase {
                bindings.ChannelDetails_set_force_close_spend_delay(this.ptr, val.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(val);
+               if (this != null) { this.ptrs_to.AddLast(val); };
        }
 
        /**
@@ -605,6 +666,32 @@ public class ChannelDetails : CommonBase {
                GC.KeepAlive(val);
        }
 
+       /**
+        * The stage of the channel's shutdown.
+        * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
+        * 
+        * Returns a copy of the field.
+        */
+       public Option_ChannelShutdownStateZ get_channel_shutdown_state() {
+               long ret = bindings.ChannelDetails_get_channel_shutdown_state(this.ptr);
+               GC.KeepAlive(this);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.Option_ChannelShutdownStateZ ret_hu_conv = org.ldk.structs.Option_ChannelShutdownStateZ.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
+               return ret_hu_conv;
+       }
+
+       /**
+        * The stage of the channel's shutdown.
+        * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
+        */
+       public void set_channel_shutdown_state(org.ldk.structs.Option_ChannelShutdownStateZ val) {
+               bindings.ChannelDetails_set_channel_shutdown_state(this.ptr, val.ptr);
+               GC.KeepAlive(this);
+               GC.KeepAlive(val);
+               if (this != null) { this.ptrs_to.AddLast(val); };
+       }
+
        /**
         * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
         * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
@@ -668,6 +755,7 @@ public class ChannelDetails : CommonBase {
                bindings.ChannelDetails_set_inbound_htlc_minimum_msat(this.ptr, val.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(val);
+               if (this != null) { this.ptrs_to.AddLast(val); };
        }
 
        /**
@@ -689,6 +777,7 @@ public class ChannelDetails : CommonBase {
                bindings.ChannelDetails_set_inbound_htlc_maximum_msat(this.ptr, val.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(val);
+               if (this != null) { this.ptrs_to.AddLast(val); };
        }
 
        /**
@@ -724,8 +813,8 @@ public class ChannelDetails : CommonBase {
        /**
         * Constructs a new ChannelDetails given each field
         */
-       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, long balance_msat_arg, long outbound_capacity_msat_arg, long next_outbound_htlc_limit_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, 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) {
-               long ret = bindings.ChannelDetails_new(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, user_channel_id_arg.getLEBytes(), balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_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, 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);
+       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) {
+               long ret = bindings.ChannelDetails_new(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, 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);
                GC.KeepAlive(channel_id_arg);
                GC.KeepAlive(counterparty_arg);
                GC.KeepAlive(funding_txo_arg);
@@ -736,15 +825,18 @@ public class ChannelDetails : CommonBase {
                GC.KeepAlive(channel_value_satoshis_arg);
                GC.KeepAlive(unspendable_punishment_reserve_arg);
                GC.KeepAlive(user_channel_id_arg);
+               GC.KeepAlive(feerate_sat_per_1000_weight_arg);
                GC.KeepAlive(balance_msat_arg);
                GC.KeepAlive(outbound_capacity_msat_arg);
                GC.KeepAlive(next_outbound_htlc_limit_msat_arg);
+               GC.KeepAlive(next_outbound_htlc_minimum_msat_arg);
                GC.KeepAlive(inbound_capacity_msat_arg);
                GC.KeepAlive(confirmations_required_arg);
                GC.KeepAlive(confirmations_arg);
                GC.KeepAlive(force_close_spend_delay_arg);
                GC.KeepAlive(is_outbound_arg);
                GC.KeepAlive(is_channel_ready_arg);
+               GC.KeepAlive(channel_shutdown_state_arg);
                GC.KeepAlive(is_usable_arg);
                GC.KeepAlive(is_public_arg);
                GC.KeepAlive(inbound_htlc_minimum_msat_arg);
@@ -756,6 +848,17 @@ public class ChannelDetails : CommonBase {
                if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(counterparty_arg); };
                if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_txo_arg); };
                if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type_arg); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(short_channel_id_arg); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outbound_scid_alias_arg); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(inbound_scid_alias_arg); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(unspendable_punishment_reserve_arg); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(feerate_sat_per_1000_weight_arg); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(confirmations_required_arg); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(confirmations_arg); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(force_close_spend_delay_arg); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_shutdown_state_arg); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(inbound_htlc_minimum_msat_arg); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(inbound_htlc_maximum_msat_arg); };
                if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(config_arg); };
                return ret_hu_conv;
        }