6 namespace org { namespace ldk { namespace structs {
10 * The unsigned part of a node_announcement
12 public class UnsignedNodeAnnouncement : CommonBase {
13 internal UnsignedNodeAnnouncement(object _dummy, long ptr) : base(ptr) { }
14 ~UnsignedNodeAnnouncement() {
15 if (ptr != 0) { bindings.UnsignedNodeAnnouncement_free(ptr); }
19 * The advertised features
21 public NodeFeatures get_features() {
22 long ret = bindings.UnsignedNodeAnnouncement_get_features(this.ptr);
24 if (ret >= 0 && ret <= 4096) { return null; }
25 org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); }
26 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
31 * The advertised features
33 public void set_features(org.ldk.structs.NodeFeatures val) {
34 bindings.UnsignedNodeAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr);
37 if (this != null) { this.ptrs_to.AddLast(val); };
41 * A strictly monotonic announcement counter, with gaps allowed
43 public int get_timestamp() {
44 int ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this.ptr);
50 * A strictly monotonic announcement counter, with gaps allowed
52 public void set_timestamp(int val) {
53 bindings.UnsignedNodeAnnouncement_set_timestamp(this.ptr, val);
59 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
62 public byte[] get_node_id() {
63 byte[] ret = bindings.UnsignedNodeAnnouncement_get_node_id(this.ptr);
69 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
72 public void set_node_id(byte[] val) {
73 bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, InternalUtils.check_arr_len(val, 33));
79 * An RGB color for UI purposes
81 public byte[] get_rgb() {
82 byte[] ret = bindings.UnsignedNodeAnnouncement_get_rgb(this.ptr);
88 * An RGB color for UI purposes
90 public void set_rgb(byte[] val) {
91 bindings.UnsignedNodeAnnouncement_set_rgb(this.ptr, InternalUtils.check_arr_len(val, 3));
97 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
100 public byte[] get_alias() {
101 byte[] ret = bindings.UnsignedNodeAnnouncement_get_alias(this.ptr);
107 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
110 public void set_alias(byte[] val) {
111 bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, InternalUtils.check_arr_len(val, 32));
117 * List of addresses on which this node is reachable
119 * Returns a copy of the field.
121 public NetAddress[] get_addresses() {
122 long[] ret = bindings.UnsignedNodeAnnouncement_get_addresses(this.ptr);
124 int ret_conv_12_len = ret.Length;
125 NetAddress[] ret_conv_12_arr = new NetAddress[ret_conv_12_len];
126 for (int m = 0; m < ret_conv_12_len; m++) {
127 long ret_conv_12 = ret[m];
128 org.ldk.structs.NetAddress ret_conv_12_hu_conv = org.ldk.structs.NetAddress.constr_from_ptr(ret_conv_12);
129 if (ret_conv_12_hu_conv != null) { ret_conv_12_hu_conv.ptrs_to.AddLast(this); };
130 ret_conv_12_arr[m] = ret_conv_12_hu_conv;
132 return ret_conv_12_arr;
136 * List of addresses on which this node is reachable
138 public void set_addresses(NetAddress[] val) {
139 bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, val != null ? InternalUtils.mapArray(val, val_conv_12 => val_conv_12.ptr) : null);
144 internal long clone_ptr() {
145 long ret = bindings.UnsignedNodeAnnouncement_clone_ptr(this.ptr);
151 * Creates a copy of the UnsignedNodeAnnouncement
153 public UnsignedNodeAnnouncement clone() {
154 long ret = bindings.UnsignedNodeAnnouncement_clone(this.ptr);
156 if (ret >= 0 && ret <= 4096) { return null; }
157 org.ldk.structs.UnsignedNodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedNodeAnnouncement(null, ret); }
158 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
163 * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
164 * This ignores pointers and is_owned flags and looks at the values in fields.
165 * Two objects with NULL inner values will be considered "equal" here.
167 public bool eq(org.ldk.structs.UnsignedNodeAnnouncement b) {
168 bool ret = bindings.UnsignedNodeAnnouncement_eq(this.ptr, b == null ? 0 : b.ptr);
171 if (this != null) { this.ptrs_to.AddLast(b); };
175 public override bool Equals(object o) {
176 if (!(o is UnsignedNodeAnnouncement)) return false;
177 return this.eq((UnsignedNodeAnnouncement)o);
180 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
182 public byte[] write() {
183 byte[] ret = bindings.UnsignedNodeAnnouncement_write(this.ptr);
189 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
191 public static Result_UnsignedNodeAnnouncementDecodeErrorZ read(byte[] ser) {
192 long ret = bindings.UnsignedNodeAnnouncement_read(ser);
194 if (ret >= 0 && ret <= 4096) { return null; }
195 Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);