import * as bindings from '../bindings.mjs'
+/**
+ * Features used within an invoice.
+ */
export class InvoiceFeatures extends CommonBase {
/* @internal */
public constructor(_dummy: object, ptr: number) {
super(ptr, bindings.InvoiceFeatures_free);
}
+ /**
+ * Checks if two InvoiceFeaturess 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.
+ */
public eq(b: InvoiceFeatures): boolean {
const ret: boolean = bindings.InvoiceFeatures_eq(this.ptr, b == null ? 0 : CommonBase.get_ptr_of(b) & ~1);
CommonBase.add_ref_from(this, b);
return ret;
}
+ /**
+ * Creates a copy of the InvoiceFeatures
+ */
public clone(): InvoiceFeatures {
const ret: number = bindings.InvoiceFeatures_clone(this.ptr);
const ret_hu_conv: InvoiceFeatures = new InvoiceFeatures(null, ret);
return ret_hu_conv;
}
+ /**
+ * Create a blank Features with no features set
+ */
public static constructor_empty(): InvoiceFeatures {
const ret: number = bindings.InvoiceFeatures_empty();
const ret_hu_conv: InvoiceFeatures = new InvoiceFeatures(null, ret);
return ret_hu_conv;
}
+ /**
+ * Creates a Features with the bits set which are known by the implementation
+ */
public static constructor_known(): InvoiceFeatures {
const ret: number = bindings.InvoiceFeatures_known();
const ret_hu_conv: InvoiceFeatures = new InvoiceFeatures(null, ret);
return ret_hu_conv;
}
+ /**
+ * Returns true if this `Features` object contains unknown feature flags which are set as
+ * \"required\".
+ */
public requires_unknown_bits(): boolean {
const ret: boolean = bindings.InvoiceFeatures_requires_unknown_bits(this.ptr);
return ret;
}
+ /**
+ * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
+ */
public write(): Uint8Array {
const ret: number = bindings.InvoiceFeatures_write(this.ptr);
const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
return ret_conv;
}
+ /**
+ * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
+ */
public static constructor_read(ser: Uint8Array): Result_InvoiceFeaturesDecodeErrorZ {
const ret: number = bindings.InvoiceFeatures_read(bindings.encodeUint8Array(ser));
const ret_hu_conv: Result_InvoiceFeaturesDecodeErrorZ = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret);