1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import javax.annotation.Nullable;
11 * An accept_channel message to be sent or received from a peer
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class AcceptChannel extends CommonBase {
15 AcceptChannel(Object _dummy, long ptr) { super(ptr); }
16 @Override @SuppressWarnings("deprecation")
17 protected void finalize() throws Throwable {
19 if (ptr != 0) { bindings.AcceptChannel_free(ptr); }
23 * A temporary channel ID, until the funding outpoint is announced
25 public byte[] get_temporary_channel_id() {
26 byte[] ret = bindings.AcceptChannel_get_temporary_channel_id(this.ptr);
31 * A temporary channel ID, until the funding outpoint is announced
33 public void set_temporary_channel_id(byte[] val) {
34 bindings.AcceptChannel_set_temporary_channel_id(this.ptr, val);
38 * The threshold below which outputs on transactions broadcast by sender will be omitted
40 public long get_dust_limit_satoshis() {
41 long ret = bindings.AcceptChannel_get_dust_limit_satoshis(this.ptr);
46 * The threshold below which outputs on transactions broadcast by sender will be omitted
48 public void set_dust_limit_satoshis(long val) {
49 bindings.AcceptChannel_set_dust_limit_satoshis(this.ptr, val);
53 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
55 public long get_max_htlc_value_in_flight_msat() {
56 long ret = bindings.AcceptChannel_get_max_htlc_value_in_flight_msat(this.ptr);
61 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
63 public void set_max_htlc_value_in_flight_msat(long val) {
64 bindings.AcceptChannel_set_max_htlc_value_in_flight_msat(this.ptr, val);
68 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
70 public long get_channel_reserve_satoshis() {
71 long ret = bindings.AcceptChannel_get_channel_reserve_satoshis(this.ptr);
76 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
78 public void set_channel_reserve_satoshis(long val) {
79 bindings.AcceptChannel_set_channel_reserve_satoshis(this.ptr, val);
83 * The minimum HTLC size incoming to sender, in milli-satoshi
85 public long get_htlc_minimum_msat() {
86 long ret = bindings.AcceptChannel_get_htlc_minimum_msat(this.ptr);
91 * The minimum HTLC size incoming to sender, in milli-satoshi
93 public void set_htlc_minimum_msat(long val) {
94 bindings.AcceptChannel_set_htlc_minimum_msat(this.ptr, val);
98 * Minimum depth of the funding transaction before the channel is considered open
100 public int get_minimum_depth() {
101 int ret = bindings.AcceptChannel_get_minimum_depth(this.ptr);
106 * Minimum depth of the funding transaction before the channel is considered open
108 public void set_minimum_depth(int val) {
109 bindings.AcceptChannel_set_minimum_depth(this.ptr, val);
113 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
115 public short get_to_self_delay() {
116 short ret = bindings.AcceptChannel_get_to_self_delay(this.ptr);
121 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
123 public void set_to_self_delay(short val) {
124 bindings.AcceptChannel_set_to_self_delay(this.ptr, val);
128 * The maximum number of inbound HTLCs towards sender
130 public short get_max_accepted_htlcs() {
131 short ret = bindings.AcceptChannel_get_max_accepted_htlcs(this.ptr);
136 * The maximum number of inbound HTLCs towards sender
138 public void set_max_accepted_htlcs(short val) {
139 bindings.AcceptChannel_set_max_accepted_htlcs(this.ptr, val);
143 * The sender's key controlling the funding transaction
145 public byte[] get_funding_pubkey() {
146 byte[] ret = bindings.AcceptChannel_get_funding_pubkey(this.ptr);
151 * The sender's key controlling the funding transaction
153 public void set_funding_pubkey(byte[] val) {
154 bindings.AcceptChannel_set_funding_pubkey(this.ptr, val);
158 * Used to derive a revocation key for transactions broadcast by counterparty
160 public byte[] get_revocation_basepoint() {
161 byte[] ret = bindings.AcceptChannel_get_revocation_basepoint(this.ptr);
166 * Used to derive a revocation key for transactions broadcast by counterparty
168 public void set_revocation_basepoint(byte[] val) {
169 bindings.AcceptChannel_set_revocation_basepoint(this.ptr, val);
173 * A payment key to sender for transactions broadcast by counterparty
175 public byte[] get_payment_point() {
176 byte[] ret = bindings.AcceptChannel_get_payment_point(this.ptr);
181 * A payment key to sender for transactions broadcast by counterparty
183 public void set_payment_point(byte[] val) {
184 bindings.AcceptChannel_set_payment_point(this.ptr, val);
188 * Used to derive a payment key to sender for transactions broadcast by sender
190 public byte[] get_delayed_payment_basepoint() {
191 byte[] ret = bindings.AcceptChannel_get_delayed_payment_basepoint(this.ptr);
196 * Used to derive a payment key to sender for transactions broadcast by sender
198 public void set_delayed_payment_basepoint(byte[] val) {
199 bindings.AcceptChannel_set_delayed_payment_basepoint(this.ptr, val);
203 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
205 public byte[] get_htlc_basepoint() {
206 byte[] ret = bindings.AcceptChannel_get_htlc_basepoint(this.ptr);
211 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
213 public void set_htlc_basepoint(byte[] val) {
214 bindings.AcceptChannel_set_htlc_basepoint(this.ptr, val);
218 * The first to-be-broadcast-by-sender transaction's per commitment point
220 public byte[] get_first_per_commitment_point() {
221 byte[] ret = bindings.AcceptChannel_get_first_per_commitment_point(this.ptr);
226 * The first to-be-broadcast-by-sender transaction's per commitment point
228 public void set_first_per_commitment_point(byte[] val) {
229 bindings.AcceptChannel_set_first_per_commitment_point(this.ptr, val);
233 * Creates a copy of the AcceptChannel
235 public AcceptChannel clone() {
236 long ret = bindings.AcceptChannel_clone(this.ptr);
237 if (ret < 1024) { return null; }
238 AcceptChannel ret_hu_conv = new AcceptChannel(null, ret);
239 ret_hu_conv.ptrs_to.add(this);
244 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
246 public byte[] write() {
247 byte[] ret = bindings.AcceptChannel_write(this.ptr);
252 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
254 public static Result_AcceptChannelDecodeErrorZ read(byte[] ser) {
255 long ret = bindings.AcceptChannel_read(ser);
256 if (ret < 1024) { return null; }
257 Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret);