X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-java;a=blobdiff_plain;f=ts%2Fstructs%2FLightningError.mts;h=dd5f2ae5de74b2e16e83212d36c5382f12570085;hp=b06555d87e3eaee6d92d0ab8da4610627ddb3327;hb=c629a01650402c8e2f9b9db8ced9ed63ce687727;hpb=d1d0121c000b713c10fd0bedd249eb8dda2e4db7 diff --git a/ts/structs/LightningError.mts b/ts/structs/LightningError.mts index b06555d8..dd5f2ae5 100644 --- a/ts/structs/LightningError.mts +++ b/ts/structs/LightningError.mts @@ -281,22 +281,34 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An Err type for failure to process messages. + */ export class LightningError extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.LightningError_free); } + /** + * A human-readable message describing the error + */ public get_err(): string { const ret: number = bindings.LightningError_get_err(this.ptr); const ret_conv: string = bindings.decodeString(ret); return ret_conv; } + /** + * A human-readable message describing the error + */ public set_err(val: string): void { bindings.LightningError_set_err(this.ptr, bindings.encodeString(val)); } + /** + * The action which should be taken against the offending peer. + */ public get_action(): ErrorAction { const ret: number = bindings.LightningError_get_action(this.ptr); const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret); @@ -304,10 +316,16 @@ export class LightningError extends CommonBase { return ret_hu_conv; } + /** + * The action which should be taken against the offending peer. + */ public set_action(val: ErrorAction): void { bindings.LightningError_set_action(this.ptr, CommonBase.get_ptr_of(val)); } + /** + * Constructs a new LightningError given each field + */ public static constructor_new(err_arg: string, action_arg: ErrorAction): LightningError { const ret: number = bindings.LightningError_new(bindings.encodeString(err_arg), CommonBase.get_ptr_of(action_arg)); const ret_hu_conv: LightningError = new LightningError(null, ret); @@ -320,6 +338,9 @@ export class LightningError extends CommonBase { return ret; } + /** + * Creates a copy of the LightningError + */ public clone(): LightningError { const ret: number = bindings.LightningError_clone(this.ptr); const ret_hu_conv: LightningError = new LightningError(null, ret);