6 namespace org { namespace ldk { namespace structs {
10 * The unsigned part of a channel_announcement
12 public class UnsignedChannelAnnouncement : CommonBase {
13 internal UnsignedChannelAnnouncement(object _dummy, long ptr) : base(ptr) { }
14 ~UnsignedChannelAnnouncement() {
15 if (ptr != 0) { bindings.UnsignedChannelAnnouncement_free(ptr); }
19 * The advertised channel features
21 public ChannelFeatures get_features() {
22 long ret = bindings.UnsignedChannelAnnouncement_get_features(this.ptr);
24 if (ret >= 0 && ret <= 4096) { return null; }
25 org.ldk.structs.ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelFeatures(null, ret); }
26 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
31 * The advertised channel features
33 public void set_features(org.ldk.structs.ChannelFeatures val) {
34 bindings.UnsignedChannelAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr);
37 if (this != null) { this.ptrs_to.AddLast(val); };
41 * The genesis hash of the blockchain where the channel is to be opened
43 public byte[] get_chain_hash() {
44 byte[] ret = bindings.UnsignedChannelAnnouncement_get_chain_hash(this.ptr);
50 * The genesis hash of the blockchain where the channel is to be opened
52 public void set_chain_hash(byte[] val) {
53 bindings.UnsignedChannelAnnouncement_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
59 * The short channel ID
61 public long get_short_channel_id() {
62 long ret = bindings.UnsignedChannelAnnouncement_get_short_channel_id(this.ptr);
68 * The short channel ID
70 public void set_short_channel_id(long val) {
71 bindings.UnsignedChannelAnnouncement_set_short_channel_id(this.ptr, val);
77 * One of the two node_ids which are endpoints of this channel
79 public byte[] get_node_id_1() {
80 byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_1(this.ptr);
86 * One of the two node_ids which are endpoints of this channel
88 public void set_node_id_1(byte[] val) {
89 bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, InternalUtils.check_arr_len(val, 33));
95 * The other of the two node_ids which are endpoints of this channel
97 public byte[] get_node_id_2() {
98 byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_2(this.ptr);
104 * The other of the two node_ids which are endpoints of this channel
106 public void set_node_id_2(byte[] val) {
107 bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, InternalUtils.check_arr_len(val, 33));
113 * The funding key for the first node
115 public byte[] get_bitcoin_key_1() {
116 byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_1(this.ptr);
122 * The funding key for the first node
124 public void set_bitcoin_key_1(byte[] val) {
125 bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, InternalUtils.check_arr_len(val, 33));
131 * The funding key for the second node
133 public byte[] get_bitcoin_key_2() {
134 byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_2(this.ptr);
140 * The funding key for the second node
142 public void set_bitcoin_key_2(byte[] val) {
143 bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, InternalUtils.check_arr_len(val, 33));
148 internal long clone_ptr() {
149 long ret = bindings.UnsignedChannelAnnouncement_clone_ptr(this.ptr);
155 * Creates a copy of the UnsignedChannelAnnouncement
157 public UnsignedChannelAnnouncement clone() {
158 long ret = bindings.UnsignedChannelAnnouncement_clone(this.ptr);
160 if (ret >= 0 && ret <= 4096) { return null; }
161 org.ldk.structs.UnsignedChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedChannelAnnouncement(null, ret); }
162 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
167 * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
168 * This ignores pointers and is_owned flags and looks at the values in fields.
169 * Two objects with NULL inner values will be considered "equal" here.
171 public bool eq(org.ldk.structs.UnsignedChannelAnnouncement b) {
172 bool ret = bindings.UnsignedChannelAnnouncement_eq(this.ptr, b == null ? 0 : b.ptr);
175 if (this != null) { this.ptrs_to.AddLast(b); };
179 public override bool Equals(object o) {
180 if (!(o is UnsignedChannelAnnouncement)) return false;
181 return this.eq((UnsignedChannelAnnouncement)o);
184 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
186 public byte[] write() {
187 byte[] ret = bindings.UnsignedChannelAnnouncement_write(this.ptr);
193 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
195 public static Result_UnsignedChannelAnnouncementDecodeErrorZ read(byte[] ser) {
196 long ret = bindings.UnsignedChannelAnnouncement_read(ser);
198 if (ret >= 0 && ret <= 4096) { return null; }
199 Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);