Merge pull request #33 from TheBlueMatt/main
[ldk-java] / ts / structs / ErrorAction.ts
index 25bf0917d9c2ca34b92e7db45c14cb5fc43bf485..6bcb77499dfaf3d3632eb4fc3d18b337a7e75660 100644 (file)
@@ -16,6 +16,9 @@ export default class ErrorAction extends CommonBase {
                if (raw_val instanceof bindings.LDKErrorAction.IgnoreError) {
                        return new IgnoreError(this.ptr, raw_val);
                }
+               if (raw_val instanceof bindings.LDKErrorAction.IgnoreAndLog) {
+                       return new IgnoreAndLog(this.ptr, raw_val);
+               }
                if (raw_val instanceof bindings.LDKErrorAction.SendErrorMessage) {
                        return new SendErrorMessage(this.ptr, raw_val);
                }
@@ -38,6 +41,13 @@ export class IgnoreError extends ErrorAction {
                super(null, ptr);
        }
 }
+export class IgnoreAndLog extends ErrorAction {
+       public ignore_and_log: Level;
+       private constructor(ptr: number, obj: bindings.LDKErrorAction.IgnoreAndLog) {
+               super(null, ptr);
+               this.ignore_and_log = obj.ignore_and_log;
+       }
+}
 export class SendErrorMessage extends ErrorAction {
        public msg: ErrorMessage;
        private constructor(ptr: number, obj: bindings.LDKErrorAction.SendErrorMessage) {
@@ -55,4 +65,34 @@ export class SendErrorMessage extends ErrorAction {
                return ret_hu_conv;
        }
 
+       public static ErrorAction constructor_disconnect_peer(ErrorMessage msg) {
+               number ret = bindings.ErrorAction_disconnect_peer(msg == null ? 0 : msg.ptr & ~1);
+               ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       public static ErrorAction constructor_ignore_error() {
+               number ret = bindings.ErrorAction_ignore_error();
+               ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static ErrorAction constructor_ignore_and_log(Level a) {
+               number ret = bindings.ErrorAction_ignore_and_log(a);
+               ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static ErrorAction constructor_send_error_message(ErrorMessage msg) {
+               number ret = bindings.ErrorAction_send_error_message(msg == null ? 0 : msg.ptr & ~1);
+               ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
 }