Update auto-generated bindings to 0.0.103
[ldk-java] / src / main / java / org / ldk / structs / ChannelCounterparty.java
index 535c6a0ae152e29490f475b863e823e827959615..db770c86498631aafcb497caee8172a2fa2a11f7 100644 (file)
@@ -42,8 +42,8 @@ public class ChannelCounterparty extends CommonBase {
         */
        public InitFeatures get_features() {
                long ret = bindings.ChannelCounterparty_get_features(this.ptr);
-               if (ret < 1024) { return null; }
-               InitFeatures ret_hu_conv = new InitFeatures(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InitFeatures(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
@@ -55,7 +55,6 @@ public class ChannelCounterparty extends CommonBase {
         */
        public void set_features(InitFeatures val) {
                bindings.ChannelCounterparty_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
-               this.ptrs_to.add(val);
        }
 
        /**
@@ -85,13 +84,49 @@ public class ChannelCounterparty extends CommonBase {
                bindings.ChannelCounterparty_set_unspendable_punishment_reserve(this.ptr, val);
        }
 
+       /**
+        * Information on the fees and requirements that the counterparty requires when forwarding
+        * payments to us through this channel.
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+        */
+       @Nullable
+       public CounterpartyForwardingInfo get_forwarding_info() {
+               long ret = bindings.ChannelCounterparty_get_forwarding_info(this.ptr);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               CounterpartyForwardingInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CounterpartyForwardingInfo(null, ret); }
+               ret_hu_conv.ptrs_to.add(this);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Information on the fees and requirements that the counterparty requires when forwarding
+        * payments to us through this channel.
+        * 
+        * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+        */
+       public void set_forwarding_info(@Nullable CounterpartyForwardingInfo val) {
+               bindings.ChannelCounterparty_set_forwarding_info(this.ptr, val == null ? 0 : val.ptr & ~1);
+       }
+
+       /**
+        * Constructs a new ChannelCounterparty given each field
+        */
+       public static ChannelCounterparty of(byte[] node_id_arg, InitFeatures features_arg, long unspendable_punishment_reserve_arg, CounterpartyForwardingInfo forwarding_info_arg) {
+               long ret = bindings.ChannelCounterparty_new(node_id_arg, features_arg == null ? 0 : features_arg.ptr & ~1, unspendable_punishment_reserve_arg, forwarding_info_arg == null ? 0 : forwarding_info_arg.ptr & ~1);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelCounterparty(null, ret); }
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
        /**
         * Creates a copy of the ChannelCounterparty
         */
        public ChannelCounterparty clone() {
                long ret = bindings.ChannelCounterparty_clone(this.ptr);
-               if (ret < 1024) { return null; }
-               ChannelCounterparty ret_hu_conv = new ChannelCounterparty(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelCounterparty(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }