Update auto-generated bindings to 0.0.103
[ldk-java] / src / main / java / org / ldk / structs / APIError.java
index 6e760fbb16ddcd51a0ca4747a6340a2b1e422dbe..e2613fd9e6a343a7655a5e40dcb0414d095f1d35 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -35,18 +36,30 @@ public class APIError extends CommonBase {
                if (raw_val.getClass() == bindings.LDKAPIError.MonitorUpdateFailed.class) {
                        return new MonitorUpdateFailed(ptr, (bindings.LDKAPIError.MonitorUpdateFailed)raw_val);
                }
+               if (raw_val.getClass() == bindings.LDKAPIError.IncompatibleShutdownScript.class) {
+                       return new IncompatibleShutdownScript(ptr, (bindings.LDKAPIError.IncompatibleShutdownScript)raw_val);
+               }
                assert false; return null; // Unreachable without extending the (internal) bindings interface
        }
 
        public final static class APIMisuseError extends APIError {
-               public final byte[] err;
+               /**
+                * A human-readable error message
+               */
+               public final String err;
                private APIMisuseError(long ptr, bindings.LDKAPIError.APIMisuseError obj) {
                        super(null, ptr);
                        this.err = obj.err;
                }
        }
        public final static class FeeRateTooHigh extends APIError {
-               public final byte[] err;
+               /**
+                * A human-readable error message
+               */
+               public final String err;
+               /**
+                * The feerate which was too high.
+               */
                public final int feerate;
                private FeeRateTooHigh(long ptr, bindings.LDKAPIError.FeeRateTooHigh obj) {
                        super(null, ptr);
@@ -55,6 +68,9 @@ public class APIError extends CommonBase {
                }
        }
        public final static class RouteError extends APIError {
+               /**
+                * A human-readable error message
+               */
                public final String err;
                private RouteError(long ptr, bindings.LDKAPIError.RouteError obj) {
                        super(null, ptr);
@@ -62,7 +78,10 @@ public class APIError extends CommonBase {
                }
        }
        public final static class ChannelUnavailable extends APIError {
-               public final byte[] err;
+               /**
+                * A human-readable error message
+               */
+               public final String err;
                private ChannelUnavailable(long ptr, bindings.LDKAPIError.ChannelUnavailable obj) {
                        super(null, ptr);
                        this.err = obj.err;
@@ -73,4 +92,94 @@ public class APIError extends CommonBase {
                        super(null, ptr);
                }
        }
+       public final static class IncompatibleShutdownScript extends APIError {
+               /**
+                * The incompatible shutdown script.
+               */
+               public final ShutdownScript script;
+               private IncompatibleShutdownScript(long ptr, bindings.LDKAPIError.IncompatibleShutdownScript obj) {
+                       super(null, ptr);
+                       long script = obj.script;
+                       ShutdownScript script_hu_conv = null; if (script < 0 || script > 4096) { script_hu_conv = new ShutdownScript(null, script); }
+                       script_hu_conv.ptrs_to.add(this);
+                       this.script = script_hu_conv;
+               }
+       }
+       /**
+        * Creates a copy of the APIError
+        */
+       public APIError clone() {
+               long ret = bindings.APIError_clone(this.ptr);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(this);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new APIMisuseError-variant APIError
+        */
+       public static APIError apimisuse_error(java.lang.String err) {
+               long ret = bindings.APIError_apimisuse_error(err);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new FeeRateTooHigh-variant APIError
+        */
+       public static APIError fee_rate_too_high(java.lang.String err, int feerate) {
+               long ret = bindings.APIError_fee_rate_too_high(err, feerate);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new RouteError-variant APIError
+        */
+       public static APIError route_error(java.lang.String err) {
+               long ret = bindings.APIError_route_error(err);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new ChannelUnavailable-variant APIError
+        */
+       public static APIError channel_unavailable(java.lang.String err) {
+               long ret = bindings.APIError_channel_unavailable(err);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new MonitorUpdateFailed-variant APIError
+        */
+       public static APIError monitor_update_failed() {
+               long ret = bindings.APIError_monitor_update_failed();
+               if (ret >= 0 && ret <= 4096) { return null; }
+               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
+        */
+       public static APIError incompatible_shutdown_script(ShutdownScript script) {
+               long ret = bindings.APIError_incompatible_shutdown_script(script == null ? 0 : script.ptr & ~1);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
 }