UNPKG

lightningdevkit

Version:
70 lines 2.61 kB
import { BlindedPaymentPath } from '../structs/BlindedPaymentPath.mjs'; import { CommonBase } from './CommonBase.mjs'; import * as bindings from '../bindings.mjs'; export class Result_BlindedPaymentPathNoneZ extends CommonBase { constructor(_dummy, ptr) { super(ptr, bindings.CResult_BlindedPaymentPathNoneZ_free); } /* @internal */ static constr_from_ptr(ptr) { if (bindings.CResult_BlindedPaymentPathNoneZ_is_ok(ptr)) { return new Result_BlindedPaymentPathNoneZ_OK(null, ptr); } else { return new Result_BlindedPaymentPathNoneZ_Err(null, ptr); } } /** * Creates a new CResult_BlindedPaymentPathNoneZ in the success state. */ static constructor_ok(o) { const ret = bindings.CResult_BlindedPaymentPathNoneZ_ok(CommonBase.get_ptr_of(o)); const ret_hu_conv = Result_BlindedPaymentPathNoneZ.constr_from_ptr(ret); return ret_hu_conv; } /** * Creates a new CResult_BlindedPaymentPathNoneZ in the error state. */ static constructor_err() { const ret = bindings.CResult_BlindedPaymentPathNoneZ_err(); const ret_hu_conv = Result_BlindedPaymentPathNoneZ.constr_from_ptr(ret); return ret_hu_conv; } /** * Checks if the given object is currently in the success state */ is_ok() { const ret = bindings.CResult_BlindedPaymentPathNoneZ_is_ok(this.ptr); return ret; } clone_ptr() { const ret = bindings.CResult_BlindedPaymentPathNoneZ_clone_ptr(this.ptr); return ret; } /** * Creates a new CResult_BlindedPaymentPathNoneZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. */ clone() { const ret = bindings.CResult_BlindedPaymentPathNoneZ_clone(this.ptr); const ret_hu_conv = Result_BlindedPaymentPathNoneZ.constr_from_ptr(ret); return ret_hu_conv; } } export class Result_BlindedPaymentPathNoneZ_OK extends Result_BlindedPaymentPathNoneZ { /* @internal */ constructor(_dummy, ptr) { super(_dummy, ptr); const res = bindings.CResult_BlindedPaymentPathNoneZ_get_ok(ptr); const res_hu_conv = new BlindedPaymentPath(null, res); CommonBase.add_ref_from(res_hu_conv, this); this.res = res_hu_conv; } } export class Result_BlindedPaymentPathNoneZ_Err extends Result_BlindedPaymentPathNoneZ { /* @internal */ constructor(_dummy, ptr) { super(_dummy, ptr); } } //# sourceMappingURL=Result_BlindedPaymentPathNoneZ.mjs.map