[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / InitFeatures.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  * Features used within an `init` message.
11  */
12 public class InitFeatures : CommonBase {
13         internal InitFeatures(object _dummy, long ptr) : base(ptr) { }
14         ~InitFeatures() {
15                 if (ptr != 0) { bindings.InitFeatures_free(ptr); }
16         }
17
18         /**
19          * Checks if two InitFeaturess contain equal inner contents.
20          * This ignores pointers and is_owned flags and looks at the values in fields.
21          * Two objects with NULL inner values will be considered "equal" here.
22          */
23         public bool eq(org.ldk.structs.InitFeatures b) {
24                 bool ret = bindings.InitFeatures_eq(this.ptr, b == null ? 0 : b.ptr);
25                 GC.KeepAlive(this);
26                 GC.KeepAlive(b);
27                 if (this != null) { this.ptrs_to.AddLast(b); };
28                 return ret;
29         }
30
31         public override bool Equals(object o) {
32                 if (!(o is InitFeatures)) return false;
33                 return this.eq((InitFeatures)o);
34         }
35         internal long clone_ptr() {
36                 long ret = bindings.InitFeatures_clone_ptr(this.ptr);
37                 GC.KeepAlive(this);
38                 return ret;
39         }
40
41         /**
42          * Creates a copy of the InitFeatures
43          */
44         public InitFeatures clone() {
45                 long ret = bindings.InitFeatures_clone(this.ptr);
46                 GC.KeepAlive(this);
47                 if (ret >= 0 && ret <= 4096) { return null; }
48                 org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); }
49                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
50                 return ret_hu_conv;
51         }
52
53         /**
54          * Create a blank Features with no features set
55          */
56         public static InitFeatures empty() {
57                 long ret = bindings.InitFeatures_empty();
58                 if (ret >= 0 && ret <= 4096) { return null; }
59                 org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); }
60                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
61                 return ret_hu_conv;
62         }
63
64         /**
65          * Returns true if this `Features` object contains required features unknown by `other`.
66          */
67         public bool requires_unknown_bits_from(org.ldk.structs.InitFeatures other) {
68                 bool ret = bindings.InitFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr);
69                 GC.KeepAlive(this);
70                 GC.KeepAlive(other);
71                 if (this != null) { this.ptrs_to.AddLast(other); };
72                 return ret;
73         }
74
75         /**
76          * Returns true if this `Features` object contains unknown feature flags which are set as
77          * \"required\".
78          */
79         public bool requires_unknown_bits() {
80                 bool ret = bindings.InitFeatures_requires_unknown_bits(this.ptr);
81                 GC.KeepAlive(this);
82                 return ret;
83         }
84
85         /**
86          * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
87          * by [BOLT 9].
88          * 
89          * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
90          * be set instead (i.e., `bit - 1`).
91          * 
92          * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
93          */
94         public Result_NoneNoneZ set_required_feature_bit(long bit) {
95                 long ret = bindings.InitFeatures_set_required_feature_bit(this.ptr, bit);
96                 GC.KeepAlive(this);
97                 GC.KeepAlive(bit);
98                 if (ret >= 0 && ret <= 4096) { return null; }
99                 Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
100                 return ret_hu_conv;
101         }
102
103         /**
104          * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
105          * by [BOLT 9].
106          * 
107          * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
108          * set instead (i.e., `bit + 1`).
109          * 
110          * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
111          */
112         public Result_NoneNoneZ set_optional_feature_bit(long bit) {
113                 long ret = bindings.InitFeatures_set_optional_feature_bit(this.ptr, bit);
114                 GC.KeepAlive(this);
115                 GC.KeepAlive(bit);
116                 if (ret >= 0 && ret <= 4096) { return null; }
117                 Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
118                 return ret_hu_conv;
119         }
120
121         /**
122          * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
123          * by [bLIP 2] or if it is a known `T` feature.
124          * 
125          * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
126          * be set instead (i.e., `bit - 1`).
127          * 
128          * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
129          */
130         public Result_NoneNoneZ set_required_custom_bit(long bit) {
131                 long ret = bindings.InitFeatures_set_required_custom_bit(this.ptr, bit);
132                 GC.KeepAlive(this);
133                 GC.KeepAlive(bit);
134                 if (ret >= 0 && ret <= 4096) { return null; }
135                 Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
136                 return ret_hu_conv;
137         }
138
139         /**
140          * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
141          * by [bLIP 2] or if it is a known `T` feature.
142          * 
143          * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
144          * set instead (i.e., `bit + 1`).
145          * 
146          * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
147          */
148         public Result_NoneNoneZ set_optional_custom_bit(long bit) {
149                 long ret = bindings.InitFeatures_set_optional_custom_bit(this.ptr, bit);
150                 GC.KeepAlive(this);
151                 GC.KeepAlive(bit);
152                 if (ret >= 0 && ret <= 4096) { return null; }
153                 Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
154                 return ret_hu_conv;
155         }
156
157         /**
158          * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
159          */
160         public byte[] write() {
161                 long ret = bindings.InitFeatures_write(this.ptr);
162                 GC.KeepAlive(this);
163                 if (ret >= 0 && ret <= 4096) { return null; }
164                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
165                 return ret_conv;
166         }
167
168         /**
169          * Read a InitFeatures from a byte array, created by InitFeatures_write
170          */
171         public static Result_InitFeaturesDecodeErrorZ read(byte[] ser) {
172                 long ret = bindings.InitFeatures_read(InternalUtils.encodeUint8Array(ser));
173                 GC.KeepAlive(ser);
174                 if (ret >= 0 && ret <= 4096) { return null; }
175                 Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret);
176                 return ret_hu_conv;
177         }
178
179         /**
180          * Set this feature as optional.
181          */
182         public void set_data_loss_protect_optional() {
183                 bindings.InitFeatures_set_data_loss_protect_optional(this.ptr);
184                 GC.KeepAlive(this);
185         }
186
187         /**
188          * Set this feature as required.
189          */
190         public void set_data_loss_protect_required() {
191                 bindings.InitFeatures_set_data_loss_protect_required(this.ptr);
192                 GC.KeepAlive(this);
193         }
194
195         /**
196          * Checks if this feature is supported.
197          */
198         public bool supports_data_loss_protect() {
199                 bool ret = bindings.InitFeatures_supports_data_loss_protect(this.ptr);
200                 GC.KeepAlive(this);
201                 return ret;
202         }
203
204         /**
205          * Checks if this feature is required.
206          */
207         public bool requires_data_loss_protect() {
208                 bool ret = bindings.InitFeatures_requires_data_loss_protect(this.ptr);
209                 GC.KeepAlive(this);
210                 return ret;
211         }
212
213         /**
214          * Set this feature as optional.
215          */
216         public void set_initial_routing_sync_optional() {
217                 bindings.InitFeatures_set_initial_routing_sync_optional(this.ptr);
218                 GC.KeepAlive(this);
219         }
220
221         /**
222          * Set this feature as required.
223          */
224         public void set_initial_routing_sync_required() {
225                 bindings.InitFeatures_set_initial_routing_sync_required(this.ptr);
226                 GC.KeepAlive(this);
227         }
228
229         /**
230          * Checks if this feature is supported.
231          */
232         public bool initial_routing_sync() {
233                 bool ret = bindings.InitFeatures_initial_routing_sync(this.ptr);
234                 GC.KeepAlive(this);
235                 return ret;
236         }
237
238         /**
239          * Set this feature as optional.
240          */
241         public void set_upfront_shutdown_script_optional() {
242                 bindings.InitFeatures_set_upfront_shutdown_script_optional(this.ptr);
243                 GC.KeepAlive(this);
244         }
245
246         /**
247          * Set this feature as required.
248          */
249         public void set_upfront_shutdown_script_required() {
250                 bindings.InitFeatures_set_upfront_shutdown_script_required(this.ptr);
251                 GC.KeepAlive(this);
252         }
253
254         /**
255          * Checks if this feature is supported.
256          */
257         public bool supports_upfront_shutdown_script() {
258                 bool ret = bindings.InitFeatures_supports_upfront_shutdown_script(this.ptr);
259                 GC.KeepAlive(this);
260                 return ret;
261         }
262
263         /**
264          * Checks if this feature is required.
265          */
266         public bool requires_upfront_shutdown_script() {
267                 bool ret = bindings.InitFeatures_requires_upfront_shutdown_script(this.ptr);
268                 GC.KeepAlive(this);
269                 return ret;
270         }
271
272         /**
273          * Set this feature as optional.
274          */
275         public void set_gossip_queries_optional() {
276                 bindings.InitFeatures_set_gossip_queries_optional(this.ptr);
277                 GC.KeepAlive(this);
278         }
279
280         /**
281          * Set this feature as required.
282          */
283         public void set_gossip_queries_required() {
284                 bindings.InitFeatures_set_gossip_queries_required(this.ptr);
285                 GC.KeepAlive(this);
286         }
287
288         /**
289          * Checks if this feature is supported.
290          */
291         public bool supports_gossip_queries() {
292                 bool ret = bindings.InitFeatures_supports_gossip_queries(this.ptr);
293                 GC.KeepAlive(this);
294                 return ret;
295         }
296
297         /**
298          * Checks if this feature is required.
299          */
300         public bool requires_gossip_queries() {
301                 bool ret = bindings.InitFeatures_requires_gossip_queries(this.ptr);
302                 GC.KeepAlive(this);
303                 return ret;
304         }
305
306         /**
307          * Set this feature as optional.
308          */
309         public void set_variable_length_onion_optional() {
310                 bindings.InitFeatures_set_variable_length_onion_optional(this.ptr);
311                 GC.KeepAlive(this);
312         }
313
314         /**
315          * Set this feature as required.
316          */
317         public void set_variable_length_onion_required() {
318                 bindings.InitFeatures_set_variable_length_onion_required(this.ptr);
319                 GC.KeepAlive(this);
320         }
321
322         /**
323          * Checks if this feature is supported.
324          */
325         public bool supports_variable_length_onion() {
326                 bool ret = bindings.InitFeatures_supports_variable_length_onion(this.ptr);
327                 GC.KeepAlive(this);
328                 return ret;
329         }
330
331         /**
332          * Checks if this feature is required.
333          */
334         public bool requires_variable_length_onion() {
335                 bool ret = bindings.InitFeatures_requires_variable_length_onion(this.ptr);
336                 GC.KeepAlive(this);
337                 return ret;
338         }
339
340         /**
341          * Set this feature as optional.
342          */
343         public void set_static_remote_key_optional() {
344                 bindings.InitFeatures_set_static_remote_key_optional(this.ptr);
345                 GC.KeepAlive(this);
346         }
347
348         /**
349          * Set this feature as required.
350          */
351         public void set_static_remote_key_required() {
352                 bindings.InitFeatures_set_static_remote_key_required(this.ptr);
353                 GC.KeepAlive(this);
354         }
355
356         /**
357          * Checks if this feature is supported.
358          */
359         public bool supports_static_remote_key() {
360                 bool ret = bindings.InitFeatures_supports_static_remote_key(this.ptr);
361                 GC.KeepAlive(this);
362                 return ret;
363         }
364
365         /**
366          * Checks if this feature is required.
367          */
368         public bool requires_static_remote_key() {
369                 bool ret = bindings.InitFeatures_requires_static_remote_key(this.ptr);
370                 GC.KeepAlive(this);
371                 return ret;
372         }
373
374         /**
375          * Set this feature as optional.
376          */
377         public void set_payment_secret_optional() {
378                 bindings.InitFeatures_set_payment_secret_optional(this.ptr);
379                 GC.KeepAlive(this);
380         }
381
382         /**
383          * Set this feature as required.
384          */
385         public void set_payment_secret_required() {
386                 bindings.InitFeatures_set_payment_secret_required(this.ptr);
387                 GC.KeepAlive(this);
388         }
389
390         /**
391          * Checks if this feature is supported.
392          */
393         public bool supports_payment_secret() {
394                 bool ret = bindings.InitFeatures_supports_payment_secret(this.ptr);
395                 GC.KeepAlive(this);
396                 return ret;
397         }
398
399         /**
400          * Checks if this feature is required.
401          */
402         public bool requires_payment_secret() {
403                 bool ret = bindings.InitFeatures_requires_payment_secret(this.ptr);
404                 GC.KeepAlive(this);
405                 return ret;
406         }
407
408         /**
409          * Set this feature as optional.
410          */
411         public void set_basic_mpp_optional() {
412                 bindings.InitFeatures_set_basic_mpp_optional(this.ptr);
413                 GC.KeepAlive(this);
414         }
415
416         /**
417          * Set this feature as required.
418          */
419         public void set_basic_mpp_required() {
420                 bindings.InitFeatures_set_basic_mpp_required(this.ptr);
421                 GC.KeepAlive(this);
422         }
423
424         /**
425          * Checks if this feature is supported.
426          */
427         public bool supports_basic_mpp() {
428                 bool ret = bindings.InitFeatures_supports_basic_mpp(this.ptr);
429                 GC.KeepAlive(this);
430                 return ret;
431         }
432
433         /**
434          * Checks if this feature is required.
435          */
436         public bool requires_basic_mpp() {
437                 bool ret = bindings.InitFeatures_requires_basic_mpp(this.ptr);
438                 GC.KeepAlive(this);
439                 return ret;
440         }
441
442         /**
443          * Set this feature as optional.
444          */
445         public void set_wumbo_optional() {
446                 bindings.InitFeatures_set_wumbo_optional(this.ptr);
447                 GC.KeepAlive(this);
448         }
449
450         /**
451          * Set this feature as required.
452          */
453         public void set_wumbo_required() {
454                 bindings.InitFeatures_set_wumbo_required(this.ptr);
455                 GC.KeepAlive(this);
456         }
457
458         /**
459          * Checks if this feature is supported.
460          */
461         public bool supports_wumbo() {
462                 bool ret = bindings.InitFeatures_supports_wumbo(this.ptr);
463                 GC.KeepAlive(this);
464                 return ret;
465         }
466
467         /**
468          * Checks if this feature is required.
469          */
470         public bool requires_wumbo() {
471                 bool ret = bindings.InitFeatures_requires_wumbo(this.ptr);
472                 GC.KeepAlive(this);
473                 return ret;
474         }
475
476         /**
477          * Set this feature as optional.
478          */
479         public void set_anchors_nonzero_fee_htlc_tx_optional() {
480                 bindings.InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(this.ptr);
481                 GC.KeepAlive(this);
482         }
483
484         /**
485          * Set this feature as required.
486          */
487         public void set_anchors_nonzero_fee_htlc_tx_required() {
488                 bindings.InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(this.ptr);
489                 GC.KeepAlive(this);
490         }
491
492         /**
493          * Checks if this feature is supported.
494          */
495         public bool supports_anchors_nonzero_fee_htlc_tx() {
496                 bool ret = bindings.InitFeatures_supports_anchors_nonzero_fee_htlc_tx(this.ptr);
497                 GC.KeepAlive(this);
498                 return ret;
499         }
500
501         /**
502          * Checks if this feature is required.
503          */
504         public bool requires_anchors_nonzero_fee_htlc_tx() {
505                 bool ret = bindings.InitFeatures_requires_anchors_nonzero_fee_htlc_tx(this.ptr);
506                 GC.KeepAlive(this);
507                 return ret;
508         }
509
510         /**
511          * Set this feature as optional.
512          */
513         public void set_anchors_zero_fee_htlc_tx_optional() {
514                 bindings.InitFeatures_set_anchors_zero_fee_htlc_tx_optional(this.ptr);
515                 GC.KeepAlive(this);
516         }
517
518         /**
519          * Set this feature as required.
520          */
521         public void set_anchors_zero_fee_htlc_tx_required() {
522                 bindings.InitFeatures_set_anchors_zero_fee_htlc_tx_required(this.ptr);
523                 GC.KeepAlive(this);
524         }
525
526         /**
527          * Checks if this feature is supported.
528          */
529         public bool supports_anchors_zero_fee_htlc_tx() {
530                 bool ret = bindings.InitFeatures_supports_anchors_zero_fee_htlc_tx(this.ptr);
531                 GC.KeepAlive(this);
532                 return ret;
533         }
534
535         /**
536          * Checks if this feature is required.
537          */
538         public bool requires_anchors_zero_fee_htlc_tx() {
539                 bool ret = bindings.InitFeatures_requires_anchors_zero_fee_htlc_tx(this.ptr);
540                 GC.KeepAlive(this);
541                 return ret;
542         }
543
544         /**
545          * Set this feature as optional.
546          */
547         public void set_shutdown_any_segwit_optional() {
548                 bindings.InitFeatures_set_shutdown_any_segwit_optional(this.ptr);
549                 GC.KeepAlive(this);
550         }
551
552         /**
553          * Set this feature as required.
554          */
555         public void set_shutdown_any_segwit_required() {
556                 bindings.InitFeatures_set_shutdown_any_segwit_required(this.ptr);
557                 GC.KeepAlive(this);
558         }
559
560         /**
561          * Checks if this feature is supported.
562          */
563         public bool supports_shutdown_anysegwit() {
564                 bool ret = bindings.InitFeatures_supports_shutdown_anysegwit(this.ptr);
565                 GC.KeepAlive(this);
566                 return ret;
567         }
568
569         /**
570          * Checks if this feature is required.
571          */
572         public bool requires_shutdown_anysegwit() {
573                 bool ret = bindings.InitFeatures_requires_shutdown_anysegwit(this.ptr);
574                 GC.KeepAlive(this);
575                 return ret;
576         }
577
578         /**
579          * Set this feature as optional.
580          */
581         public void set_taproot_optional() {
582                 bindings.InitFeatures_set_taproot_optional(this.ptr);
583                 GC.KeepAlive(this);
584         }
585
586         /**
587          * Set this feature as required.
588          */
589         public void set_taproot_required() {
590                 bindings.InitFeatures_set_taproot_required(this.ptr);
591                 GC.KeepAlive(this);
592         }
593
594         /**
595          * Checks if this feature is supported.
596          */
597         public bool supports_taproot() {
598                 bool ret = bindings.InitFeatures_supports_taproot(this.ptr);
599                 GC.KeepAlive(this);
600                 return ret;
601         }
602
603         /**
604          * Checks if this feature is required.
605          */
606         public bool requires_taproot() {
607                 bool ret = bindings.InitFeatures_requires_taproot(this.ptr);
608                 GC.KeepAlive(this);
609                 return ret;
610         }
611
612         /**
613          * Set this feature as optional.
614          */
615         public void set_onion_messages_optional() {
616                 bindings.InitFeatures_set_onion_messages_optional(this.ptr);
617                 GC.KeepAlive(this);
618         }
619
620         /**
621          * Set this feature as required.
622          */
623         public void set_onion_messages_required() {
624                 bindings.InitFeatures_set_onion_messages_required(this.ptr);
625                 GC.KeepAlive(this);
626         }
627
628         /**
629          * Checks if this feature is supported.
630          */
631         public bool supports_onion_messages() {
632                 bool ret = bindings.InitFeatures_supports_onion_messages(this.ptr);
633                 GC.KeepAlive(this);
634                 return ret;
635         }
636
637         /**
638          * Checks if this feature is required.
639          */
640         public bool requires_onion_messages() {
641                 bool ret = bindings.InitFeatures_requires_onion_messages(this.ptr);
642                 GC.KeepAlive(this);
643                 return ret;
644         }
645
646         /**
647          * Set this feature as optional.
648          */
649         public void set_channel_type_optional() {
650                 bindings.InitFeatures_set_channel_type_optional(this.ptr);
651                 GC.KeepAlive(this);
652         }
653
654         /**
655          * Set this feature as required.
656          */
657         public void set_channel_type_required() {
658                 bindings.InitFeatures_set_channel_type_required(this.ptr);
659                 GC.KeepAlive(this);
660         }
661
662         /**
663          * Checks if this feature is supported.
664          */
665         public bool supports_channel_type() {
666                 bool ret = bindings.InitFeatures_supports_channel_type(this.ptr);
667                 GC.KeepAlive(this);
668                 return ret;
669         }
670
671         /**
672          * Checks if this feature is required.
673          */
674         public bool requires_channel_type() {
675                 bool ret = bindings.InitFeatures_requires_channel_type(this.ptr);
676                 GC.KeepAlive(this);
677                 return ret;
678         }
679
680         /**
681          * Set this feature as optional.
682          */
683         public void set_scid_privacy_optional() {
684                 bindings.InitFeatures_set_scid_privacy_optional(this.ptr);
685                 GC.KeepAlive(this);
686         }
687
688         /**
689          * Set this feature as required.
690          */
691         public void set_scid_privacy_required() {
692                 bindings.InitFeatures_set_scid_privacy_required(this.ptr);
693                 GC.KeepAlive(this);
694         }
695
696         /**
697          * Checks if this feature is supported.
698          */
699         public bool supports_scid_privacy() {
700                 bool ret = bindings.InitFeatures_supports_scid_privacy(this.ptr);
701                 GC.KeepAlive(this);
702                 return ret;
703         }
704
705         /**
706          * Checks if this feature is required.
707          */
708         public bool requires_scid_privacy() {
709                 bool ret = bindings.InitFeatures_requires_scid_privacy(this.ptr);
710                 GC.KeepAlive(this);
711                 return ret;
712         }
713
714         /**
715          * Set this feature as optional.
716          */
717         public void set_zero_conf_optional() {
718                 bindings.InitFeatures_set_zero_conf_optional(this.ptr);
719                 GC.KeepAlive(this);
720         }
721
722         /**
723          * Set this feature as required.
724          */
725         public void set_zero_conf_required() {
726                 bindings.InitFeatures_set_zero_conf_required(this.ptr);
727                 GC.KeepAlive(this);
728         }
729
730         /**
731          * Checks if this feature is supported.
732          */
733         public bool supports_zero_conf() {
734                 bool ret = bindings.InitFeatures_supports_zero_conf(this.ptr);
735                 GC.KeepAlive(this);
736                 return ret;
737         }
738
739         /**
740          * Checks if this feature is required.
741          */
742         public bool requires_zero_conf() {
743                 bool ret = bindings.InitFeatures_requires_zero_conf(this.ptr);
744                 GC.KeepAlive(this);
745                 return ret;
746         }
747
748 }
749 } } }