[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / OpenChannelV2.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8
9 /**
10  * An open_channel2 message to be sent by or received from the channel initiator.
11  * 
12  * Used in V2 channel establishment
13  */
14 public class OpenChannelV2 : CommonBase {
15         internal OpenChannelV2(object _dummy, long ptr) : base(ptr) { }
16         ~OpenChannelV2() {
17                 if (ptr != 0) { bindings.OpenChannelV2_free(ptr); }
18         }
19
20         /**
21          * The genesis hash of the blockchain where the channel is to be opened
22          */
23         public byte[] get_chain_hash() {
24                 long ret = bindings.OpenChannelV2_get_chain_hash(this.ptr);
25                 GC.KeepAlive(this);
26                 if (ret >= 0 && ret <= 4096) { return null; }
27                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
28                 return ret_conv;
29         }
30
31         /**
32          * The genesis hash of the blockchain where the channel is to be opened
33          */
34         public void set_chain_hash(byte[] val) {
35                 bindings.OpenChannelV2_set_chain_hash(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
36                 GC.KeepAlive(this);
37                 GC.KeepAlive(val);
38         }
39
40         /**
41          * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint
42          */
43         public byte[] get_temporary_channel_id() {
44                 long ret = bindings.OpenChannelV2_get_temporary_channel_id(this.ptr);
45                 GC.KeepAlive(this);
46                 if (ret >= 0 && ret <= 4096) { return null; }
47                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
48                 return ret_conv;
49         }
50
51         /**
52          * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint
53          */
54         public void set_temporary_channel_id(byte[] val) {
55                 bindings.OpenChannelV2_set_temporary_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
56                 GC.KeepAlive(this);
57                 GC.KeepAlive(val);
58         }
59
60         /**
61          * The feerate for the funding transaction set by the channel initiator
62          */
63         public int get_funding_feerate_sat_per_1000_weight() {
64                 int ret = bindings.OpenChannelV2_get_funding_feerate_sat_per_1000_weight(this.ptr);
65                 GC.KeepAlive(this);
66                 return ret;
67         }
68
69         /**
70          * The feerate for the funding transaction set by the channel initiator
71          */
72         public void set_funding_feerate_sat_per_1000_weight(int val) {
73                 bindings.OpenChannelV2_set_funding_feerate_sat_per_1000_weight(this.ptr, val);
74                 GC.KeepAlive(this);
75                 GC.KeepAlive(val);
76         }
77
78         /**
79          * The feerate for the commitment transaction set by the channel initiator
80          */
81         public int get_commitment_feerate_sat_per_1000_weight() {
82                 int ret = bindings.OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(this.ptr);
83                 GC.KeepAlive(this);
84                 return ret;
85         }
86
87         /**
88          * The feerate for the commitment transaction set by the channel initiator
89          */
90         public void set_commitment_feerate_sat_per_1000_weight(int val) {
91                 bindings.OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(this.ptr, val);
92                 GC.KeepAlive(this);
93                 GC.KeepAlive(val);
94         }
95
96         /**
97          * Part of the channel value contributed by the channel initiator
98          */
99         public long get_funding_satoshis() {
100                 long ret = bindings.OpenChannelV2_get_funding_satoshis(this.ptr);
101                 GC.KeepAlive(this);
102                 return ret;
103         }
104
105         /**
106          * Part of the channel value contributed by the channel initiator
107          */
108         public void set_funding_satoshis(long val) {
109                 bindings.OpenChannelV2_set_funding_satoshis(this.ptr, val);
110                 GC.KeepAlive(this);
111                 GC.KeepAlive(val);
112         }
113
114         /**
115          * The threshold below which outputs on transactions broadcast by the channel initiator will be
116          * omitted
117          */
118         public long get_dust_limit_satoshis() {
119                 long ret = bindings.OpenChannelV2_get_dust_limit_satoshis(this.ptr);
120                 GC.KeepAlive(this);
121                 return ret;
122         }
123
124         /**
125          * The threshold below which outputs on transactions broadcast by the channel initiator will be
126          * omitted
127          */
128         public void set_dust_limit_satoshis(long val) {
129                 bindings.OpenChannelV2_set_dust_limit_satoshis(this.ptr, val);
130                 GC.KeepAlive(this);
131                 GC.KeepAlive(val);
132         }
133
134         /**
135          * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
136          */
137         public long get_max_htlc_value_in_flight_msat() {
138                 long ret = bindings.OpenChannelV2_get_max_htlc_value_in_flight_msat(this.ptr);
139                 GC.KeepAlive(this);
140                 return ret;
141         }
142
143         /**
144          * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
145          */
146         public void set_max_htlc_value_in_flight_msat(long val) {
147                 bindings.OpenChannelV2_set_max_htlc_value_in_flight_msat(this.ptr, val);
148                 GC.KeepAlive(this);
149                 GC.KeepAlive(val);
150         }
151
152         /**
153          * The minimum HTLC size incoming to channel initiator, in milli-satoshi
154          */
155         public long get_htlc_minimum_msat() {
156                 long ret = bindings.OpenChannelV2_get_htlc_minimum_msat(this.ptr);
157                 GC.KeepAlive(this);
158                 return ret;
159         }
160
161         /**
162          * The minimum HTLC size incoming to channel initiator, in milli-satoshi
163          */
164         public void set_htlc_minimum_msat(long val) {
165                 bindings.OpenChannelV2_set_htlc_minimum_msat(this.ptr, val);
166                 GC.KeepAlive(this);
167                 GC.KeepAlive(val);
168         }
169
170         /**
171          * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
172          * broadcast a commitment transaction
173          */
174         public short get_to_self_delay() {
175                 short ret = bindings.OpenChannelV2_get_to_self_delay(this.ptr);
176                 GC.KeepAlive(this);
177                 return ret;
178         }
179
180         /**
181          * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
182          * broadcast a commitment transaction
183          */
184         public void set_to_self_delay(short val) {
185                 bindings.OpenChannelV2_set_to_self_delay(this.ptr, val);
186                 GC.KeepAlive(this);
187                 GC.KeepAlive(val);
188         }
189
190         /**
191          * The maximum number of inbound HTLCs towards channel initiator
192          */
193         public short get_max_accepted_htlcs() {
194                 short ret = bindings.OpenChannelV2_get_max_accepted_htlcs(this.ptr);
195                 GC.KeepAlive(this);
196                 return ret;
197         }
198
199         /**
200          * The maximum number of inbound HTLCs towards channel initiator
201          */
202         public void set_max_accepted_htlcs(short val) {
203                 bindings.OpenChannelV2_set_max_accepted_htlcs(this.ptr, val);
204                 GC.KeepAlive(this);
205                 GC.KeepAlive(val);
206         }
207
208         /**
209          * The locktime for the funding transaction
210          */
211         public int get_locktime() {
212                 int ret = bindings.OpenChannelV2_get_locktime(this.ptr);
213                 GC.KeepAlive(this);
214                 return ret;
215         }
216
217         /**
218          * The locktime for the funding transaction
219          */
220         public void set_locktime(int val) {
221                 bindings.OpenChannelV2_set_locktime(this.ptr, val);
222                 GC.KeepAlive(this);
223                 GC.KeepAlive(val);
224         }
225
226         /**
227          * The channel initiator's key controlling the funding transaction
228          */
229         public byte[] get_funding_pubkey() {
230                 long ret = bindings.OpenChannelV2_get_funding_pubkey(this.ptr);
231                 GC.KeepAlive(this);
232                 if (ret >= 0 && ret <= 4096) { return null; }
233                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
234                 return ret_conv;
235         }
236
237         /**
238          * The channel initiator's key controlling the funding transaction
239          */
240         public void set_funding_pubkey(byte[] val) {
241                 bindings.OpenChannelV2_set_funding_pubkey(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
242                 GC.KeepAlive(this);
243                 GC.KeepAlive(val);
244         }
245
246         /**
247          * Used to derive a revocation key for transactions broadcast by counterparty
248          */
249         public byte[] get_revocation_basepoint() {
250                 long ret = bindings.OpenChannelV2_get_revocation_basepoint(this.ptr);
251                 GC.KeepAlive(this);
252                 if (ret >= 0 && ret <= 4096) { return null; }
253                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
254                 return ret_conv;
255         }
256
257         /**
258          * Used to derive a revocation key for transactions broadcast by counterparty
259          */
260         public void set_revocation_basepoint(byte[] val) {
261                 bindings.OpenChannelV2_set_revocation_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
262                 GC.KeepAlive(this);
263                 GC.KeepAlive(val);
264         }
265
266         /**
267          * A payment key to channel initiator for transactions broadcast by counterparty
268          */
269         public byte[] get_payment_basepoint() {
270                 long ret = bindings.OpenChannelV2_get_payment_basepoint(this.ptr);
271                 GC.KeepAlive(this);
272                 if (ret >= 0 && ret <= 4096) { return null; }
273                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
274                 return ret_conv;
275         }
276
277         /**
278          * A payment key to channel initiator for transactions broadcast by counterparty
279          */
280         public void set_payment_basepoint(byte[] val) {
281                 bindings.OpenChannelV2_set_payment_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
282                 GC.KeepAlive(this);
283                 GC.KeepAlive(val);
284         }
285
286         /**
287          * Used to derive a payment key to channel initiator for transactions broadcast by channel
288          * initiator
289          */
290         public byte[] get_delayed_payment_basepoint() {
291                 long ret = bindings.OpenChannelV2_get_delayed_payment_basepoint(this.ptr);
292                 GC.KeepAlive(this);
293                 if (ret >= 0 && ret <= 4096) { return null; }
294                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
295                 return ret_conv;
296         }
297
298         /**
299          * Used to derive a payment key to channel initiator for transactions broadcast by channel
300          * initiator
301          */
302         public void set_delayed_payment_basepoint(byte[] val) {
303                 bindings.OpenChannelV2_set_delayed_payment_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
304                 GC.KeepAlive(this);
305                 GC.KeepAlive(val);
306         }
307
308         /**
309          * Used to derive an HTLC payment key to channel initiator
310          */
311         public byte[] get_htlc_basepoint() {
312                 long ret = bindings.OpenChannelV2_get_htlc_basepoint(this.ptr);
313                 GC.KeepAlive(this);
314                 if (ret >= 0 && ret <= 4096) { return null; }
315                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
316                 return ret_conv;
317         }
318
319         /**
320          * Used to derive an HTLC payment key to channel initiator
321          */
322         public void set_htlc_basepoint(byte[] val) {
323                 bindings.OpenChannelV2_set_htlc_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
324                 GC.KeepAlive(this);
325                 GC.KeepAlive(val);
326         }
327
328         /**
329          * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
330          */
331         public byte[] get_first_per_commitment_point() {
332                 long ret = bindings.OpenChannelV2_get_first_per_commitment_point(this.ptr);
333                 GC.KeepAlive(this);
334                 if (ret >= 0 && ret <= 4096) { return null; }
335                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
336                 return ret_conv;
337         }
338
339         /**
340          * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
341          */
342         public void set_first_per_commitment_point(byte[] val) {
343                 bindings.OpenChannelV2_set_first_per_commitment_point(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
344                 GC.KeepAlive(this);
345                 GC.KeepAlive(val);
346         }
347
348         /**
349          * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
350          */
351         public byte[] get_second_per_commitment_point() {
352                 long ret = bindings.OpenChannelV2_get_second_per_commitment_point(this.ptr);
353                 GC.KeepAlive(this);
354                 if (ret >= 0 && ret <= 4096) { return null; }
355                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
356                 return ret_conv;
357         }
358
359         /**
360          * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
361          */
362         public void set_second_per_commitment_point(byte[] val) {
363                 bindings.OpenChannelV2_set_second_per_commitment_point(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
364                 GC.KeepAlive(this);
365                 GC.KeepAlive(val);
366         }
367
368         /**
369          * Channel flags
370          */
371         public byte get_channel_flags() {
372                 byte ret = bindings.OpenChannelV2_get_channel_flags(this.ptr);
373                 GC.KeepAlive(this);
374                 return ret;
375         }
376
377         /**
378          * Channel flags
379          */
380         public void set_channel_flags(byte val) {
381                 bindings.OpenChannelV2_set_channel_flags(this.ptr, val);
382                 GC.KeepAlive(this);
383                 GC.KeepAlive(val);
384         }
385
386         /**
387          * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
388          * collaboratively close
389          */
390         public Option_CVec_u8ZZ get_shutdown_scriptpubkey() {
391                 long ret = bindings.OpenChannelV2_get_shutdown_scriptpubkey(this.ptr);
392                 GC.KeepAlive(this);
393                 if (ret >= 0 && ret <= 4096) { return null; }
394                 org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret);
395                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
396                 return ret_hu_conv;
397         }
398
399         /**
400          * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
401          * collaboratively close
402          */
403         public void set_shutdown_scriptpubkey(org.ldk.structs.Option_CVec_u8ZZ val) {
404                 bindings.OpenChannelV2_set_shutdown_scriptpubkey(this.ptr, val.ptr);
405                 GC.KeepAlive(this);
406                 GC.KeepAlive(val);
407                 if (this != null) { this.ptrs_to.AddLast(val); };
408         }
409
410         /**
411          * The channel type that this channel will represent. If none is set, we derive the channel
412          * type from the intersection of our feature bits with our counterparty's feature bits from
413          * the Init message.
414          * 
415          * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
416          */
417         public ChannelTypeFeatures get_channel_type() {
418                 long ret = bindings.OpenChannelV2_get_channel_type(this.ptr);
419                 GC.KeepAlive(this);
420                 if (ret >= 0 && ret <= 4096) { return null; }
421                 org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); }
422                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
423                 return ret_hu_conv;
424         }
425
426         /**
427          * The channel type that this channel will represent. If none is set, we derive the channel
428          * type from the intersection of our feature bits with our counterparty's feature bits from
429          * the Init message.
430          * 
431          * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
432          */
433         public void set_channel_type(org.ldk.structs.ChannelTypeFeatures val) {
434                 bindings.OpenChannelV2_set_channel_type(this.ptr, val == null ? 0 : val.ptr);
435                 GC.KeepAlive(this);
436                 GC.KeepAlive(val);
437                 if (this != null) { this.ptrs_to.AddLast(val); };
438         }
439
440         /**
441          * Optionally, a requirement that only confirmed inputs can be added
442          */
443         public COption_NoneZ get_require_confirmed_inputs() {
444                 COption_NoneZ ret = bindings.OpenChannelV2_get_require_confirmed_inputs(this.ptr);
445                 GC.KeepAlive(this);
446                 return ret;
447         }
448
449         /**
450          * Optionally, a requirement that only confirmed inputs can be added
451          */
452         public void set_require_confirmed_inputs(COption_NoneZ val) {
453                 bindings.OpenChannelV2_set_require_confirmed_inputs(this.ptr, val);
454                 GC.KeepAlive(this);
455                 GC.KeepAlive(val);
456         }
457
458         /**
459          * Constructs a new OpenChannelV2 given each field
460          * 
461          * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
462          */
463         public static OpenChannelV2 of(byte[] chain_hash_arg, byte[] temporary_channel_id_arg, int funding_feerate_sat_per_1000_weight_arg, int commitment_feerate_sat_per_1000_weight_arg, long funding_satoshis_arg, long dust_limit_satoshis_arg, long max_htlc_value_in_flight_msat_arg, long htlc_minimum_msat_arg, short to_self_delay_arg, short max_accepted_htlcs_arg, int locktime_arg, byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_basepoint_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg, byte[] first_per_commitment_point_arg, byte[] second_per_commitment_point_arg, byte channel_flags_arg, org.ldk.structs.Option_CVec_u8ZZ shutdown_scriptpubkey_arg, org.ldk.structs.ChannelTypeFeatures channel_type_arg, COption_NoneZ require_confirmed_inputs_arg) {
464                 long ret = bindings.OpenChannelV2_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(chain_hash_arg, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(temporary_channel_id_arg, 32)), funding_feerate_sat_per_1000_weight_arg, commitment_feerate_sat_per_1000_weight_arg, funding_satoshis_arg, dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, htlc_minimum_msat_arg, to_self_delay_arg, max_accepted_htlcs_arg, locktime_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(revocation_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(delayed_payment_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(htlc_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(first_per_commitment_point_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(second_per_commitment_point_arg, 33)), channel_flags_arg, shutdown_scriptpubkey_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr, require_confirmed_inputs_arg);
465                 GC.KeepAlive(chain_hash_arg);
466                 GC.KeepAlive(temporary_channel_id_arg);
467                 GC.KeepAlive(funding_feerate_sat_per_1000_weight_arg);
468                 GC.KeepAlive(commitment_feerate_sat_per_1000_weight_arg);
469                 GC.KeepAlive(funding_satoshis_arg);
470                 GC.KeepAlive(dust_limit_satoshis_arg);
471                 GC.KeepAlive(max_htlc_value_in_flight_msat_arg);
472                 GC.KeepAlive(htlc_minimum_msat_arg);
473                 GC.KeepAlive(to_self_delay_arg);
474                 GC.KeepAlive(max_accepted_htlcs_arg);
475                 GC.KeepAlive(locktime_arg);
476                 GC.KeepAlive(funding_pubkey_arg);
477                 GC.KeepAlive(revocation_basepoint_arg);
478                 GC.KeepAlive(payment_basepoint_arg);
479                 GC.KeepAlive(delayed_payment_basepoint_arg);
480                 GC.KeepAlive(htlc_basepoint_arg);
481                 GC.KeepAlive(first_per_commitment_point_arg);
482                 GC.KeepAlive(second_per_commitment_point_arg);
483                 GC.KeepAlive(channel_flags_arg);
484                 GC.KeepAlive(shutdown_scriptpubkey_arg);
485                 GC.KeepAlive(channel_type_arg);
486                 GC.KeepAlive(require_confirmed_inputs_arg);
487                 if (ret >= 0 && ret <= 4096) { return null; }
488                 org.ldk.structs.OpenChannelV2 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OpenChannelV2(null, ret); }
489                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
490                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(shutdown_scriptpubkey_arg); };
491                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type_arg); };
492                 return ret_hu_conv;
493         }
494
495         internal long clone_ptr() {
496                 long ret = bindings.OpenChannelV2_clone_ptr(this.ptr);
497                 GC.KeepAlive(this);
498                 return ret;
499         }
500
501         /**
502          * Creates a copy of the OpenChannelV2
503          */
504         public OpenChannelV2 clone() {
505                 long ret = bindings.OpenChannelV2_clone(this.ptr);
506                 GC.KeepAlive(this);
507                 if (ret >= 0 && ret <= 4096) { return null; }
508                 org.ldk.structs.OpenChannelV2 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OpenChannelV2(null, ret); }
509                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
510                 return ret_hu_conv;
511         }
512
513         /**
514          * Checks if two OpenChannelV2s contain equal inner contents.
515          * This ignores pointers and is_owned flags and looks at the values in fields.
516          * Two objects with NULL inner values will be considered "equal" here.
517          */
518         public bool eq(org.ldk.structs.OpenChannelV2 b) {
519                 bool ret = bindings.OpenChannelV2_eq(this.ptr, b == null ? 0 : b.ptr);
520                 GC.KeepAlive(this);
521                 GC.KeepAlive(b);
522                 if (this != null) { this.ptrs_to.AddLast(b); };
523                 return ret;
524         }
525
526         public override bool Equals(object o) {
527                 if (!(o is OpenChannelV2)) return false;
528                 return this.eq((OpenChannelV2)o);
529         }
530         /**
531          * Serialize the OpenChannelV2 object into a byte array which can be read by OpenChannelV2_read
532          */
533         public byte[] write() {
534                 long ret = bindings.OpenChannelV2_write(this.ptr);
535                 GC.KeepAlive(this);
536                 if (ret >= 0 && ret <= 4096) { return null; }
537                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
538                 return ret_conv;
539         }
540
541         /**
542          * Read a OpenChannelV2 from a byte array, created by OpenChannelV2_write
543          */
544         public static Result_OpenChannelV2DecodeErrorZ read(byte[] ser) {
545                 long ret = bindings.OpenChannelV2_read(InternalUtils.encodeUint8Array(ser));
546                 GC.KeepAlive(ser);
547                 if (ret >= 0 && ret <= 4096) { return null; }
548                 Result_OpenChannelV2DecodeErrorZ ret_hu_conv = Result_OpenChannelV2DecodeErrorZ.constr_from_ptr(ret);
549                 return ret_hu_conv;
550         }
551
552 }
553 } } }