[TS] Update auto-generated bindings to LDK-C-Bindings 0.0.123.1
[ldk-java] / c_sharp / src / org / ldk / structs / ChannelConfigUpdate.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8
9 /**
10  * A parallel struct to [`ChannelConfig`] to define partial updates.
11  */
12 public class ChannelConfigUpdate : CommonBase {
13         internal ChannelConfigUpdate(object _dummy, long ptr) : base(ptr) { }
14         ~ChannelConfigUpdate() {
15                 if (ptr != 0) { bindings.ChannelConfigUpdate_free(ptr); }
16         }
17
18         public Option_u32Z get_forwarding_fee_proportional_millionths() {
19                 long ret = bindings.ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(this.ptr);
20                 GC.KeepAlive(this);
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); };
24                 return ret_hu_conv;
25         }
26
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);
29                 GC.KeepAlive(this);
30                 GC.KeepAlive(val);
31                 if (this != null) { this.ptrs_to.AddLast(val); };
32         }
33
34         public Option_u32Z get_forwarding_fee_base_msat() {
35                 long ret = bindings.ChannelConfigUpdate_get_forwarding_fee_base_msat(this.ptr);
36                 GC.KeepAlive(this);
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); };
40                 return ret_hu_conv;
41         }
42
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);
45                 GC.KeepAlive(this);
46                 GC.KeepAlive(val);
47                 if (this != null) { this.ptrs_to.AddLast(val); };
48         }
49
50         public Option_u16Z get_cltv_expiry_delta() {
51                 long ret = bindings.ChannelConfigUpdate_get_cltv_expiry_delta(this.ptr);
52                 GC.KeepAlive(this);
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); };
56                 return ret_hu_conv;
57         }
58
59         public void set_cltv_expiry_delta(org.ldk.structs.Option_u16Z val) {
60                 bindings.ChannelConfigUpdate_set_cltv_expiry_delta(this.ptr, val.ptr);
61                 GC.KeepAlive(this);
62                 GC.KeepAlive(val);
63                 if (this != null) { this.ptrs_to.AddLast(val); };
64         }
65
66         /**
67          * Returns a copy of the field.
68          */
69         public Option_MaxDustHTLCExposureZ get_max_dust_htlc_exposure_msat() {
70                 long ret = bindings.ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(this.ptr);
71                 GC.KeepAlive(this);
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); };
75                 return ret_hu_conv;
76         }
77
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);
80                 GC.KeepAlive(this);
81                 GC.KeepAlive(val);
82                 if (this != null) { this.ptrs_to.AddLast(val); };
83         }
84
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);
87                 GC.KeepAlive(this);
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); };
91                 return ret_hu_conv;
92         }
93
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);
96                 GC.KeepAlive(this);
97                 GC.KeepAlive(val);
98                 if (this != null) { this.ptrs_to.AddLast(val); };
99         }
100
101         /**
102          * Constructs a new ChannelConfigUpdate given each field
103          */
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); };
119                 return ret_hu_conv;
120         }
121
122         /**
123          * Creates a "default" ChannelConfigUpdate. See struct and individual field documentaiton for details on which values are used.
124          */
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); };
130                 return ret_hu_conv;
131         }
132
133 }
134 } } }