[Java] Update auto-generated Java bindings for 0.0.108
[ldk-java] / src / main / java / org / ldk / structs / UnsignedChannelUpdate.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
9
10
11 /**
12  * The unsigned part of a channel_update
13  */
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class UnsignedChannelUpdate extends CommonBase {
16         UnsignedChannelUpdate(Object _dummy, long ptr) { super(ptr); }
17         @Override @SuppressWarnings("deprecation")
18         protected void finalize() throws Throwable {
19                 super.finalize();
20                 if (ptr != 0) { bindings.UnsignedChannelUpdate_free(ptr); }
21         }
22
23         /**
24          * The genesis hash of the blockchain where the channel is to be opened
25          */
26         public byte[] get_chain_hash() {
27                 byte[] ret = bindings.UnsignedChannelUpdate_get_chain_hash(this.ptr);
28                 Reference.reachabilityFence(this);
29                 return ret;
30         }
31
32         /**
33          * The genesis hash of the blockchain where the channel is to be opened
34          */
35         public void set_chain_hash(byte[] val) {
36                 bindings.UnsignedChannelUpdate_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
37                 Reference.reachabilityFence(this);
38                 Reference.reachabilityFence(val);
39         }
40
41         /**
42          * The short channel ID
43          */
44         public long get_short_channel_id() {
45                 long ret = bindings.UnsignedChannelUpdate_get_short_channel_id(this.ptr);
46                 Reference.reachabilityFence(this);
47                 return ret;
48         }
49
50         /**
51          * The short channel ID
52          */
53         public void set_short_channel_id(long val) {
54                 bindings.UnsignedChannelUpdate_set_short_channel_id(this.ptr, val);
55                 Reference.reachabilityFence(this);
56                 Reference.reachabilityFence(val);
57         }
58
59         /**
60          * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
61          */
62         public int get_timestamp() {
63                 int ret = bindings.UnsignedChannelUpdate_get_timestamp(this.ptr);
64                 Reference.reachabilityFence(this);
65                 return ret;
66         }
67
68         /**
69          * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
70          */
71         public void set_timestamp(int val) {
72                 bindings.UnsignedChannelUpdate_set_timestamp(this.ptr, val);
73                 Reference.reachabilityFence(this);
74                 Reference.reachabilityFence(val);
75         }
76
77         /**
78          * Channel flags
79          */
80         public byte get_flags() {
81                 byte ret = bindings.UnsignedChannelUpdate_get_flags(this.ptr);
82                 Reference.reachabilityFence(this);
83                 return ret;
84         }
85
86         /**
87          * Channel flags
88          */
89         public void set_flags(byte val) {
90                 bindings.UnsignedChannelUpdate_set_flags(this.ptr, val);
91                 Reference.reachabilityFence(this);
92                 Reference.reachabilityFence(val);
93         }
94
95         /**
96          * The number of blocks such that if:
97          * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
98          * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
99          * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
100          * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
101          * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
102          * forwarding. Note that the HTLC sender is the one who originally sets this value when
103          * constructing the route.
104          */
105         public short get_cltv_expiry_delta() {
106                 short ret = bindings.UnsignedChannelUpdate_get_cltv_expiry_delta(this.ptr);
107                 Reference.reachabilityFence(this);
108                 return ret;
109         }
110
111         /**
112          * The number of blocks such that if:
113          * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
114          * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
115          * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
116          * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
117          * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
118          * forwarding. Note that the HTLC sender is the one who originally sets this value when
119          * constructing the route.
120          */
121         public void set_cltv_expiry_delta(short val) {
122                 bindings.UnsignedChannelUpdate_set_cltv_expiry_delta(this.ptr, val);
123                 Reference.reachabilityFence(this);
124                 Reference.reachabilityFence(val);
125         }
126
127         /**
128          * The minimum HTLC size incoming to sender, in milli-satoshi
129          */
130         public long get_htlc_minimum_msat() {
131                 long ret = bindings.UnsignedChannelUpdate_get_htlc_minimum_msat(this.ptr);
132                 Reference.reachabilityFence(this);
133                 return ret;
134         }
135
136         /**
137          * The minimum HTLC size incoming to sender, in milli-satoshi
138          */
139         public void set_htlc_minimum_msat(long val) {
140                 bindings.UnsignedChannelUpdate_set_htlc_minimum_msat(this.ptr, val);
141                 Reference.reachabilityFence(this);
142                 Reference.reachabilityFence(val);
143         }
144
145         /**
146          * The base HTLC fee charged by sender, in milli-satoshi
147          */
148         public int get_fee_base_msat() {
149                 int ret = bindings.UnsignedChannelUpdate_get_fee_base_msat(this.ptr);
150                 Reference.reachabilityFence(this);
151                 return ret;
152         }
153
154         /**
155          * The base HTLC fee charged by sender, in milli-satoshi
156          */
157         public void set_fee_base_msat(int val) {
158                 bindings.UnsignedChannelUpdate_set_fee_base_msat(this.ptr, val);
159                 Reference.reachabilityFence(this);
160                 Reference.reachabilityFence(val);
161         }
162
163         /**
164          * The amount to fee multiplier, in micro-satoshi
165          */
166         public int get_fee_proportional_millionths() {
167                 int ret = bindings.UnsignedChannelUpdate_get_fee_proportional_millionths(this.ptr);
168                 Reference.reachabilityFence(this);
169                 return ret;
170         }
171
172         /**
173          * The amount to fee multiplier, in micro-satoshi
174          */
175         public void set_fee_proportional_millionths(int val) {
176                 bindings.UnsignedChannelUpdate_set_fee_proportional_millionths(this.ptr, val);
177                 Reference.reachabilityFence(this);
178                 Reference.reachabilityFence(val);
179         }
180
181         /**
182          * Excess data which was signed as a part of the message which we do not (yet) understand how
183          * to decode. This is stored to ensure forward-compatibility as new fields are added to the
184          * lightning gossip
185          */
186         public void set_excess_data(byte[] val) {
187                 bindings.UnsignedChannelUpdate_set_excess_data(this.ptr, val);
188                 Reference.reachabilityFence(this);
189                 Reference.reachabilityFence(val);
190         }
191
192         long clone_ptr() {
193                 long ret = bindings.UnsignedChannelUpdate_clone_ptr(this.ptr);
194                 Reference.reachabilityFence(this);
195                 return ret;
196         }
197
198         /**
199          * Creates a copy of the UnsignedChannelUpdate
200          */
201         public UnsignedChannelUpdate clone() {
202                 long ret = bindings.UnsignedChannelUpdate_clone(this.ptr);
203                 Reference.reachabilityFence(this);
204                 if (ret >= 0 && ret <= 4096) { return null; }
205                 org.ldk.structs.UnsignedChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedChannelUpdate(null, ret); }
206                 ret_hu_conv.ptrs_to.add(this);
207                 return ret_hu_conv;
208         }
209
210         /**
211          * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
212          */
213         public byte[] write() {
214                 byte[] ret = bindings.UnsignedChannelUpdate_write(this.ptr);
215                 Reference.reachabilityFence(this);
216                 return ret;
217         }
218
219         /**
220          * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
221          */
222         public static Result_UnsignedChannelUpdateDecodeErrorZ read(byte[] ser) {
223                 long ret = bindings.UnsignedChannelUpdate_read(ser);
224                 Reference.reachabilityFence(ser);
225                 if (ret >= 0 && ret <= 4096) { return null; }
226                 Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
227                 return ret_hu_conv;
228         }
229
230 }