6 namespace org { namespace ldk { namespace structs {
10 * Features used within an `init` message.
12 public class InitFeatures : CommonBase {
13 internal InitFeatures(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.InitFeatures_free(ptr); }
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.
23 public bool eq(org.ldk.structs.InitFeatures b) {
24 bool ret = bindings.InitFeatures_eq(this.ptr, b == null ? 0 : b.ptr);
27 if (this != null) { this.ptrs_to.AddLast(b); };
31 public override bool Equals(object o) {
32 if (!(o is InitFeatures)) return false;
33 return this.eq((InitFeatures)o);
35 internal long clone_ptr() {
36 long ret = bindings.InitFeatures_clone_ptr(this.ptr);
42 * Creates a copy of the InitFeatures
44 public InitFeatures clone() {
45 long ret = bindings.InitFeatures_clone(this.ptr);
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); };
54 * Create a blank Features with no features set
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); };
65 * Returns true if this `Features` object contains required features unknown by `other`.
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);
71 if (this != null) { this.ptrs_to.AddLast(other); };
76 * Returns true if this `Features` object contains unknown feature flags which are set as
79 public bool requires_unknown_bits() {
80 bool ret = bindings.InitFeatures_requires_unknown_bits(this.ptr);
86 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
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`).
92 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
94 public Result_NoneNoneZ set_required_feature_bit(long bit) {
95 long ret = bindings.InitFeatures_set_required_feature_bit(this.ptr, bit);
98 if (ret >= 0 && ret <= 4096) { return null; }
99 Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
104 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
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`).
110 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
112 public Result_NoneNoneZ set_optional_feature_bit(long bit) {
113 long ret = bindings.InitFeatures_set_optional_feature_bit(this.ptr, bit);
116 if (ret >= 0 && ret <= 4096) { return null; }
117 Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
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.
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`).
128 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
130 public Result_NoneNoneZ set_required_custom_bit(long bit) {
131 long ret = bindings.InitFeatures_set_required_custom_bit(this.ptr, bit);
134 if (ret >= 0 && ret <= 4096) { return null; }
135 Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
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.
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`).
146 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
148 public Result_NoneNoneZ set_optional_custom_bit(long bit) {
149 long ret = bindings.InitFeatures_set_optional_custom_bit(this.ptr, bit);
152 if (ret >= 0 && ret <= 4096) { return null; }
153 Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
158 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
160 public byte[] write() {
161 long ret = bindings.InitFeatures_write(this.ptr);
163 if (ret >= 0 && ret <= 4096) { return null; }
164 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
169 * Read a InitFeatures from a byte array, created by InitFeatures_write
171 public static Result_InitFeaturesDecodeErrorZ read(byte[] ser) {
172 long ret = bindings.InitFeatures_read(InternalUtils.encodeUint8Array(ser));
174 if (ret >= 0 && ret <= 4096) { return null; }
175 Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret);
180 * Set this feature as optional.
182 public void set_data_loss_protect_optional() {
183 bindings.InitFeatures_set_data_loss_protect_optional(this.ptr);
188 * Set this feature as required.
190 public void set_data_loss_protect_required() {
191 bindings.InitFeatures_set_data_loss_protect_required(this.ptr);
196 * Checks if this feature is supported.
198 public bool supports_data_loss_protect() {
199 bool ret = bindings.InitFeatures_supports_data_loss_protect(this.ptr);
205 * Checks if this feature is required.
207 public bool requires_data_loss_protect() {
208 bool ret = bindings.InitFeatures_requires_data_loss_protect(this.ptr);
214 * Set this feature as optional.
216 public void set_initial_routing_sync_optional() {
217 bindings.InitFeatures_set_initial_routing_sync_optional(this.ptr);
222 * Set this feature as required.
224 public void set_initial_routing_sync_required() {
225 bindings.InitFeatures_set_initial_routing_sync_required(this.ptr);
230 * Checks if this feature is supported.
232 public bool initial_routing_sync() {
233 bool ret = bindings.InitFeatures_initial_routing_sync(this.ptr);
239 * Set this feature as optional.
241 public void set_upfront_shutdown_script_optional() {
242 bindings.InitFeatures_set_upfront_shutdown_script_optional(this.ptr);
247 * Set this feature as required.
249 public void set_upfront_shutdown_script_required() {
250 bindings.InitFeatures_set_upfront_shutdown_script_required(this.ptr);
255 * Checks if this feature is supported.
257 public bool supports_upfront_shutdown_script() {
258 bool ret = bindings.InitFeatures_supports_upfront_shutdown_script(this.ptr);
264 * Checks if this feature is required.
266 public bool requires_upfront_shutdown_script() {
267 bool ret = bindings.InitFeatures_requires_upfront_shutdown_script(this.ptr);
273 * Set this feature as optional.
275 public void set_gossip_queries_optional() {
276 bindings.InitFeatures_set_gossip_queries_optional(this.ptr);
281 * Set this feature as required.
283 public void set_gossip_queries_required() {
284 bindings.InitFeatures_set_gossip_queries_required(this.ptr);
289 * Checks if this feature is supported.
291 public bool supports_gossip_queries() {
292 bool ret = bindings.InitFeatures_supports_gossip_queries(this.ptr);
298 * Checks if this feature is required.
300 public bool requires_gossip_queries() {
301 bool ret = bindings.InitFeatures_requires_gossip_queries(this.ptr);
307 * Set this feature as optional.
309 public void set_variable_length_onion_optional() {
310 bindings.InitFeatures_set_variable_length_onion_optional(this.ptr);
315 * Set this feature as required.
317 public void set_variable_length_onion_required() {
318 bindings.InitFeatures_set_variable_length_onion_required(this.ptr);
323 * Checks if this feature is supported.
325 public bool supports_variable_length_onion() {
326 bool ret = bindings.InitFeatures_supports_variable_length_onion(this.ptr);
332 * Checks if this feature is required.
334 public bool requires_variable_length_onion() {
335 bool ret = bindings.InitFeatures_requires_variable_length_onion(this.ptr);
341 * Set this feature as optional.
343 public void set_static_remote_key_optional() {
344 bindings.InitFeatures_set_static_remote_key_optional(this.ptr);
349 * Set this feature as required.
351 public void set_static_remote_key_required() {
352 bindings.InitFeatures_set_static_remote_key_required(this.ptr);
357 * Checks if this feature is supported.
359 public bool supports_static_remote_key() {
360 bool ret = bindings.InitFeatures_supports_static_remote_key(this.ptr);
366 * Checks if this feature is required.
368 public bool requires_static_remote_key() {
369 bool ret = bindings.InitFeatures_requires_static_remote_key(this.ptr);
375 * Set this feature as optional.
377 public void set_payment_secret_optional() {
378 bindings.InitFeatures_set_payment_secret_optional(this.ptr);
383 * Set this feature as required.
385 public void set_payment_secret_required() {
386 bindings.InitFeatures_set_payment_secret_required(this.ptr);
391 * Checks if this feature is supported.
393 public bool supports_payment_secret() {
394 bool ret = bindings.InitFeatures_supports_payment_secret(this.ptr);
400 * Checks if this feature is required.
402 public bool requires_payment_secret() {
403 bool ret = bindings.InitFeatures_requires_payment_secret(this.ptr);
409 * Set this feature as optional.
411 public void set_basic_mpp_optional() {
412 bindings.InitFeatures_set_basic_mpp_optional(this.ptr);
417 * Set this feature as required.
419 public void set_basic_mpp_required() {
420 bindings.InitFeatures_set_basic_mpp_required(this.ptr);
425 * Checks if this feature is supported.
427 public bool supports_basic_mpp() {
428 bool ret = bindings.InitFeatures_supports_basic_mpp(this.ptr);
434 * Checks if this feature is required.
436 public bool requires_basic_mpp() {
437 bool ret = bindings.InitFeatures_requires_basic_mpp(this.ptr);
443 * Set this feature as optional.
445 public void set_wumbo_optional() {
446 bindings.InitFeatures_set_wumbo_optional(this.ptr);
451 * Set this feature as required.
453 public void set_wumbo_required() {
454 bindings.InitFeatures_set_wumbo_required(this.ptr);
459 * Checks if this feature is supported.
461 public bool supports_wumbo() {
462 bool ret = bindings.InitFeatures_supports_wumbo(this.ptr);
468 * Checks if this feature is required.
470 public bool requires_wumbo() {
471 bool ret = bindings.InitFeatures_requires_wumbo(this.ptr);
477 * Set this feature as optional.
479 public void set_anchors_nonzero_fee_htlc_tx_optional() {
480 bindings.InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(this.ptr);
485 * Set this feature as required.
487 public void set_anchors_nonzero_fee_htlc_tx_required() {
488 bindings.InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(this.ptr);
493 * Checks if this feature is supported.
495 public bool supports_anchors_nonzero_fee_htlc_tx() {
496 bool ret = bindings.InitFeatures_supports_anchors_nonzero_fee_htlc_tx(this.ptr);
502 * Checks if this feature is required.
504 public bool requires_anchors_nonzero_fee_htlc_tx() {
505 bool ret = bindings.InitFeatures_requires_anchors_nonzero_fee_htlc_tx(this.ptr);
511 * Set this feature as optional.
513 public void set_anchors_zero_fee_htlc_tx_optional() {
514 bindings.InitFeatures_set_anchors_zero_fee_htlc_tx_optional(this.ptr);
519 * Set this feature as required.
521 public void set_anchors_zero_fee_htlc_tx_required() {
522 bindings.InitFeatures_set_anchors_zero_fee_htlc_tx_required(this.ptr);
527 * Checks if this feature is supported.
529 public bool supports_anchors_zero_fee_htlc_tx() {
530 bool ret = bindings.InitFeatures_supports_anchors_zero_fee_htlc_tx(this.ptr);
536 * Checks if this feature is required.
538 public bool requires_anchors_zero_fee_htlc_tx() {
539 bool ret = bindings.InitFeatures_requires_anchors_zero_fee_htlc_tx(this.ptr);
545 * Set this feature as optional.
547 public void set_shutdown_any_segwit_optional() {
548 bindings.InitFeatures_set_shutdown_any_segwit_optional(this.ptr);
553 * Set this feature as required.
555 public void set_shutdown_any_segwit_required() {
556 bindings.InitFeatures_set_shutdown_any_segwit_required(this.ptr);
561 * Checks if this feature is supported.
563 public bool supports_shutdown_anysegwit() {
564 bool ret = bindings.InitFeatures_supports_shutdown_anysegwit(this.ptr);
570 * Checks if this feature is required.
572 public bool requires_shutdown_anysegwit() {
573 bool ret = bindings.InitFeatures_requires_shutdown_anysegwit(this.ptr);
579 * Set this feature as optional.
581 public void set_taproot_optional() {
582 bindings.InitFeatures_set_taproot_optional(this.ptr);
587 * Set this feature as required.
589 public void set_taproot_required() {
590 bindings.InitFeatures_set_taproot_required(this.ptr);
595 * Checks if this feature is supported.
597 public bool supports_taproot() {
598 bool ret = bindings.InitFeatures_supports_taproot(this.ptr);
604 * Checks if this feature is required.
606 public bool requires_taproot() {
607 bool ret = bindings.InitFeatures_requires_taproot(this.ptr);
613 * Set this feature as optional.
615 public void set_onion_messages_optional() {
616 bindings.InitFeatures_set_onion_messages_optional(this.ptr);
621 * Set this feature as required.
623 public void set_onion_messages_required() {
624 bindings.InitFeatures_set_onion_messages_required(this.ptr);
629 * Checks if this feature is supported.
631 public bool supports_onion_messages() {
632 bool ret = bindings.InitFeatures_supports_onion_messages(this.ptr);
638 * Checks if this feature is required.
640 public bool requires_onion_messages() {
641 bool ret = bindings.InitFeatures_requires_onion_messages(this.ptr);
647 * Set this feature as optional.
649 public void set_channel_type_optional() {
650 bindings.InitFeatures_set_channel_type_optional(this.ptr);
655 * Set this feature as required.
657 public void set_channel_type_required() {
658 bindings.InitFeatures_set_channel_type_required(this.ptr);
663 * Checks if this feature is supported.
665 public bool supports_channel_type() {
666 bool ret = bindings.InitFeatures_supports_channel_type(this.ptr);
672 * Checks if this feature is required.
674 public bool requires_channel_type() {
675 bool ret = bindings.InitFeatures_requires_channel_type(this.ptr);
681 * Set this feature as optional.
683 public void set_scid_privacy_optional() {
684 bindings.InitFeatures_set_scid_privacy_optional(this.ptr);
689 * Set this feature as required.
691 public void set_scid_privacy_required() {
692 bindings.InitFeatures_set_scid_privacy_required(this.ptr);
697 * Checks if this feature is supported.
699 public bool supports_scid_privacy() {
700 bool ret = bindings.InitFeatures_supports_scid_privacy(this.ptr);
706 * Checks if this feature is required.
708 public bool requires_scid_privacy() {
709 bool ret = bindings.InitFeatures_requires_scid_privacy(this.ptr);
715 * Set this feature as optional.
717 public void set_zero_conf_optional() {
718 bindings.InitFeatures_set_zero_conf_optional(this.ptr);
723 * Set this feature as required.
725 public void set_zero_conf_required() {
726 bindings.InitFeatures_set_zero_conf_required(this.ptr);
731 * Checks if this feature is supported.
733 public bool supports_zero_conf() {
734 bool ret = bindings.InitFeatures_supports_zero_conf(this.ptr);
740 * Checks if this feature is required.
742 public bool requires_zero_conf() {
743 bool ret = bindings.InitFeatures_requires_zero_conf(this.ptr);