lightningdevkit
Version:
Lightning Development Kit
68 lines • 2.37 kB
JavaScript
import { Option_StrZ } from '../structs/Option_StrZ.mjs';
import { CommonBase } from './CommonBase.mjs';
import * as bindings from '../bindings.mjs';
/**
* An error returned in response to an JSON-RPC request.
*
* Please refer to the [JSON-RPC 2.0 specification](https://www.jsonrpc.org/specification#error_object) for
* more information.
*/
export class LSPSResponseError extends CommonBase {
/* @internal */
constructor(_dummy, ptr) {
super(ptr, bindings.LSPSResponseError_free);
}
/**
* A string providing a short description of the error.
*/
get_message() {
const ret = bindings.LSPSResponseError_get_message(this.ptr);
const ret_conv = bindings.decodeString(ret);
return ret_conv;
}
/**
* A string providing a short description of the error.
*/
set_message(val) {
bindings.LSPSResponseError_set_message(this.ptr, bindings.encodeString(val));
}
/**
* A primitive or structured value that contains additional information about the error.
*/
get_data() {
const ret = bindings.LSPSResponseError_get_data(this.ptr);
const ret_hu_conv = Option_StrZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, this);
return ret_hu_conv;
}
/**
* A primitive or structured value that contains additional information about the error.
*/
set_data(val) {
bindings.LSPSResponseError_set_data(this.ptr, CommonBase.get_ptr_of(val));
}
clone_ptr() {
const ret = bindings.LSPSResponseError_clone_ptr(this.ptr);
return ret;
}
/**
* Creates a copy of the LSPSResponseError
*/
clone() {
const ret = bindings.LSPSResponseError_clone(this.ptr);
const ret_hu_conv = new LSPSResponseError(null, ret);
CommonBase.add_ref_from(ret_hu_conv, this);
return ret_hu_conv;
}
/**
* Checks if two LSPSResponseErrors contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
* Two objects with NULL inner values will be considered "equal" here.
*/
eq(b) {
const ret = bindings.LSPSResponseError_eq(this.ptr, CommonBase.get_ptr_of(b));
CommonBase.add_ref_from(this, b);
return ret;
}
}
//# sourceMappingURL=LSPSResponseError.mjs.map