6 namespace org { namespace ldk { namespace structs {
10 * An accept_channel message to be sent or received from a peer
12 public class AcceptChannel : CommonBase {
13 internal AcceptChannel(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.AcceptChannel_free(ptr); }
19 * A temporary channel ID, until the funding outpoint is announced
21 public byte[] get_temporary_channel_id() {
22 byte[] ret = bindings.AcceptChannel_get_temporary_channel_id(this.ptr);
28 * A temporary channel ID, until the funding outpoint is announced
30 public void set_temporary_channel_id(byte[] val) {
31 bindings.AcceptChannel_set_temporary_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
37 * The threshold below which outputs on transactions broadcast by sender will be omitted
39 public long get_dust_limit_satoshis() {
40 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);
55 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
57 public long get_max_htlc_value_in_flight_msat() {
58 long ret = bindings.AcceptChannel_get_max_htlc_value_in_flight_msat(this.ptr);
64 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
66 public void set_max_htlc_value_in_flight_msat(long val) {
67 bindings.AcceptChannel_set_max_htlc_value_in_flight_msat(this.ptr, val);
73 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
75 public long get_channel_reserve_satoshis() {
76 long ret = bindings.AcceptChannel_get_channel_reserve_satoshis(this.ptr);
82 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
84 public void set_channel_reserve_satoshis(long val) {
85 bindings.AcceptChannel_set_channel_reserve_satoshis(this.ptr, val);
91 * The minimum HTLC size incoming to sender, in milli-satoshi
93 public long get_htlc_minimum_msat() {
94 long ret = bindings.AcceptChannel_get_htlc_minimum_msat(this.ptr);
100 * The minimum HTLC size incoming to sender, in milli-satoshi
102 public void set_htlc_minimum_msat(long val) {
103 bindings.AcceptChannel_set_htlc_minimum_msat(this.ptr, val);
109 * Minimum depth of the funding transaction before the channel is considered open
111 public int get_minimum_depth() {
112 int ret = bindings.AcceptChannel_get_minimum_depth(this.ptr);
118 * Minimum depth of the funding transaction before the channel is considered open
120 public void set_minimum_depth(int val) {
121 bindings.AcceptChannel_set_minimum_depth(this.ptr, val);
127 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
129 public short get_to_self_delay() {
130 short ret = bindings.AcceptChannel_get_to_self_delay(this.ptr);
136 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
138 public void set_to_self_delay(short val) {
139 bindings.AcceptChannel_set_to_self_delay(this.ptr, val);
145 * The maximum number of inbound HTLCs towards sender
147 public short get_max_accepted_htlcs() {
148 short ret = bindings.AcceptChannel_get_max_accepted_htlcs(this.ptr);
154 * The maximum number of inbound HTLCs towards sender
156 public void set_max_accepted_htlcs(short val) {
157 bindings.AcceptChannel_set_max_accepted_htlcs(this.ptr, val);
163 * The sender's key controlling the funding transaction
165 public byte[] get_funding_pubkey() {
166 byte[] ret = bindings.AcceptChannel_get_funding_pubkey(this.ptr);
172 * The sender's key controlling the funding transaction
174 public void set_funding_pubkey(byte[] val) {
175 bindings.AcceptChannel_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33));
181 * Used to derive a revocation key for transactions broadcast by counterparty
183 public byte[] get_revocation_basepoint() {
184 byte[] ret = bindings.AcceptChannel_get_revocation_basepoint(this.ptr);
190 * Used to derive a revocation key for transactions broadcast by counterparty
192 public void set_revocation_basepoint(byte[] val) {
193 bindings.AcceptChannel_set_revocation_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
199 * A payment key to sender for transactions broadcast by counterparty
201 public byte[] get_payment_point() {
202 byte[] ret = bindings.AcceptChannel_get_payment_point(this.ptr);
208 * A payment key to sender for transactions broadcast by counterparty
210 public void set_payment_point(byte[] val) {
211 bindings.AcceptChannel_set_payment_point(this.ptr, InternalUtils.check_arr_len(val, 33));
217 * Used to derive a payment key to sender for transactions broadcast by sender
219 public byte[] get_delayed_payment_basepoint() {
220 byte[] ret = bindings.AcceptChannel_get_delayed_payment_basepoint(this.ptr);
226 * Used to derive a payment key to sender for transactions broadcast by sender
228 public void set_delayed_payment_basepoint(byte[] val) {
229 bindings.AcceptChannel_set_delayed_payment_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
235 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
237 public byte[] get_htlc_basepoint() {
238 byte[] ret = bindings.AcceptChannel_get_htlc_basepoint(this.ptr);
244 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
246 public void set_htlc_basepoint(byte[] val) {
247 bindings.AcceptChannel_set_htlc_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
253 * The first to-be-broadcast-by-sender transaction's per commitment point
255 public byte[] get_first_per_commitment_point() {
256 byte[] ret = bindings.AcceptChannel_get_first_per_commitment_point(this.ptr);
262 * The first to-be-broadcast-by-sender transaction's per commitment point
264 public void set_first_per_commitment_point(byte[] val) {
265 bindings.AcceptChannel_set_first_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33));
271 * The channel type that this channel will represent. If none is set, we derive the channel
272 * type from the intersection of our feature bits with our counterparty's feature bits from
275 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
277 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
279 public ChannelTypeFeatures get_channel_type() {
280 long ret = bindings.AcceptChannel_get_channel_type(this.ptr);
282 if (ret >= 0 && ret <= 4096) { return null; }
283 org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); }
284 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
289 * The channel type that this channel will represent. If none is set, we derive the channel
290 * type from the intersection of our feature bits with our counterparty's feature bits from
293 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
295 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
297 public void set_channel_type(org.ldk.structs.ChannelTypeFeatures val) {
298 bindings.AcceptChannel_set_channel_type(this.ptr, val == null ? 0 : val.ptr);
301 if (this != null) { this.ptrs_to.AddLast(val); };
304 internal long clone_ptr() {
305 long ret = bindings.AcceptChannel_clone_ptr(this.ptr);
311 * Creates a copy of the AcceptChannel
313 public AcceptChannel clone() {
314 long ret = bindings.AcceptChannel_clone(this.ptr);
316 if (ret >= 0 && ret <= 4096) { return null; }
317 org.ldk.structs.AcceptChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AcceptChannel(null, ret); }
318 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
323 * Checks if two AcceptChannels contain equal inner contents.
324 * This ignores pointers and is_owned flags and looks at the values in fields.
325 * Two objects with NULL inner values will be considered "equal" here.
327 public bool eq(org.ldk.structs.AcceptChannel b) {
328 bool ret = bindings.AcceptChannel_eq(this.ptr, b == null ? 0 : b.ptr);
331 if (this != null) { this.ptrs_to.AddLast(b); };
335 public override bool Equals(object o) {
336 if (!(o is AcceptChannel)) return false;
337 return this.eq((AcceptChannel)o);
340 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
342 public byte[] write() {
343 byte[] ret = bindings.AcceptChannel_write(this.ptr);
349 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
351 public static Result_AcceptChannelDecodeErrorZ read(byte[] ser) {
352 long ret = bindings.AcceptChannel_read(ser);
354 if (ret >= 0 && ret <= 4096) { return null; }
355 Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret);