+ /**
+ * [`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;
+ 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;
+ }
+ }
+ long clone_ptr() {
+ long ret = bindings.APIError_clone_ptr(this.ptr);
+ return ret;
+ }
+
+ /**
+ * 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;
+ }
+