6 namespace org { namespace ldk { namespace structs {
10 * Features used within a `node_announcement` message.
12 public class NodeFeatures : CommonBase {
13 internal NodeFeatures(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.NodeFeatures_free(ptr); }
19 * Checks if two NodeFeaturess 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.NodeFeatures b) {
24 bool ret = bindings.NodeFeatures_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 NodeFeatures)) return false;
33 return this.eq((NodeFeatures)o);
35 internal long clone_ptr() {
36 long ret = bindings.NodeFeatures_clone_ptr(this.ptr);
42 * Creates a copy of the NodeFeatures
44 public NodeFeatures clone() {
45 long ret = bindings.NodeFeatures_clone(this.ptr);
47 if (ret >= 0 && ret <= 4096) { return null; }
48 org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(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 NodeFeatures empty() {
57 long ret = bindings.NodeFeatures_empty();
58 if (ret >= 0 && ret <= 4096) { return null; }
59 org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(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 unknown feature flags which are set as
68 public bool requires_unknown_bits() {
69 bool ret = bindings.NodeFeatures_requires_unknown_bits(this.ptr);
75 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
77 public byte[] write() {
78 byte[] ret = bindings.NodeFeatures_write(this.ptr);
84 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
86 public static Result_NodeFeaturesDecodeErrorZ read(byte[] ser) {
87 long ret = bindings.NodeFeatures_read(ser);
89 if (ret >= 0 && ret <= 4096) { return null; }
90 Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret);
95 * Set this feature as optional.
97 public void set_data_loss_protect_optional() {
98 bindings.NodeFeatures_set_data_loss_protect_optional(this.ptr);
103 * Set this feature as required.
105 public void set_data_loss_protect_required() {
106 bindings.NodeFeatures_set_data_loss_protect_required(this.ptr);
111 * Checks if this feature is supported.
113 public bool supports_data_loss_protect() {
114 bool ret = bindings.NodeFeatures_supports_data_loss_protect(this.ptr);
120 * Checks if this feature is required.
122 public bool requires_data_loss_protect() {
123 bool ret = bindings.NodeFeatures_requires_data_loss_protect(this.ptr);
129 * Set this feature as optional.
131 public void set_upfront_shutdown_script_optional() {
132 bindings.NodeFeatures_set_upfront_shutdown_script_optional(this.ptr);
137 * Set this feature as required.
139 public void set_upfront_shutdown_script_required() {
140 bindings.NodeFeatures_set_upfront_shutdown_script_required(this.ptr);
145 * Checks if this feature is supported.
147 public bool supports_upfront_shutdown_script() {
148 bool ret = bindings.NodeFeatures_supports_upfront_shutdown_script(this.ptr);
154 * Checks if this feature is required.
156 public bool requires_upfront_shutdown_script() {
157 bool ret = bindings.NodeFeatures_requires_upfront_shutdown_script(this.ptr);
163 * Set this feature as optional.
165 public void set_gossip_queries_optional() {
166 bindings.NodeFeatures_set_gossip_queries_optional(this.ptr);
171 * Set this feature as required.
173 public void set_gossip_queries_required() {
174 bindings.NodeFeatures_set_gossip_queries_required(this.ptr);
179 * Checks if this feature is supported.
181 public bool supports_gossip_queries() {
182 bool ret = bindings.NodeFeatures_supports_gossip_queries(this.ptr);
188 * Checks if this feature is required.
190 public bool requires_gossip_queries() {
191 bool ret = bindings.NodeFeatures_requires_gossip_queries(this.ptr);
197 * Set this feature as optional.
199 public void set_variable_length_onion_optional() {
200 bindings.NodeFeatures_set_variable_length_onion_optional(this.ptr);
205 * Set this feature as required.
207 public void set_variable_length_onion_required() {
208 bindings.NodeFeatures_set_variable_length_onion_required(this.ptr);
213 * Checks if this feature is supported.
215 public bool supports_variable_length_onion() {
216 bool ret = bindings.NodeFeatures_supports_variable_length_onion(this.ptr);
222 * Checks if this feature is required.
224 public bool requires_variable_length_onion() {
225 bool ret = bindings.NodeFeatures_requires_variable_length_onion(this.ptr);
231 * Set this feature as optional.
233 public void set_static_remote_key_optional() {
234 bindings.NodeFeatures_set_static_remote_key_optional(this.ptr);
239 * Set this feature as required.
241 public void set_static_remote_key_required() {
242 bindings.NodeFeatures_set_static_remote_key_required(this.ptr);
247 * Checks if this feature is supported.
249 public bool supports_static_remote_key() {
250 bool ret = bindings.NodeFeatures_supports_static_remote_key(this.ptr);
256 * Checks if this feature is required.
258 public bool requires_static_remote_key() {
259 bool ret = bindings.NodeFeatures_requires_static_remote_key(this.ptr);
265 * Set this feature as optional.
267 public void set_payment_secret_optional() {
268 bindings.NodeFeatures_set_payment_secret_optional(this.ptr);
273 * Set this feature as required.
275 public void set_payment_secret_required() {
276 bindings.NodeFeatures_set_payment_secret_required(this.ptr);
281 * Checks if this feature is supported.
283 public bool supports_payment_secret() {
284 bool ret = bindings.NodeFeatures_supports_payment_secret(this.ptr);
290 * Checks if this feature is required.
292 public bool requires_payment_secret() {
293 bool ret = bindings.NodeFeatures_requires_payment_secret(this.ptr);
299 * Set this feature as optional.
301 public void set_basic_mpp_optional() {
302 bindings.NodeFeatures_set_basic_mpp_optional(this.ptr);
307 * Set this feature as required.
309 public void set_basic_mpp_required() {
310 bindings.NodeFeatures_set_basic_mpp_required(this.ptr);
315 * Checks if this feature is supported.
317 public bool supports_basic_mpp() {
318 bool ret = bindings.NodeFeatures_supports_basic_mpp(this.ptr);
324 * Checks if this feature is required.
326 public bool requires_basic_mpp() {
327 bool ret = bindings.NodeFeatures_requires_basic_mpp(this.ptr);
333 * Set this feature as optional.
335 public void set_wumbo_optional() {
336 bindings.NodeFeatures_set_wumbo_optional(this.ptr);
341 * Set this feature as required.
343 public void set_wumbo_required() {
344 bindings.NodeFeatures_set_wumbo_required(this.ptr);
349 * Checks if this feature is supported.
351 public bool supports_wumbo() {
352 bool ret = bindings.NodeFeatures_supports_wumbo(this.ptr);
358 * Checks if this feature is required.
360 public bool requires_wumbo() {
361 bool ret = bindings.NodeFeatures_requires_wumbo(this.ptr);
367 * Set this feature as optional.
369 public void set_shutdown_any_segwit_optional() {
370 bindings.NodeFeatures_set_shutdown_any_segwit_optional(this.ptr);
375 * Set this feature as required.
377 public void set_shutdown_any_segwit_required() {
378 bindings.NodeFeatures_set_shutdown_any_segwit_required(this.ptr);
383 * Checks if this feature is supported.
385 public bool supports_shutdown_anysegwit() {
386 bool ret = bindings.NodeFeatures_supports_shutdown_anysegwit(this.ptr);
392 * Checks if this feature is required.
394 public bool requires_shutdown_anysegwit() {
395 bool ret = bindings.NodeFeatures_requires_shutdown_anysegwit(this.ptr);
401 * Set this feature as optional.
403 public void set_onion_messages_optional() {
404 bindings.NodeFeatures_set_onion_messages_optional(this.ptr);
409 * Set this feature as required.
411 public void set_onion_messages_required() {
412 bindings.NodeFeatures_set_onion_messages_required(this.ptr);
417 * Checks if this feature is supported.
419 public bool supports_onion_messages() {
420 bool ret = bindings.NodeFeatures_supports_onion_messages(this.ptr);
426 * Checks if this feature is required.
428 public bool requires_onion_messages() {
429 bool ret = bindings.NodeFeatures_requires_onion_messages(this.ptr);
435 * Set this feature as optional.
437 public void set_channel_type_optional() {
438 bindings.NodeFeatures_set_channel_type_optional(this.ptr);
443 * Set this feature as required.
445 public void set_channel_type_required() {
446 bindings.NodeFeatures_set_channel_type_required(this.ptr);
451 * Checks if this feature is supported.
453 public bool supports_channel_type() {
454 bool ret = bindings.NodeFeatures_supports_channel_type(this.ptr);
460 * Checks if this feature is required.
462 public bool requires_channel_type() {
463 bool ret = bindings.NodeFeatures_requires_channel_type(this.ptr);
469 * Set this feature as optional.
471 public void set_scid_privacy_optional() {
472 bindings.NodeFeatures_set_scid_privacy_optional(this.ptr);
477 * Set this feature as required.
479 public void set_scid_privacy_required() {
480 bindings.NodeFeatures_set_scid_privacy_required(this.ptr);
485 * Checks if this feature is supported.
487 public bool supports_scid_privacy() {
488 bool ret = bindings.NodeFeatures_supports_scid_privacy(this.ptr);
494 * Checks if this feature is required.
496 public bool requires_scid_privacy() {
497 bool ret = bindings.NodeFeatures_requires_scid_privacy(this.ptr);
503 * Set this feature as optional.
505 public void set_zero_conf_optional() {
506 bindings.NodeFeatures_set_zero_conf_optional(this.ptr);
511 * Set this feature as required.
513 public void set_zero_conf_required() {
514 bindings.NodeFeatures_set_zero_conf_required(this.ptr);
519 * Checks if this feature is supported.
521 public bool supports_zero_conf() {
522 bool ret = bindings.NodeFeatures_supports_zero_conf(this.ptr);
528 * Checks if this feature is required.
530 public bool requires_zero_conf() {
531 bool ret = bindings.NodeFeatures_requires_zero_conf(this.ptr);
537 * Set this feature as optional.
539 public void set_keysend_optional() {
540 bindings.NodeFeatures_set_keysend_optional(this.ptr);
545 * Set this feature as required.
547 public void set_keysend_required() {
548 bindings.NodeFeatures_set_keysend_required(this.ptr);
553 * Checks if this feature is supported.
555 public bool supports_keysend() {
556 bool ret = bindings.NodeFeatures_supports_keysend(this.ptr);
562 * Checks if this feature is required.
564 public bool requires_keysend() {
565 bool ret = bindings.NodeFeatures_requires_keysend(this.ptr);