6 namespace org { namespace ldk { namespace structs {
10 * An open_channel message to be sent or received from a peer
12 public class OpenChannel : CommonBase {
13 internal OpenChannel(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.OpenChannel_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.OpenChannel_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.OpenChannel_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
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);
46 * A temporary channel ID, until the funding outpoint is announced
48 public void set_temporary_channel_id(byte[] val) {
49 bindings.OpenChannel_set_temporary_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
57 public long get_funding_satoshis() {
58 long ret = bindings.OpenChannel_get_funding_satoshis(this.ptr);
66 public void set_funding_satoshis(long val) {
67 bindings.OpenChannel_set_funding_satoshis(this.ptr, val);
73 * The amount to push to the counterparty as part of the open, in milli-satoshi
75 public long get_push_msat() {
76 long ret = bindings.OpenChannel_get_push_msat(this.ptr);
82 * The amount to push to the counterparty as part of the open, in milli-satoshi
84 public void set_push_msat(long val) {
85 bindings.OpenChannel_set_push_msat(this.ptr, val);
91 * The threshold below which outputs on transactions broadcast by sender will be omitted
93 public long get_dust_limit_satoshis() {
94 long ret = bindings.OpenChannel_get_dust_limit_satoshis(this.ptr);
100 * The threshold below which outputs on transactions broadcast by sender will be omitted
102 public void set_dust_limit_satoshis(long val) {
103 bindings.OpenChannel_set_dust_limit_satoshis(this.ptr, val);
109 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
111 public long get_max_htlc_value_in_flight_msat() {
112 long ret = bindings.OpenChannel_get_max_htlc_value_in_flight_msat(this.ptr);
118 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
120 public void set_max_htlc_value_in_flight_msat(long val) {
121 bindings.OpenChannel_set_max_htlc_value_in_flight_msat(this.ptr, val);
127 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
129 public long get_channel_reserve_satoshis() {
130 long ret = bindings.OpenChannel_get_channel_reserve_satoshis(this.ptr);
136 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
138 public void set_channel_reserve_satoshis(long val) {
139 bindings.OpenChannel_set_channel_reserve_satoshis(this.ptr, val);
145 * The minimum HTLC size incoming to sender, in milli-satoshi
147 public long get_htlc_minimum_msat() {
148 long ret = bindings.OpenChannel_get_htlc_minimum_msat(this.ptr);
154 * The minimum HTLC size incoming to sender, in milli-satoshi
156 public void set_htlc_minimum_msat(long val) {
157 bindings.OpenChannel_set_htlc_minimum_msat(this.ptr, val);
163 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
165 public int get_feerate_per_kw() {
166 int ret = bindings.OpenChannel_get_feerate_per_kw(this.ptr);
172 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
174 public void set_feerate_per_kw(int val) {
175 bindings.OpenChannel_set_feerate_per_kw(this.ptr, val);
181 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
183 public short get_to_self_delay() {
184 short ret = bindings.OpenChannel_get_to_self_delay(this.ptr);
190 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
192 public void set_to_self_delay(short val) {
193 bindings.OpenChannel_set_to_self_delay(this.ptr, val);
199 * The maximum number of inbound HTLCs towards sender
201 public short get_max_accepted_htlcs() {
202 short ret = bindings.OpenChannel_get_max_accepted_htlcs(this.ptr);
208 * The maximum number of inbound HTLCs towards sender
210 public void set_max_accepted_htlcs(short val) {
211 bindings.OpenChannel_set_max_accepted_htlcs(this.ptr, val);
217 * The sender's key controlling the funding transaction
219 public byte[] get_funding_pubkey() {
220 byte[] ret = bindings.OpenChannel_get_funding_pubkey(this.ptr);
226 * The sender's key controlling the funding transaction
228 public void set_funding_pubkey(byte[] val) {
229 bindings.OpenChannel_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33));
235 * Used to derive a revocation key for transactions broadcast by counterparty
237 public byte[] get_revocation_basepoint() {
238 byte[] ret = bindings.OpenChannel_get_revocation_basepoint(this.ptr);
244 * Used to derive a revocation key for transactions broadcast by counterparty
246 public void set_revocation_basepoint(byte[] val) {
247 bindings.OpenChannel_set_revocation_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
253 * A payment key to sender for transactions broadcast by counterparty
255 public byte[] get_payment_point() {
256 byte[] ret = bindings.OpenChannel_get_payment_point(this.ptr);
262 * A payment key to sender for transactions broadcast by counterparty
264 public void set_payment_point(byte[] val) {
265 bindings.OpenChannel_set_payment_point(this.ptr, InternalUtils.check_arr_len(val, 33));
271 * Used to derive a payment key to sender for transactions broadcast by sender
273 public byte[] get_delayed_payment_basepoint() {
274 byte[] ret = bindings.OpenChannel_get_delayed_payment_basepoint(this.ptr);
280 * Used to derive a payment key to sender for transactions broadcast by sender
282 public void set_delayed_payment_basepoint(byte[] val) {
283 bindings.OpenChannel_set_delayed_payment_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
289 * Used to derive an HTLC payment key to sender
291 public byte[] get_htlc_basepoint() {
292 byte[] ret = bindings.OpenChannel_get_htlc_basepoint(this.ptr);
298 * Used to derive an HTLC payment key to sender
300 public void set_htlc_basepoint(byte[] val) {
301 bindings.OpenChannel_set_htlc_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
307 * The first to-be-broadcast-by-sender transaction's per commitment point
309 public byte[] get_first_per_commitment_point() {
310 byte[] ret = bindings.OpenChannel_get_first_per_commitment_point(this.ptr);
316 * The first to-be-broadcast-by-sender transaction's per commitment point
318 public void set_first_per_commitment_point(byte[] val) {
319 bindings.OpenChannel_set_first_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33));
327 public byte get_channel_flags() {
328 byte ret = bindings.OpenChannel_get_channel_flags(this.ptr);
336 public void set_channel_flags(byte val) {
337 bindings.OpenChannel_set_channel_flags(this.ptr, val);
343 * The channel type that this channel will represent. If none is set, we derive the channel
344 * type from the intersection of our feature bits with our counterparty's feature bits from
347 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
349 public ChannelTypeFeatures get_channel_type() {
350 long ret = bindings.OpenChannel_get_channel_type(this.ptr);
352 if (ret >= 0 && ret <= 4096) { return null; }
353 org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); }
354 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
359 * The channel type that this channel will represent. If none is set, we derive the channel
360 * type from the intersection of our feature bits with our counterparty's feature bits from
363 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
365 public void set_channel_type(org.ldk.structs.ChannelTypeFeatures val) {
366 bindings.OpenChannel_set_channel_type(this.ptr, val == null ? 0 : val.ptr);
369 if (this != null) { this.ptrs_to.AddLast(val); };
372 internal long clone_ptr() {
373 long ret = bindings.OpenChannel_clone_ptr(this.ptr);
379 * Creates a copy of the OpenChannel
381 public OpenChannel clone() {
382 long ret = bindings.OpenChannel_clone(this.ptr);
384 if (ret >= 0 && ret <= 4096) { return null; }
385 org.ldk.structs.OpenChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OpenChannel(null, ret); }
386 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
391 * Checks if two OpenChannels contain equal inner contents.
392 * This ignores pointers and is_owned flags and looks at the values in fields.
393 * Two objects with NULL inner values will be considered "equal" here.
395 public bool eq(org.ldk.structs.OpenChannel b) {
396 bool ret = bindings.OpenChannel_eq(this.ptr, b == null ? 0 : b.ptr);
399 if (this != null) { this.ptrs_to.AddLast(b); };
403 public override bool Equals(object o) {
404 if (!(o is OpenChannel)) return false;
405 return this.eq((OpenChannel)o);
408 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
410 public byte[] write() {
411 byte[] ret = bindings.OpenChannel_write(this.ptr);
417 * Read a OpenChannel from a byte array, created by OpenChannel_write
419 public static Result_OpenChannelDecodeErrorZ read(byte[] ser) {
420 long ret = bindings.OpenChannel_read(ser);
422 if (ret >= 0 && ret <= 4096) { return null; }
423 Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret);