UNPKG

lightningdevkit

Version:
144 lines 5.47 kB
import { Option_StrZ } from '../structs/Option_StrZ.mjs'; import { CommonBase } from './CommonBase.mjs'; import * as bindings from '../bindings.mjs'; /** * An object representing an bLIP-51 / LSPS1 channel order. */ export class LSPS1OrderParams extends CommonBase { /* @internal */ constructor(_dummy, ptr) { super(ptr, bindings.LSPS1OrderParams_free); } /** * Indicates how many satoshi the LSP will provide on their side. */ get_lsp_balance_sat() { const ret = bindings.LSPS1OrderParams_get_lsp_balance_sat(this.ptr); return ret; } /** * Indicates how many satoshi the LSP will provide on their side. */ set_lsp_balance_sat(val) { bindings.LSPS1OrderParams_set_lsp_balance_sat(this.ptr, val); } /** * Indicates how many satoshi the client will provide on their side. * * The client sends these funds to the LSP, who will push them back to the client upon opening * the channel. */ get_client_balance_sat() { const ret = bindings.LSPS1OrderParams_get_client_balance_sat(this.ptr); return ret; } /** * Indicates how many satoshi the client will provide on their side. * * The client sends these funds to the LSP, who will push them back to the client upon opening * the channel. */ set_client_balance_sat(val) { bindings.LSPS1OrderParams_set_client_balance_sat(this.ptr, val); } /** * The number of confirmations the funding tx must have before the LSP sends `channel_ready`. */ get_required_channel_confirmations() { const ret = bindings.LSPS1OrderParams_get_required_channel_confirmations(this.ptr); return ret; } /** * The number of confirmations the funding tx must have before the LSP sends `channel_ready`. */ set_required_channel_confirmations(val) { bindings.LSPS1OrderParams_set_required_channel_confirmations(this.ptr, val); } /** * The maximum number of blocks the client wants to wait until the funding transaction is confirmed. */ get_funding_confirms_within_blocks() { const ret = bindings.LSPS1OrderParams_get_funding_confirms_within_blocks(this.ptr); return ret; } /** * The maximum number of blocks the client wants to wait until the funding transaction is confirmed. */ set_funding_confirms_within_blocks(val) { bindings.LSPS1OrderParams_set_funding_confirms_within_blocks(this.ptr, val); } /** * Indicates how long the channel is leased for in block time. */ get_channel_expiry_blocks() { const ret = bindings.LSPS1OrderParams_get_channel_expiry_blocks(this.ptr); return ret; } /** * Indicates how long the channel is leased for in block time. */ set_channel_expiry_blocks(val) { bindings.LSPS1OrderParams_set_channel_expiry_blocks(this.ptr, val); } /** * May contain arbitrary associated data like a coupon code or a authentication token. */ get_token() { const ret = bindings.LSPS1OrderParams_get_token(this.ptr); const ret_hu_conv = Option_StrZ.constr_from_ptr(ret); CommonBase.add_ref_from(ret_hu_conv, this); return ret_hu_conv; } /** * May contain arbitrary associated data like a coupon code or a authentication token. */ set_token(val) { bindings.LSPS1OrderParams_set_token(this.ptr, CommonBase.get_ptr_of(val)); } /** * Indicates if the channel should be announced to the network. */ get_announce_channel() { const ret = bindings.LSPS1OrderParams_get_announce_channel(this.ptr); return ret; } /** * Indicates if the channel should be announced to the network. */ set_announce_channel(val) { bindings.LSPS1OrderParams_set_announce_channel(this.ptr, val); } /** * Constructs a new LSPS1OrderParams given each field */ static constructor_new(lsp_balance_sat_arg, client_balance_sat_arg, required_channel_confirmations_arg, funding_confirms_within_blocks_arg, channel_expiry_blocks_arg, token_arg, announce_channel_arg) { const ret = bindings.LSPS1OrderParams_new(lsp_balance_sat_arg, client_balance_sat_arg, required_channel_confirmations_arg, funding_confirms_within_blocks_arg, channel_expiry_blocks_arg, CommonBase.get_ptr_of(token_arg), announce_channel_arg); const ret_hu_conv = new LSPS1OrderParams(null, ret); CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv); return ret_hu_conv; } clone_ptr() { const ret = bindings.LSPS1OrderParams_clone_ptr(this.ptr); return ret; } /** * Creates a copy of the LSPS1OrderParams */ clone() { const ret = bindings.LSPS1OrderParams_clone(this.ptr); const ret_hu_conv = new LSPS1OrderParams(null, ret); CommonBase.add_ref_from(ret_hu_conv, this); return ret_hu_conv; } /** * Checks if two LSPS1OrderParamss 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.LSPS1OrderParams_eq(this.ptr, CommonBase.get_ptr_of(b)); CommonBase.add_ref_from(this, b); return ret; } } //# sourceMappingURL=LSPS1OrderParams.mjs.map