lightningdevkit
Version:
Lightning Development Kit
118 lines • 4.69 kB
JavaScript
import { LSPSDateTime } from '../structs/LSPSDateTime.mjs';
import { CommonBase } from './CommonBase.mjs';
import * as bindings from '../bindings.mjs';
/**
* Fees and parameters for a JIT Channel without the promise.
*
* The promise will be calculated automatically for the LSP and this type converted
* into an [`LSPS2OpeningFeeParams`] for transit over the wire.
*/
export class LSPS2RawOpeningFeeParams extends CommonBase {
/* @internal */
constructor(_dummy, ptr) {
super(ptr, bindings.LSPS2RawOpeningFeeParams_free);
}
/**
* The minimum fee required for the channel open.
*/
get_min_fee_msat() {
const ret = bindings.LSPS2RawOpeningFeeParams_get_min_fee_msat(this.ptr);
return ret;
}
/**
* The minimum fee required for the channel open.
*/
set_min_fee_msat(val) {
bindings.LSPS2RawOpeningFeeParams_set_min_fee_msat(this.ptr, val);
}
/**
* A fee proportional to the size of the initial payment.
*/
get_proportional() {
const ret = bindings.LSPS2RawOpeningFeeParams_get_proportional(this.ptr);
return ret;
}
/**
* A fee proportional to the size of the initial payment.
*/
set_proportional(val) {
bindings.LSPS2RawOpeningFeeParams_set_proportional(this.ptr, val);
}
/**
* An [`ISO8601`](https://www.iso.org/iso-8601-date-and-time-format.html) formatted date for which these params are valid.
*/
get_valid_until() {
const ret = bindings.LSPS2RawOpeningFeeParams_get_valid_until(this.ptr);
const ret_hu_conv = new LSPSDateTime(null, ret);
CommonBase.add_ref_from(ret_hu_conv, this);
return ret_hu_conv;
}
/**
* An [`ISO8601`](https://www.iso.org/iso-8601-date-and-time-format.html) formatted date for which these params are valid.
*/
set_valid_until(val) {
bindings.LSPS2RawOpeningFeeParams_set_valid_until(this.ptr, CommonBase.get_ptr_of(val));
}
/**
* The number of blocks after confirmation that the LSP promises it will keep the channel alive without closing.
*/
get_min_lifetime() {
const ret = bindings.LSPS2RawOpeningFeeParams_get_min_lifetime(this.ptr);
return ret;
}
/**
* The number of blocks after confirmation that the LSP promises it will keep the channel alive without closing.
*/
set_min_lifetime(val) {
bindings.LSPS2RawOpeningFeeParams_set_min_lifetime(this.ptr, val);
}
/**
* The maximum number of blocks that the client is allowed to set its `to_self_delay` parameter.
*/
get_max_client_to_self_delay() {
const ret = bindings.LSPS2RawOpeningFeeParams_get_max_client_to_self_delay(this.ptr);
return ret;
}
/**
* The maximum number of blocks that the client is allowed to set its `to_self_delay` parameter.
*/
set_max_client_to_self_delay(val) {
bindings.LSPS2RawOpeningFeeParams_set_max_client_to_self_delay(this.ptr, val);
}
/**
* The minimum payment size that the LSP will accept when opening a channel.
*/
get_min_payment_size_msat() {
const ret = bindings.LSPS2RawOpeningFeeParams_get_min_payment_size_msat(this.ptr);
return ret;
}
/**
* The minimum payment size that the LSP will accept when opening a channel.
*/
set_min_payment_size_msat(val) {
bindings.LSPS2RawOpeningFeeParams_set_min_payment_size_msat(this.ptr, val);
}
/**
* The maximum payment size that the LSP will accept when opening a channel.
*/
get_max_payment_size_msat() {
const ret = bindings.LSPS2RawOpeningFeeParams_get_max_payment_size_msat(this.ptr);
return ret;
}
/**
* The maximum payment size that the LSP will accept when opening a channel.
*/
set_max_payment_size_msat(val) {
bindings.LSPS2RawOpeningFeeParams_set_max_payment_size_msat(this.ptr, val);
}
/**
* Constructs a new LSPS2RawOpeningFeeParams given each field
*/
static constructor_new(min_fee_msat_arg, proportional_arg, valid_until_arg, min_lifetime_arg, max_client_to_self_delay_arg, min_payment_size_msat_arg, max_payment_size_msat_arg) {
const ret = bindings.LSPS2RawOpeningFeeParams_new(min_fee_msat_arg, proportional_arg, CommonBase.get_ptr_of(valid_until_arg), min_lifetime_arg, max_client_to_self_delay_arg, min_payment_size_msat_arg, max_payment_size_msat_arg);
const ret_hu_conv = new LSPS2RawOpeningFeeParams(null, ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
return ret_hu_conv;
}
}
//# sourceMappingURL=LSPS2RawOpeningFeeParams.mjs.map