UNPKG

lightningdevkit

Version:
73 lines 3.72 kB
import { Option_u64Z } from '../structs/Option_u64Z.mjs'; import { Option_u32Z } from '../structs/Option_u32Z.mjs'; import { Option_u16Z } from '../structs/Option_u16Z.mjs'; import { Option_MaxDustHTLCExposureZ } from '../structs/Option_MaxDustHTLCExposureZ.mjs'; import { CommonBase } from './CommonBase.mjs'; import * as bindings from '../bindings.mjs'; /** * A parallel struct to [`ChannelConfig`] to define partial updates. */ export class ChannelConfigUpdate extends CommonBase { /* @internal */ constructor(_dummy, ptr) { super(ptr, bindings.ChannelConfigUpdate_free); } get_forwarding_fee_proportional_millionths() { const ret = bindings.ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(this.ptr); const ret_hu_conv = Option_u32Z.constr_from_ptr(ret); CommonBase.add_ref_from(ret_hu_conv, this); return ret_hu_conv; } set_forwarding_fee_proportional_millionths(val) { bindings.ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(this.ptr, CommonBase.get_ptr_of(val)); } get_forwarding_fee_base_msat() { const ret = bindings.ChannelConfigUpdate_get_forwarding_fee_base_msat(this.ptr); const ret_hu_conv = Option_u32Z.constr_from_ptr(ret); CommonBase.add_ref_from(ret_hu_conv, this); return ret_hu_conv; } set_forwarding_fee_base_msat(val) { bindings.ChannelConfigUpdate_set_forwarding_fee_base_msat(this.ptr, CommonBase.get_ptr_of(val)); } get_cltv_expiry_delta() { const ret = bindings.ChannelConfigUpdate_get_cltv_expiry_delta(this.ptr); const ret_hu_conv = Option_u16Z.constr_from_ptr(ret); CommonBase.add_ref_from(ret_hu_conv, this); return ret_hu_conv; } set_cltv_expiry_delta(val) { bindings.ChannelConfigUpdate_set_cltv_expiry_delta(this.ptr, CommonBase.get_ptr_of(val)); } /** * Returns a copy of the field. */ get_max_dust_htlc_exposure_msat() { const ret = bindings.ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(this.ptr); const ret_hu_conv = Option_MaxDustHTLCExposureZ.constr_from_ptr(ret); CommonBase.add_ref_from(ret_hu_conv, this); return ret_hu_conv; } set_max_dust_htlc_exposure_msat(val) { bindings.ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(this.ptr, CommonBase.get_ptr_of(val)); } get_force_close_avoidance_max_fee_satoshis() { const ret = bindings.ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(this.ptr); const ret_hu_conv = Option_u64Z.constr_from_ptr(ret); CommonBase.add_ref_from(ret_hu_conv, this); return ret_hu_conv; } set_force_close_avoidance_max_fee_satoshis(val) { bindings.ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(this.ptr, CommonBase.get_ptr_of(val)); } /** * Constructs a new ChannelConfigUpdate given each field */ static constructor_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, max_dust_htlc_exposure_msat_arg, force_close_avoidance_max_fee_satoshis_arg) { const ret = bindings.ChannelConfigUpdate_new(CommonBase.get_ptr_of(forwarding_fee_proportional_millionths_arg), CommonBase.get_ptr_of(forwarding_fee_base_msat_arg), CommonBase.get_ptr_of(cltv_expiry_delta_arg), CommonBase.get_ptr_of(max_dust_htlc_exposure_msat_arg), CommonBase.get_ptr_of(force_close_avoidance_max_fee_satoshis_arg)); const ret_hu_conv = new ChannelConfigUpdate(null, ret); CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv); return ret_hu_conv; } } //# sourceMappingURL=ChannelConfigUpdate.mjs.map