1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
10 * An open_channel message to be sent or received from a peer
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class OpenChannel extends CommonBase {
14 OpenChannel(Object _dummy, long ptr) { super(ptr); }
15 @Override @SuppressWarnings("deprecation")
16 protected void finalize() throws Throwable {
18 if (ptr != 0) { bindings.OpenChannel_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.OpenChannel_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.OpenChannel_set_chain_hash(this.ptr, val);
37 * A temporary channel ID, until the funding outpoint is announced
39 public byte[] get_temporary_channel_id() {
40 byte[] ret = bindings.OpenChannel_get_temporary_channel_id(this.ptr);
45 * A temporary channel ID, until the funding outpoint is announced
47 public void set_temporary_channel_id(byte[] val) {
48 bindings.OpenChannel_set_temporary_channel_id(this.ptr, val);
54 public long get_funding_satoshis() {
55 long ret = bindings.OpenChannel_get_funding_satoshis(this.ptr);
62 public void set_funding_satoshis(long val) {
63 bindings.OpenChannel_set_funding_satoshis(this.ptr, val);
67 * The amount to push to the counterparty as part of the open, in milli-satoshi
69 public long get_push_msat() {
70 long ret = bindings.OpenChannel_get_push_msat(this.ptr);
75 * The amount to push to the counterparty as part of the open, in milli-satoshi
77 public void set_push_msat(long val) {
78 bindings.OpenChannel_set_push_msat(this.ptr, val);
82 * The threshold below which outputs on transactions broadcast by sender will be omitted
84 public long get_dust_limit_satoshis() {
85 long ret = bindings.OpenChannel_get_dust_limit_satoshis(this.ptr);
90 * The threshold below which outputs on transactions broadcast by sender will be omitted
92 public void set_dust_limit_satoshis(long val) {
93 bindings.OpenChannel_set_dust_limit_satoshis(this.ptr, val);
97 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
99 public long get_max_htlc_value_in_flight_msat() {
100 long ret = bindings.OpenChannel_get_max_htlc_value_in_flight_msat(this.ptr);
105 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
107 public void set_max_htlc_value_in_flight_msat(long val) {
108 bindings.OpenChannel_set_max_htlc_value_in_flight_msat(this.ptr, val);
112 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
114 public long get_channel_reserve_satoshis() {
115 long ret = bindings.OpenChannel_get_channel_reserve_satoshis(this.ptr);
120 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
122 public void set_channel_reserve_satoshis(long val) {
123 bindings.OpenChannel_set_channel_reserve_satoshis(this.ptr, val);
127 * The minimum HTLC size incoming to sender, in milli-satoshi
129 public long get_htlc_minimum_msat() {
130 long ret = bindings.OpenChannel_get_htlc_minimum_msat(this.ptr);
135 * The minimum HTLC size incoming to sender, in milli-satoshi
137 public void set_htlc_minimum_msat(long val) {
138 bindings.OpenChannel_set_htlc_minimum_msat(this.ptr, val);
142 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
144 public int get_feerate_per_kw() {
145 int ret = bindings.OpenChannel_get_feerate_per_kw(this.ptr);
150 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
152 public void set_feerate_per_kw(int val) {
153 bindings.OpenChannel_set_feerate_per_kw(this.ptr, val);
157 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
159 public short get_to_self_delay() {
160 short ret = bindings.OpenChannel_get_to_self_delay(this.ptr);
165 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
167 public void set_to_self_delay(short val) {
168 bindings.OpenChannel_set_to_self_delay(this.ptr, val);
172 * The maximum number of inbound HTLCs towards sender
174 public short get_max_accepted_htlcs() {
175 short ret = bindings.OpenChannel_get_max_accepted_htlcs(this.ptr);
180 * The maximum number of inbound HTLCs towards sender
182 public void set_max_accepted_htlcs(short val) {
183 bindings.OpenChannel_set_max_accepted_htlcs(this.ptr, val);
187 * The sender's key controlling the funding transaction
189 public byte[] get_funding_pubkey() {
190 byte[] ret = bindings.OpenChannel_get_funding_pubkey(this.ptr);
195 * The sender's key controlling the funding transaction
197 public void set_funding_pubkey(byte[] val) {
198 bindings.OpenChannel_set_funding_pubkey(this.ptr, val);
202 * Used to derive a revocation key for transactions broadcast by counterparty
204 public byte[] get_revocation_basepoint() {
205 byte[] ret = bindings.OpenChannel_get_revocation_basepoint(this.ptr);
210 * Used to derive a revocation key for transactions broadcast by counterparty
212 public void set_revocation_basepoint(byte[] val) {
213 bindings.OpenChannel_set_revocation_basepoint(this.ptr, val);
217 * A payment key to sender for transactions broadcast by counterparty
219 public byte[] get_payment_point() {
220 byte[] ret = bindings.OpenChannel_get_payment_point(this.ptr);
225 * A payment key to sender for transactions broadcast by counterparty
227 public void set_payment_point(byte[] val) {
228 bindings.OpenChannel_set_payment_point(this.ptr, val);
232 * Used to derive a payment key to sender for transactions broadcast by sender
234 public byte[] get_delayed_payment_basepoint() {
235 byte[] ret = bindings.OpenChannel_get_delayed_payment_basepoint(this.ptr);
240 * Used to derive a payment key to sender for transactions broadcast by sender
242 public void set_delayed_payment_basepoint(byte[] val) {
243 bindings.OpenChannel_set_delayed_payment_basepoint(this.ptr, val);
247 * Used to derive an HTLC payment key to sender
249 public byte[] get_htlc_basepoint() {
250 byte[] ret = bindings.OpenChannel_get_htlc_basepoint(this.ptr);
255 * Used to derive an HTLC payment key to sender
257 public void set_htlc_basepoint(byte[] val) {
258 bindings.OpenChannel_set_htlc_basepoint(this.ptr, val);
262 * The first to-be-broadcast-by-sender transaction's per commitment point
264 public byte[] get_first_per_commitment_point() {
265 byte[] ret = bindings.OpenChannel_get_first_per_commitment_point(this.ptr);
270 * The first to-be-broadcast-by-sender transaction's per commitment point
272 public void set_first_per_commitment_point(byte[] val) {
273 bindings.OpenChannel_set_first_per_commitment_point(this.ptr, val);
279 public byte get_channel_flags() {
280 byte ret = bindings.OpenChannel_get_channel_flags(this.ptr);
287 public void set_channel_flags(byte val) {
288 bindings.OpenChannel_set_channel_flags(this.ptr, val);
292 * Creates a copy of the OpenChannel
294 public OpenChannel clone() {
295 long ret = bindings.OpenChannel_clone(this.ptr);
296 OpenChannel ret_hu_conv = new OpenChannel(null, ret);
297 ret_hu_conv.ptrs_to.add(this);
302 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
304 public byte[] write() {
305 byte[] ret = bindings.OpenChannel_write(this.ptr);
310 * Read a OpenChannel from a byte array, created by OpenChannel_write
312 public static Result_OpenChannelDecodeErrorZ constructor_read(byte[] ser) {
313 long ret = bindings.OpenChannel_read(ser);
314 Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret);