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 custom feature bit. Errors if `bit` is outside the custom range as defined
87 * by [bLIP 2] or if it is a known `T` feature.
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 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
94 public Result_NoneNoneZ set_required_custom_bit(long bit) {
95 long ret = bindings.InitFeatures_set_required_custom_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 custom feature bit. Errors if `bit` is outside the custom range as defined
105 * by [bLIP 2] or if it is a known `T` feature.
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 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
112 public Result_NoneNoneZ set_optional_custom_bit(long bit) {
113 long ret = bindings.InitFeatures_set_optional_custom_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 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
124 public byte[] write() {
125 byte[] ret = bindings.InitFeatures_write(this.ptr);
131 * Read a InitFeatures from a byte array, created by InitFeatures_write
133 public static Result_InitFeaturesDecodeErrorZ read(byte[] ser) {
134 long ret = bindings.InitFeatures_read(ser);
136 if (ret >= 0 && ret <= 4096) { return null; }
137 Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret);
142 * Set this feature as optional.
144 public void set_data_loss_protect_optional() {
145 bindings.InitFeatures_set_data_loss_protect_optional(this.ptr);
150 * Set this feature as required.
152 public void set_data_loss_protect_required() {
153 bindings.InitFeatures_set_data_loss_protect_required(this.ptr);
158 * Checks if this feature is supported.
160 public bool supports_data_loss_protect() {
161 bool ret = bindings.InitFeatures_supports_data_loss_protect(this.ptr);
167 * Checks if this feature is required.
169 public bool requires_data_loss_protect() {
170 bool ret = bindings.InitFeatures_requires_data_loss_protect(this.ptr);
176 * Set this feature as optional.
178 public void set_initial_routing_sync_optional() {
179 bindings.InitFeatures_set_initial_routing_sync_optional(this.ptr);
184 * Set this feature as required.
186 public void set_initial_routing_sync_required() {
187 bindings.InitFeatures_set_initial_routing_sync_required(this.ptr);
192 * Checks if this feature is supported.
194 public bool initial_routing_sync() {
195 bool ret = bindings.InitFeatures_initial_routing_sync(this.ptr);
201 * Set this feature as optional.
203 public void set_upfront_shutdown_script_optional() {
204 bindings.InitFeatures_set_upfront_shutdown_script_optional(this.ptr);
209 * Set this feature as required.
211 public void set_upfront_shutdown_script_required() {
212 bindings.InitFeatures_set_upfront_shutdown_script_required(this.ptr);
217 * Checks if this feature is supported.
219 public bool supports_upfront_shutdown_script() {
220 bool ret = bindings.InitFeatures_supports_upfront_shutdown_script(this.ptr);
226 * Checks if this feature is required.
228 public bool requires_upfront_shutdown_script() {
229 bool ret = bindings.InitFeatures_requires_upfront_shutdown_script(this.ptr);
235 * Set this feature as optional.
237 public void set_gossip_queries_optional() {
238 bindings.InitFeatures_set_gossip_queries_optional(this.ptr);
243 * Set this feature as required.
245 public void set_gossip_queries_required() {
246 bindings.InitFeatures_set_gossip_queries_required(this.ptr);
251 * Checks if this feature is supported.
253 public bool supports_gossip_queries() {
254 bool ret = bindings.InitFeatures_supports_gossip_queries(this.ptr);
260 * Checks if this feature is required.
262 public bool requires_gossip_queries() {
263 bool ret = bindings.InitFeatures_requires_gossip_queries(this.ptr);
269 * Set this feature as optional.
271 public void set_variable_length_onion_optional() {
272 bindings.InitFeatures_set_variable_length_onion_optional(this.ptr);
277 * Set this feature as required.
279 public void set_variable_length_onion_required() {
280 bindings.InitFeatures_set_variable_length_onion_required(this.ptr);
285 * Checks if this feature is supported.
287 public bool supports_variable_length_onion() {
288 bool ret = bindings.InitFeatures_supports_variable_length_onion(this.ptr);
294 * Checks if this feature is required.
296 public bool requires_variable_length_onion() {
297 bool ret = bindings.InitFeatures_requires_variable_length_onion(this.ptr);
303 * Set this feature as optional.
305 public void set_static_remote_key_optional() {
306 bindings.InitFeatures_set_static_remote_key_optional(this.ptr);
311 * Set this feature as required.
313 public void set_static_remote_key_required() {
314 bindings.InitFeatures_set_static_remote_key_required(this.ptr);
319 * Checks if this feature is supported.
321 public bool supports_static_remote_key() {
322 bool ret = bindings.InitFeatures_supports_static_remote_key(this.ptr);
328 * Checks if this feature is required.
330 public bool requires_static_remote_key() {
331 bool ret = bindings.InitFeatures_requires_static_remote_key(this.ptr);
337 * Set this feature as optional.
339 public void set_payment_secret_optional() {
340 bindings.InitFeatures_set_payment_secret_optional(this.ptr);
345 * Set this feature as required.
347 public void set_payment_secret_required() {
348 bindings.InitFeatures_set_payment_secret_required(this.ptr);
353 * Checks if this feature is supported.
355 public bool supports_payment_secret() {
356 bool ret = bindings.InitFeatures_supports_payment_secret(this.ptr);
362 * Checks if this feature is required.
364 public bool requires_payment_secret() {
365 bool ret = bindings.InitFeatures_requires_payment_secret(this.ptr);
371 * Set this feature as optional.
373 public void set_basic_mpp_optional() {
374 bindings.InitFeatures_set_basic_mpp_optional(this.ptr);
379 * Set this feature as required.
381 public void set_basic_mpp_required() {
382 bindings.InitFeatures_set_basic_mpp_required(this.ptr);
387 * Checks if this feature is supported.
389 public bool supports_basic_mpp() {
390 bool ret = bindings.InitFeatures_supports_basic_mpp(this.ptr);
396 * Checks if this feature is required.
398 public bool requires_basic_mpp() {
399 bool ret = bindings.InitFeatures_requires_basic_mpp(this.ptr);
405 * Set this feature as optional.
407 public void set_wumbo_optional() {
408 bindings.InitFeatures_set_wumbo_optional(this.ptr);
413 * Set this feature as required.
415 public void set_wumbo_required() {
416 bindings.InitFeatures_set_wumbo_required(this.ptr);
421 * Checks if this feature is supported.
423 public bool supports_wumbo() {
424 bool ret = bindings.InitFeatures_supports_wumbo(this.ptr);
430 * Checks if this feature is required.
432 public bool requires_wumbo() {
433 bool ret = bindings.InitFeatures_requires_wumbo(this.ptr);
439 * Set this feature as optional.
441 public void set_anchors_nonzero_fee_htlc_tx_optional() {
442 bindings.InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(this.ptr);
447 * Set this feature as required.
449 public void set_anchors_nonzero_fee_htlc_tx_required() {
450 bindings.InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(this.ptr);
455 * Checks if this feature is supported.
457 public bool supports_anchors_nonzero_fee_htlc_tx() {
458 bool ret = bindings.InitFeatures_supports_anchors_nonzero_fee_htlc_tx(this.ptr);
464 * Checks if this feature is required.
466 public bool requires_anchors_nonzero_fee_htlc_tx() {
467 bool ret = bindings.InitFeatures_requires_anchors_nonzero_fee_htlc_tx(this.ptr);
473 * Set this feature as optional.
475 public void set_anchors_zero_fee_htlc_tx_optional() {
476 bindings.InitFeatures_set_anchors_zero_fee_htlc_tx_optional(this.ptr);
481 * Set this feature as required.
483 public void set_anchors_zero_fee_htlc_tx_required() {
484 bindings.InitFeatures_set_anchors_zero_fee_htlc_tx_required(this.ptr);
489 * Checks if this feature is supported.
491 public bool supports_anchors_zero_fee_htlc_tx() {
492 bool ret = bindings.InitFeatures_supports_anchors_zero_fee_htlc_tx(this.ptr);
498 * Checks if this feature is required.
500 public bool requires_anchors_zero_fee_htlc_tx() {
501 bool ret = bindings.InitFeatures_requires_anchors_zero_fee_htlc_tx(this.ptr);
507 * Set this feature as optional.
509 public void set_shutdown_any_segwit_optional() {
510 bindings.InitFeatures_set_shutdown_any_segwit_optional(this.ptr);
515 * Set this feature as required.
517 public void set_shutdown_any_segwit_required() {
518 bindings.InitFeatures_set_shutdown_any_segwit_required(this.ptr);
523 * Checks if this feature is supported.
525 public bool supports_shutdown_anysegwit() {
526 bool ret = bindings.InitFeatures_supports_shutdown_anysegwit(this.ptr);
532 * Checks if this feature is required.
534 public bool requires_shutdown_anysegwit() {
535 bool ret = bindings.InitFeatures_requires_shutdown_anysegwit(this.ptr);
541 * Set this feature as optional.
543 public void set_onion_messages_optional() {
544 bindings.InitFeatures_set_onion_messages_optional(this.ptr);
549 * Set this feature as required.
551 public void set_onion_messages_required() {
552 bindings.InitFeatures_set_onion_messages_required(this.ptr);
557 * Checks if this feature is supported.
559 public bool supports_onion_messages() {
560 bool ret = bindings.InitFeatures_supports_onion_messages(this.ptr);
566 * Checks if this feature is required.
568 public bool requires_onion_messages() {
569 bool ret = bindings.InitFeatures_requires_onion_messages(this.ptr);
575 * Set this feature as optional.
577 public void set_channel_type_optional() {
578 bindings.InitFeatures_set_channel_type_optional(this.ptr);
583 * Set this feature as required.
585 public void set_channel_type_required() {
586 bindings.InitFeatures_set_channel_type_required(this.ptr);
591 * Checks if this feature is supported.
593 public bool supports_channel_type() {
594 bool ret = bindings.InitFeatures_supports_channel_type(this.ptr);
600 * Checks if this feature is required.
602 public bool requires_channel_type() {
603 bool ret = bindings.InitFeatures_requires_channel_type(this.ptr);
609 * Set this feature as optional.
611 public void set_scid_privacy_optional() {
612 bindings.InitFeatures_set_scid_privacy_optional(this.ptr);
617 * Set this feature as required.
619 public void set_scid_privacy_required() {
620 bindings.InitFeatures_set_scid_privacy_required(this.ptr);
625 * Checks if this feature is supported.
627 public bool supports_scid_privacy() {
628 bool ret = bindings.InitFeatures_supports_scid_privacy(this.ptr);
634 * Checks if this feature is required.
636 public bool requires_scid_privacy() {
637 bool ret = bindings.InitFeatures_requires_scid_privacy(this.ptr);
643 * Set this feature as optional.
645 public void set_zero_conf_optional() {
646 bindings.InitFeatures_set_zero_conf_optional(this.ptr);
651 * Set this feature as required.
653 public void set_zero_conf_required() {
654 bindings.InitFeatures_set_zero_conf_required(this.ptr);
659 * Checks if this feature is supported.
661 public bool supports_zero_conf() {
662 bool ret = bindings.InitFeatures_supports_zero_conf(this.ptr);
668 * Checks if this feature is required.
670 public bool requires_zero_conf() {
671 bool ret = bindings.InitFeatures_requires_zero_conf(this.ptr);