6 namespace org { namespace ldk { namespace structs {
10 * A parallel struct to [`ChannelConfig`] to define partial updates.
12 public class ChannelConfigUpdate : CommonBase {
13 internal ChannelConfigUpdate(object _dummy, long ptr) : base(ptr) { }
14 ~ChannelConfigUpdate() {
15 if (ptr != 0) { bindings.ChannelConfigUpdate_free(ptr); }
18 public Option_u32Z get_forwarding_fee_proportional_millionths() {
19 long ret = bindings.ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(this.ptr);
21 if (ret >= 0 && ret <= 4096) { return null; }
22 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
23 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
27 public void set_forwarding_fee_proportional_millionths(org.ldk.structs.Option_u32Z val) {
28 bindings.ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(this.ptr, val.ptr);
31 if (this != null) { this.ptrs_to.AddLast(val); };
34 public Option_u32Z get_forwarding_fee_base_msat() {
35 long ret = bindings.ChannelConfigUpdate_get_forwarding_fee_base_msat(this.ptr);
37 if (ret >= 0 && ret <= 4096) { return null; }
38 org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret);
39 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
43 public void set_forwarding_fee_base_msat(org.ldk.structs.Option_u32Z val) {
44 bindings.ChannelConfigUpdate_set_forwarding_fee_base_msat(this.ptr, val.ptr);
47 if (this != null) { this.ptrs_to.AddLast(val); };
50 public Option_u16Z get_cltv_expiry_delta() {
51 long ret = bindings.ChannelConfigUpdate_get_cltv_expiry_delta(this.ptr);
53 if (ret >= 0 && ret <= 4096) { return null; }
54 org.ldk.structs.Option_u16Z ret_hu_conv = org.ldk.structs.Option_u16Z.constr_from_ptr(ret);
55 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
59 public void set_cltv_expiry_delta(org.ldk.structs.Option_u16Z val) {
60 bindings.ChannelConfigUpdate_set_cltv_expiry_delta(this.ptr, val.ptr);
63 if (this != null) { this.ptrs_to.AddLast(val); };
67 * Returns a copy of the field.
69 public Option_MaxDustHTLCExposureZ get_max_dust_htlc_exposure_msat() {
70 long ret = bindings.ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(this.ptr);
72 if (ret >= 0 && ret <= 4096) { return null; }
73 org.ldk.structs.Option_MaxDustHTLCExposureZ ret_hu_conv = org.ldk.structs.Option_MaxDustHTLCExposureZ.constr_from_ptr(ret);
74 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
78 public void set_max_dust_htlc_exposure_msat(org.ldk.structs.Option_MaxDustHTLCExposureZ val) {
79 bindings.ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(this.ptr, val.ptr);
82 if (this != null) { this.ptrs_to.AddLast(val); };
85 public Option_u64Z get_force_close_avoidance_max_fee_satoshis() {
86 long ret = bindings.ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(this.ptr);
88 if (ret >= 0 && ret <= 4096) { return null; }
89 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
90 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
94 public void set_force_close_avoidance_max_fee_satoshis(org.ldk.structs.Option_u64Z val) {
95 bindings.ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(this.ptr, val.ptr);
98 if (this != null) { this.ptrs_to.AddLast(val); };
102 * Constructs a new ChannelConfigUpdate given each field
104 public static ChannelConfigUpdate of(org.ldk.structs.Option_u32Z forwarding_fee_proportional_millionths_arg, org.ldk.structs.Option_u32Z forwarding_fee_base_msat_arg, org.ldk.structs.Option_u16Z cltv_expiry_delta_arg, org.ldk.structs.Option_MaxDustHTLCExposureZ max_dust_htlc_exposure_msat_arg, org.ldk.structs.Option_u64Z force_close_avoidance_max_fee_satoshis_arg) {
105 long ret = bindings.ChannelConfigUpdate_new(forwarding_fee_proportional_millionths_arg.ptr, forwarding_fee_base_msat_arg.ptr, cltv_expiry_delta_arg.ptr, max_dust_htlc_exposure_msat_arg.ptr, force_close_avoidance_max_fee_satoshis_arg.ptr);
106 GC.KeepAlive(forwarding_fee_proportional_millionths_arg);
107 GC.KeepAlive(forwarding_fee_base_msat_arg);
108 GC.KeepAlive(cltv_expiry_delta_arg);
109 GC.KeepAlive(max_dust_htlc_exposure_msat_arg);
110 GC.KeepAlive(force_close_avoidance_max_fee_satoshis_arg);
111 if (ret >= 0 && ret <= 4096) { return null; }
112 org.ldk.structs.ChannelConfigUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfigUpdate(null, ret); }
113 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
114 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(forwarding_fee_proportional_millionths_arg); };
115 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(forwarding_fee_base_msat_arg); };
116 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(cltv_expiry_delta_arg); };
117 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(max_dust_htlc_exposure_msat_arg); };
118 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(force_close_avoidance_max_fee_satoshis_arg); };
123 * Creates a "default" ChannelConfigUpdate. See struct and individual field documentaiton for details on which values are used.
125 public static ChannelConfigUpdate with_default() {
126 long ret = bindings.ChannelConfigUpdate_default();
127 if (ret >= 0 && ret <= 4096) { return null; }
128 org.ldk.structs.ChannelConfigUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfigUpdate(null, ret); }
129 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };