UNPKG

lightningdevkit

Version:
91 lines 3.33 kB
import { OutPoint } from '../structs/OutPoint.mjs'; import { LSPSDateTime } from '../structs/LSPSDateTime.mjs'; import { CommonBase } from './CommonBase.mjs'; import * as bindings from '../bindings.mjs'; /** * Details regarding the state of an ordered channel. */ export class LSPS1ChannelInfo extends CommonBase { /* @internal */ constructor(_dummy, ptr) { super(ptr, bindings.LSPS1ChannelInfo_free); } /** * The datetime when the funding transaction has been published. */ get_funded_at() { const ret = bindings.LSPS1ChannelInfo_get_funded_at(this.ptr); const ret_hu_conv = new LSPSDateTime(null, ret); CommonBase.add_ref_from(ret_hu_conv, this); return ret_hu_conv; } /** * The datetime when the funding transaction has been published. */ set_funded_at(val) { bindings.LSPS1ChannelInfo_set_funded_at(this.ptr, CommonBase.get_ptr_of(val)); } /** * The outpoint of the funding transaction. */ get_funding_outpoint() { const ret = bindings.LSPS1ChannelInfo_get_funding_outpoint(this.ptr); const ret_hu_conv = new OutPoint(null, ret); CommonBase.add_ref_from(ret_hu_conv, this); return ret_hu_conv; } /** * The outpoint of the funding transaction. */ set_funding_outpoint(val) { bindings.LSPS1ChannelInfo_set_funding_outpoint(this.ptr, CommonBase.get_ptr_of(val)); } /** * The earliest datetime when the channel may be closed by the LSP. */ get_expires_at() { const ret = bindings.LSPS1ChannelInfo_get_expires_at(this.ptr); const ret_hu_conv = new LSPSDateTime(null, ret); CommonBase.add_ref_from(ret_hu_conv, this); return ret_hu_conv; } /** * The earliest datetime when the channel may be closed by the LSP. */ set_expires_at(val) { bindings.LSPS1ChannelInfo_set_expires_at(this.ptr, CommonBase.get_ptr_of(val)); } /** * Constructs a new LSPS1ChannelInfo given each field */ static constructor_new(funded_at_arg, funding_outpoint_arg, expires_at_arg) { const ret = bindings.LSPS1ChannelInfo_new(CommonBase.get_ptr_of(funded_at_arg), CommonBase.get_ptr_of(funding_outpoint_arg), CommonBase.get_ptr_of(expires_at_arg)); const ret_hu_conv = new LSPS1ChannelInfo(null, ret); CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv); return ret_hu_conv; } clone_ptr() { const ret = bindings.LSPS1ChannelInfo_clone_ptr(this.ptr); return ret; } /** * Creates a copy of the LSPS1ChannelInfo */ clone() { const ret = bindings.LSPS1ChannelInfo_clone(this.ptr); const ret_hu_conv = new LSPS1ChannelInfo(null, ret); CommonBase.add_ref_from(ret_hu_conv, this); return ret_hu_conv; } /** * Checks if two LSPS1ChannelInfos 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.LSPS1ChannelInfo_eq(this.ptr, CommonBase.get_ptr_of(b)); CommonBase.add_ref_from(this, b); return ret; } } //# sourceMappingURL=LSPS1ChannelInfo.mjs.map