6 namespace org { namespace ldk { namespace structs {
10 * The unsigned part of a [`channel_announcement`] message.
12 * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
14 public class UnsignedChannelAnnouncement : CommonBase {
15 internal UnsignedChannelAnnouncement(object _dummy, long ptr) : base(ptr) { }
16 ~UnsignedChannelAnnouncement() {
17 if (ptr != 0) { bindings.UnsignedChannelAnnouncement_free(ptr); }
21 * The advertised channel features
23 public ChannelFeatures get_features() {
24 long ret = bindings.UnsignedChannelAnnouncement_get_features(this.ptr);
26 if (ret >= 0 && ret <= 4096) { return null; }
27 org.ldk.structs.ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelFeatures(null, ret); }
28 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
33 * The advertised channel features
35 public void set_features(org.ldk.structs.ChannelFeatures val) {
36 bindings.UnsignedChannelAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr);
39 if (this != null) { this.ptrs_to.AddLast(val); };
43 * The genesis hash of the blockchain where the channel is to be opened
45 public byte[] get_chain_hash() {
46 byte[] ret = bindings.UnsignedChannelAnnouncement_get_chain_hash(this.ptr);
52 * The genesis hash of the blockchain where the channel is to be opened
54 public void set_chain_hash(byte[] val) {
55 bindings.UnsignedChannelAnnouncement_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
61 * The short channel ID
63 public long get_short_channel_id() {
64 long ret = bindings.UnsignedChannelAnnouncement_get_short_channel_id(this.ptr);
70 * The short channel ID
72 public void set_short_channel_id(long val) {
73 bindings.UnsignedChannelAnnouncement_set_short_channel_id(this.ptr, val);
79 * One of the two `node_id`s which are endpoints of this channel
81 public NodeId get_node_id_1() {
82 long ret = bindings.UnsignedChannelAnnouncement_get_node_id_1(this.ptr);
84 if (ret >= 0 && ret <= 4096) { return null; }
85 org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); }
86 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
91 * One of the two `node_id`s which are endpoints of this channel
93 public void set_node_id_1(org.ldk.structs.NodeId val) {
94 bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, val == null ? 0 : val.ptr);
97 if (this != null) { this.ptrs_to.AddLast(val); };
101 * The other of the two `node_id`s which are endpoints of this channel
103 public NodeId get_node_id_2() {
104 long ret = bindings.UnsignedChannelAnnouncement_get_node_id_2(this.ptr);
106 if (ret >= 0 && ret <= 4096) { return null; }
107 org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); }
108 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
113 * The other of the two `node_id`s which are endpoints of this channel
115 public void set_node_id_2(org.ldk.structs.NodeId val) {
116 bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, val == null ? 0 : val.ptr);
119 if (this != null) { this.ptrs_to.AddLast(val); };
123 * The funding key for the first node
125 public NodeId get_bitcoin_key_1() {
126 long ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_1(this.ptr);
128 if (ret >= 0 && ret <= 4096) { return null; }
129 org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); }
130 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
135 * The funding key for the first node
137 public void set_bitcoin_key_1(org.ldk.structs.NodeId val) {
138 bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, val == null ? 0 : val.ptr);
141 if (this != null) { this.ptrs_to.AddLast(val); };
145 * The funding key for the second node
147 public NodeId get_bitcoin_key_2() {
148 long ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_2(this.ptr);
150 if (ret >= 0 && ret <= 4096) { return null; }
151 org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); }
152 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
157 * The funding key for the second node
159 public void set_bitcoin_key_2(org.ldk.structs.NodeId val) {
160 bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, val == null ? 0 : val.ptr);
163 if (this != null) { this.ptrs_to.AddLast(val); };
166 internal long clone_ptr() {
167 long ret = bindings.UnsignedChannelAnnouncement_clone_ptr(this.ptr);
173 * Creates a copy of the UnsignedChannelAnnouncement
175 public UnsignedChannelAnnouncement clone() {
176 long ret = bindings.UnsignedChannelAnnouncement_clone(this.ptr);
178 if (ret >= 0 && ret <= 4096) { return null; }
179 org.ldk.structs.UnsignedChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedChannelAnnouncement(null, ret); }
180 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
185 * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
186 * This ignores pointers and is_owned flags and looks at the values in fields.
187 * Two objects with NULL inner values will be considered "equal" here.
189 public bool eq(org.ldk.structs.UnsignedChannelAnnouncement b) {
190 bool ret = bindings.UnsignedChannelAnnouncement_eq(this.ptr, b == null ? 0 : b.ptr);
193 if (this != null) { this.ptrs_to.AddLast(b); };
197 public override bool Equals(object o) {
198 if (!(o is UnsignedChannelAnnouncement)) return false;
199 return this.eq((UnsignedChannelAnnouncement)o);
202 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
204 public byte[] write() {
205 byte[] ret = bindings.UnsignedChannelAnnouncement_write(this.ptr);
211 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
213 public static Result_UnsignedChannelAnnouncementDecodeErrorZ read(byte[] ser) {
214 long ret = bindings.UnsignedChannelAnnouncement_read(ser);
216 if (ret >= 0 && ret <= 4096) { return null; }
217 Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);