Update auto-generated bindings to 0.0.103
[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 javax.annotation.Nullable;
8
9
10 /**
11  * The unsigned part of a channel_update
12  */
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class UnsignedChannelUpdate extends CommonBase {
15         UnsignedChannelUpdate(Object _dummy, long ptr) { super(ptr); }
16         @Override @SuppressWarnings("deprecation")
17         protected void finalize() throws Throwable {
18                 super.finalize();
19                 if (ptr != 0) { bindings.UnsignedChannelUpdate_free(ptr); }
20         }
21
22         /**
23          * The genesis hash of the blockchain where the channel is to be opened
24          */
25         public byte[] get_chain_hash() {
26                 byte[] ret = bindings.UnsignedChannelUpdate_get_chain_hash(this.ptr);
27                 return ret;
28         }
29
30         /**
31          * The genesis hash of the blockchain where the channel is to be opened
32          */
33         public void set_chain_hash(byte[] val) {
34                 bindings.UnsignedChannelUpdate_set_chain_hash(this.ptr, val);
35         }
36
37         /**
38          * The short channel ID
39          */
40         public long get_short_channel_id() {
41                 long ret = bindings.UnsignedChannelUpdate_get_short_channel_id(this.ptr);
42                 return ret;
43         }
44
45         /**
46          * The short channel ID
47          */
48         public void set_short_channel_id(long val) {
49                 bindings.UnsignedChannelUpdate_set_short_channel_id(this.ptr, val);
50         }
51
52         /**
53          * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
54          */
55         public int get_timestamp() {
56                 int ret = bindings.UnsignedChannelUpdate_get_timestamp(this.ptr);
57                 return ret;
58         }
59
60         /**
61          * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
62          */
63         public void set_timestamp(int val) {
64                 bindings.UnsignedChannelUpdate_set_timestamp(this.ptr, val);
65         }
66
67         /**
68          * Channel flags
69          */
70         public byte get_flags() {
71                 byte ret = bindings.UnsignedChannelUpdate_get_flags(this.ptr);
72                 return ret;
73         }
74
75         /**
76          * Channel flags
77          */
78         public void set_flags(byte val) {
79                 bindings.UnsignedChannelUpdate_set_flags(this.ptr, val);
80         }
81
82         /**
83          * The number of blocks such that if:
84          * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
85          * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
86          * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
87          * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
88          * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
89          * forwarding. Note that the HTLC sender is the one who originally sets this value when
90          * constructing the route.
91          */
92         public short get_cltv_expiry_delta() {
93                 short ret = bindings.UnsignedChannelUpdate_get_cltv_expiry_delta(this.ptr);
94                 return ret;
95         }
96
97         /**
98          * The number of blocks such that if:
99          * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
100          * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
101          * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
102          * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
103          * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
104          * forwarding. Note that the HTLC sender is the one who originally sets this value when
105          * constructing the route.
106          */
107         public void set_cltv_expiry_delta(short val) {
108                 bindings.UnsignedChannelUpdate_set_cltv_expiry_delta(this.ptr, val);
109         }
110
111         /**
112          * The minimum HTLC size incoming to sender, in milli-satoshi
113          */
114         public long get_htlc_minimum_msat() {
115                 long ret = bindings.UnsignedChannelUpdate_get_htlc_minimum_msat(this.ptr);
116                 return ret;
117         }
118
119         /**
120          * The minimum HTLC size incoming to sender, in milli-satoshi
121          */
122         public void set_htlc_minimum_msat(long val) {
123                 bindings.UnsignedChannelUpdate_set_htlc_minimum_msat(this.ptr, val);
124         }
125
126         /**
127          * The base HTLC fee charged by sender, in milli-satoshi
128          */
129         public int get_fee_base_msat() {
130                 int ret = bindings.UnsignedChannelUpdate_get_fee_base_msat(this.ptr);
131                 return ret;
132         }
133
134         /**
135          * The base HTLC fee charged by sender, in milli-satoshi
136          */
137         public void set_fee_base_msat(int val) {
138                 bindings.UnsignedChannelUpdate_set_fee_base_msat(this.ptr, val);
139         }
140
141         /**
142          * The amount to fee multiplier, in micro-satoshi
143          */
144         public int get_fee_proportional_millionths() {
145                 int ret = bindings.UnsignedChannelUpdate_get_fee_proportional_millionths(this.ptr);
146                 return ret;
147         }
148
149         /**
150          * The amount to fee multiplier, in micro-satoshi
151          */
152         public void set_fee_proportional_millionths(int val) {
153                 bindings.UnsignedChannelUpdate_set_fee_proportional_millionths(this.ptr, val);
154         }
155
156         /**
157          * Creates a copy of the UnsignedChannelUpdate
158          */
159         public UnsignedChannelUpdate clone() {
160                 long ret = bindings.UnsignedChannelUpdate_clone(this.ptr);
161                 if (ret >= 0 && ret <= 4096) { return null; }
162                 UnsignedChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UnsignedChannelUpdate(null, ret); }
163                 ret_hu_conv.ptrs_to.add(this);
164                 return ret_hu_conv;
165         }
166
167         /**
168          * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
169          */
170         public byte[] write() {
171                 byte[] ret = bindings.UnsignedChannelUpdate_write(this.ptr);
172                 return ret;
173         }
174
175         /**
176          * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
177          */
178         public static Result_UnsignedChannelUpdateDecodeErrorZ read(byte[] ser) {
179                 long ret = bindings.UnsignedChannelUpdate_read(ser);
180                 if (ret >= 0 && ret <= 4096) { return null; }
181                 Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
182                 return ret_hu_conv;
183         }
184
185 }