1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
10 * The unsigned part of a channel_update
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class UnsignedChannelUpdate extends CommonBase {
14 UnsignedChannelUpdate(Object _dummy, long ptr) { super(ptr); }
15 @Override @SuppressWarnings("deprecation")
16 protected void finalize() throws Throwable {
18 if (ptr != 0) { bindings.UnsignedChannelUpdate_free(ptr); }
22 * The genesis hash of the blockchain where the channel is to be opened
24 public byte[] get_chain_hash() {
25 byte[] ret = bindings.UnsignedChannelUpdate_get_chain_hash(this.ptr);
30 * The genesis hash of the blockchain where the channel is to be opened
32 public void set_chain_hash(byte[] val) {
33 bindings.UnsignedChannelUpdate_set_chain_hash(this.ptr, val);
37 * The short channel ID
39 public long get_short_channel_id() {
40 long ret = bindings.UnsignedChannelUpdate_get_short_channel_id(this.ptr);
45 * The short channel ID
47 public void set_short_channel_id(long val) {
48 bindings.UnsignedChannelUpdate_set_short_channel_id(this.ptr, val);
52 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
54 public int get_timestamp() {
55 int ret = bindings.UnsignedChannelUpdate_get_timestamp(this.ptr);
60 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
62 public void set_timestamp(int val) {
63 bindings.UnsignedChannelUpdate_set_timestamp(this.ptr, val);
69 public byte get_flags() {
70 byte ret = bindings.UnsignedChannelUpdate_get_flags(this.ptr);
77 public void set_flags(byte val) {
78 bindings.UnsignedChannelUpdate_set_flags(this.ptr, val);
82 * The number of blocks to subtract from incoming HTLC cltv_expiry values
84 public short get_cltv_expiry_delta() {
85 short ret = bindings.UnsignedChannelUpdate_get_cltv_expiry_delta(this.ptr);
90 * The number of blocks to subtract from incoming HTLC cltv_expiry values
92 public void set_cltv_expiry_delta(short val) {
93 bindings.UnsignedChannelUpdate_set_cltv_expiry_delta(this.ptr, val);
97 * The minimum HTLC size incoming to sender, in milli-satoshi
99 public long get_htlc_minimum_msat() {
100 long ret = bindings.UnsignedChannelUpdate_get_htlc_minimum_msat(this.ptr);
105 * The minimum HTLC size incoming to sender, in milli-satoshi
107 public void set_htlc_minimum_msat(long val) {
108 bindings.UnsignedChannelUpdate_set_htlc_minimum_msat(this.ptr, val);
112 * The base HTLC fee charged by sender, in milli-satoshi
114 public int get_fee_base_msat() {
115 int ret = bindings.UnsignedChannelUpdate_get_fee_base_msat(this.ptr);
120 * The base HTLC fee charged by sender, in milli-satoshi
122 public void set_fee_base_msat(int val) {
123 bindings.UnsignedChannelUpdate_set_fee_base_msat(this.ptr, val);
127 * The amount to fee multiplier, in micro-satoshi
129 public int get_fee_proportional_millionths() {
130 int ret = bindings.UnsignedChannelUpdate_get_fee_proportional_millionths(this.ptr);
135 * The amount to fee multiplier, in micro-satoshi
137 public void set_fee_proportional_millionths(int val) {
138 bindings.UnsignedChannelUpdate_set_fee_proportional_millionths(this.ptr, val);
142 * Creates a copy of the UnsignedChannelUpdate
144 public UnsignedChannelUpdate clone() {
145 long ret = bindings.UnsignedChannelUpdate_clone(this.ptr);
146 UnsignedChannelUpdate ret_hu_conv = new UnsignedChannelUpdate(null, ret);
147 ret_hu_conv.ptrs_to.add(this);
152 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
154 public byte[] write() {
155 byte[] ret = bindings.UnsignedChannelUpdate_write(this.ptr);
160 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
162 public static Result_UnsignedChannelUpdateDecodeErrorZ constructor_read(byte[] ser) {
163 long ret = bindings.UnsignedChannelUpdate_read(ser);
164 Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret);