6 namespace org { namespace ldk { namespace structs {
10 * The unsigned part of a channel_update
12 public class UnsignedChannelUpdate : CommonBase {
13 internal UnsignedChannelUpdate(object _dummy, long ptr) : base(ptr) { }
14 ~UnsignedChannelUpdate() {
15 if (ptr != 0) { bindings.UnsignedChannelUpdate_free(ptr); }
19 * The genesis hash of the blockchain where the channel is to be opened
21 public byte[] get_chain_hash() {
22 byte[] ret = bindings.UnsignedChannelUpdate_get_chain_hash(this.ptr);
28 * The genesis hash of the blockchain where the channel is to be opened
30 public void set_chain_hash(byte[] val) {
31 bindings.UnsignedChannelUpdate_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
37 * The short channel ID
39 public long get_short_channel_id() {
40 long ret = bindings.UnsignedChannelUpdate_get_short_channel_id(this.ptr);
46 * The short channel ID
48 public void set_short_channel_id(long val) {
49 bindings.UnsignedChannelUpdate_set_short_channel_id(this.ptr, val);
55 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
57 public int get_timestamp() {
58 int ret = bindings.UnsignedChannelUpdate_get_timestamp(this.ptr);
64 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
66 public void set_timestamp(int val) {
67 bindings.UnsignedChannelUpdate_set_timestamp(this.ptr, val);
75 public byte get_flags() {
76 byte ret = bindings.UnsignedChannelUpdate_get_flags(this.ptr);
84 public void set_flags(byte val) {
85 bindings.UnsignedChannelUpdate_set_flags(this.ptr, val);
91 * The number of blocks such that if:
92 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
93 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
94 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
95 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
96 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
97 * forwarding. Note that the HTLC sender is the one who originally sets this value when
98 * constructing the route.
100 public short get_cltv_expiry_delta() {
101 short ret = bindings.UnsignedChannelUpdate_get_cltv_expiry_delta(this.ptr);
107 * The number of blocks such that if:
108 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
109 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
110 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
111 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
112 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
113 * forwarding. Note that the HTLC sender is the one who originally sets this value when
114 * constructing the route.
116 public void set_cltv_expiry_delta(short val) {
117 bindings.UnsignedChannelUpdate_set_cltv_expiry_delta(this.ptr, val);
123 * The minimum HTLC size incoming to sender, in milli-satoshi
125 public long get_htlc_minimum_msat() {
126 long ret = bindings.UnsignedChannelUpdate_get_htlc_minimum_msat(this.ptr);
132 * The minimum HTLC size incoming to sender, in milli-satoshi
134 public void set_htlc_minimum_msat(long val) {
135 bindings.UnsignedChannelUpdate_set_htlc_minimum_msat(this.ptr, val);
141 * The maximum HTLC value incoming to sender, in milli-satoshi. Used to be optional.
143 public long get_htlc_maximum_msat() {
144 long ret = bindings.UnsignedChannelUpdate_get_htlc_maximum_msat(this.ptr);
150 * The maximum HTLC value incoming to sender, in milli-satoshi. Used to be optional.
152 public void set_htlc_maximum_msat(long val) {
153 bindings.UnsignedChannelUpdate_set_htlc_maximum_msat(this.ptr, val);
159 * The base HTLC fee charged by sender, in milli-satoshi
161 public int get_fee_base_msat() {
162 int ret = bindings.UnsignedChannelUpdate_get_fee_base_msat(this.ptr);
168 * The base HTLC fee charged by sender, in milli-satoshi
170 public void set_fee_base_msat(int val) {
171 bindings.UnsignedChannelUpdate_set_fee_base_msat(this.ptr, val);
177 * The amount to fee multiplier, in micro-satoshi
179 public int get_fee_proportional_millionths() {
180 int ret = bindings.UnsignedChannelUpdate_get_fee_proportional_millionths(this.ptr);
186 * The amount to fee multiplier, in micro-satoshi
188 public void set_fee_proportional_millionths(int val) {
189 bindings.UnsignedChannelUpdate_set_fee_proportional_millionths(this.ptr, val);
195 * Excess data which was signed as a part of the message which we do not (yet) understand how
196 * to decode. This is stored to ensure forward-compatibility as new fields are added to the
199 * Returns a copy of the field.
201 public byte[] get_excess_data() {
202 byte[] ret = bindings.UnsignedChannelUpdate_get_excess_data(this.ptr);
208 * Excess data which was signed as a part of the message which we do not (yet) understand how
209 * to decode. This is stored to ensure forward-compatibility as new fields are added to the
212 public void set_excess_data(byte[] val) {
213 bindings.UnsignedChannelUpdate_set_excess_data(this.ptr, val);
219 * Constructs a new UnsignedChannelUpdate given each field
221 public static UnsignedChannelUpdate of(byte[] chain_hash_arg, long short_channel_id_arg, int timestamp_arg, byte flags_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, int fee_base_msat_arg, int fee_proportional_millionths_arg, byte[] excess_data_arg) {
222 long ret = bindings.UnsignedChannelUpdate_new(InternalUtils.check_arr_len(chain_hash_arg, 32), short_channel_id_arg, timestamp_arg, flags_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fee_base_msat_arg, fee_proportional_millionths_arg, excess_data_arg);
223 GC.KeepAlive(chain_hash_arg);
224 GC.KeepAlive(short_channel_id_arg);
225 GC.KeepAlive(timestamp_arg);
226 GC.KeepAlive(flags_arg);
227 GC.KeepAlive(cltv_expiry_delta_arg);
228 GC.KeepAlive(htlc_minimum_msat_arg);
229 GC.KeepAlive(htlc_maximum_msat_arg);
230 GC.KeepAlive(fee_base_msat_arg);
231 GC.KeepAlive(fee_proportional_millionths_arg);
232 GC.KeepAlive(excess_data_arg);
233 if (ret >= 0 && ret <= 4096) { return null; }
234 org.ldk.structs.UnsignedChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedChannelUpdate(null, ret); }
235 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
239 internal long clone_ptr() {
240 long ret = bindings.UnsignedChannelUpdate_clone_ptr(this.ptr);
246 * Creates a copy of the UnsignedChannelUpdate
248 public UnsignedChannelUpdate clone() {
249 long ret = bindings.UnsignedChannelUpdate_clone(this.ptr);
251 if (ret >= 0 && ret <= 4096) { return null; }
252 org.ldk.structs.UnsignedChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedChannelUpdate(null, ret); }
253 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
258 * Checks if two UnsignedChannelUpdates contain equal inner contents.
259 * This ignores pointers and is_owned flags and looks at the values in fields.
260 * Two objects with NULL inner values will be considered "equal" here.
262 public bool eq(org.ldk.structs.UnsignedChannelUpdate b) {
263 bool ret = bindings.UnsignedChannelUpdate_eq(this.ptr, b == null ? 0 : b.ptr);
266 if (this != null) { this.ptrs_to.AddLast(b); };
270 public override bool Equals(object o) {
271 if (!(o is UnsignedChannelUpdate)) return false;
272 return this.eq((UnsignedChannelUpdate)o);
275 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
277 public byte[] write() {
278 byte[] ret = bindings.UnsignedChannelUpdate_write(this.ptr);
284 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
286 public static Result_UnsignedChannelUpdateDecodeErrorZ read(byte[] ser) {
287 long ret = bindings.UnsignedChannelUpdate_read(ser);
289 if (ret >= 0 && ret <= 4096) { return null; }
290 Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret);