lightningdevkit
Version:
Lightning Development Kit
44 lines • 1.55 kB
JavaScript
import { CommonBase } from './CommonBase.mjs';
import * as bindings from '../bindings.mjs';
/**
* Errors that indicate what is wrong with the invoice. They have some granularity for debug
* reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
*/
export class Bolt11ParseError extends CommonBase {
/* @internal */
constructor(_dummy, ptr) {
super(ptr, bindings.Bolt11ParseError_free);
}
/**
* Checks if two Bolt11ParseErrors 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.Bolt11ParseError_eq(this.ptr, CommonBase.get_ptr_of(b));
CommonBase.add_ref_from(this, b);
return ret;
}
clone_ptr() {
const ret = bindings.Bolt11ParseError_clone_ptr(this.ptr);
return ret;
}
/**
* Creates a copy of the Bolt11ParseError
*/
clone() {
const ret = bindings.Bolt11ParseError_clone(this.ptr);
const ret_hu_conv = new Bolt11ParseError(null, ret);
CommonBase.add_ref_from(ret_hu_conv, this);
return ret_hu_conv;
}
/**
* Get the string representation of a Bolt11ParseError object
*/
to_str() {
const ret = bindings.Bolt11ParseError_to_str(this.ptr);
const ret_conv = bindings.decodeString(ret);
return ret_conv;
}
}
//# sourceMappingURL=Bolt11ParseError.mjs.map