[Java] Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / APIError.java
index e2613fd9e6a343a7655a5e40dcb0414d095f1d35..f226ddccf13c4468e851ce4b6143c5a3aa30f15d 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;
 
 
@@ -42,21 +43,30 @@ public class APIError extends CommonBase {
                assert false; return null; // Unreachable without extending the (internal) bindings interface
        }
 
+       /**
+        * Indicates the API was wholly misused (see err for more). Cases where these can be returned
+        * are documented, but generally indicates some precondition of a function was violated.
+        */
        public final static class APIMisuseError extends APIError {
                /**
                 * A human-readable error message
                */
-               public final String err;
+               public final java.lang.String err;
                private APIMisuseError(long ptr, bindings.LDKAPIError.APIMisuseError obj) {
                        super(null, ptr);
                        this.err = obj.err;
                }
        }
+       /**
+        * Due to a high feerate, we were unable to complete the request.
+        * For example, this may be returned if the feerate implies we cannot open a channel at the
+        * requested value, but opening a larger channel would succeed.
+        */
        public final static class FeeRateTooHigh extends APIError {
                /**
                 * A human-readable error message
                */
-               public final String err;
+               public final java.lang.String err;
                /**
                 * The feerate which was too high.
                */
@@ -67,36 +77,59 @@ public class APIError extends CommonBase {
                        this.feerate = obj.feerate;
                }
        }
+       /**
+        * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
+        * too-many-hops, etc).
+        */
        public final static class RouteError extends APIError {
                /**
                 * A human-readable error message
                */
-               public final String err;
+               public final java.lang.String err;
                private RouteError(long ptr, bindings.LDKAPIError.RouteError obj) {
                        super(null, ptr);
                        this.err = obj.err;
                }
        }
+       /**
+        * We were unable to complete the request as the Channel required to do so is unable to
+        * complete the request (or was not found). This can take many forms, including disconnected
+        * peer, channel at capacity, channel shutting down, etc.
+        */
        public final static class ChannelUnavailable extends APIError {
                /**
                 * A human-readable error message
                */
-               public final String err;
+               public final java.lang.String err;
                private ChannelUnavailable(long ptr, bindings.LDKAPIError.ChannelUnavailable obj) {
                        super(null, ptr);
                        this.err = obj.err;
                }
        }
+       /**
+        * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
+        * attempted action to fail.
+        */
        public final static class MonitorUpdateFailed extends APIError {
                private MonitorUpdateFailed(long ptr, bindings.LDKAPIError.MonitorUpdateFailed obj) {
                        super(null, ptr);
                }
        }
+       /**
+        * [`KeysInterface::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
+        * with the channel counterparty as negotiated in [`InitFeatures`].
+        * 
+        * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
+        * a channel or cooperatively close one with this peer (and will have to force-close instead).
+        * 
+        * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
+        * [`InitFeatures`]: crate::ln::features::InitFeatures
+        */
        public final static class IncompatibleShutdownScript extends APIError {
                /**
                 * The incompatible shutdown script.
                */
-               public final ShutdownScript script;
+               public final org.ldk.structs.ShutdownScript script;
                private IncompatibleShutdownScript(long ptr, bindings.LDKAPIError.IncompatibleShutdownScript obj) {
                        super(null, ptr);
                        long script = obj.script;
@@ -105,13 +138,20 @@ public class APIError extends CommonBase {
                        this.script = script_hu_conv;
                }
        }
+       long clone_ptr() {
+               long ret = bindings.APIError_clone_ptr(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
        /**
         * Creates a copy of the APIError
         */
        public APIError clone() {
                long ret = bindings.APIError_clone(this.ptr);
+               Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
-               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
@@ -121,8 +161,9 @@ public class APIError extends CommonBase {
         */
        public static APIError apimisuse_error(java.lang.String err) {
                long ret = bindings.APIError_apimisuse_error(err);
+               Reference.reachabilityFence(err);
                if (ret >= 0 && ret <= 4096) { return null; }
-               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }
@@ -132,8 +173,10 @@ public class APIError extends CommonBase {
         */
        public static APIError fee_rate_too_high(java.lang.String err, int feerate) {
                long ret = bindings.APIError_fee_rate_too_high(err, feerate);
+               Reference.reachabilityFence(err);
+               Reference.reachabilityFence(feerate);
                if (ret >= 0 && ret <= 4096) { return null; }
-               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }
@@ -143,8 +186,9 @@ public class APIError extends CommonBase {
         */
        public static APIError route_error(java.lang.String err) {
                long ret = bindings.APIError_route_error(err);
+               Reference.reachabilityFence(err);
                if (ret >= 0 && ret <= 4096) { return null; }
-               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }
@@ -154,8 +198,9 @@ public class APIError extends CommonBase {
         */
        public static APIError channel_unavailable(java.lang.String err) {
                long ret = bindings.APIError_channel_unavailable(err);
+               Reference.reachabilityFence(err);
                if (ret >= 0 && ret <= 4096) { return null; }
-               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }
@@ -166,7 +211,7 @@ public class APIError extends CommonBase {
        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);
+               org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }
@@ -176,8 +221,9 @@ public class APIError extends CommonBase {
         */
        public static APIError incompatible_shutdown_script(ShutdownScript script) {
                long ret = bindings.APIError_incompatible_shutdown_script(script == null ? 0 : script.ptr & ~1);
+               Reference.reachabilityFence(script);
                if (ret >= 0 && ret <= 4096) { return null; }
-               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }