6 namespace org { namespace ldk { namespace structs {
10 * A [`reply_short_channel_ids_end`] message is sent as a reply to a
11 * message. The query recipient makes a best
12 * effort to respond based on their local network view which may not be
13 * a perfect view of the network.
15 * [`reply_short_channel_ids_end`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_short_channel_idsreply_short_channel_ids_end-messages
17 public class ReplyShortChannelIdsEnd : CommonBase {
18 internal ReplyShortChannelIdsEnd(object _dummy, long ptr) : base(ptr) { }
19 ~ReplyShortChannelIdsEnd() {
20 if (ptr != 0) { bindings.ReplyShortChannelIdsEnd_free(ptr); }
24 * The genesis hash of the blockchain that was queried
26 public byte[] get_chain_hash() {
27 long ret = bindings.ReplyShortChannelIdsEnd_get_chain_hash(this.ptr);
29 if (ret >= 0 && ret <= 4096) { return null; }
30 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
35 * The genesis hash of the blockchain that was queried
37 public void set_chain_hash(byte[] val) {
38 bindings.ReplyShortChannelIdsEnd_set_chain_hash(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
44 * Indicates if the query recipient maintains up-to-date channel
45 * information for the `chain_hash`
47 public bool get_full_information() {
48 bool ret = bindings.ReplyShortChannelIdsEnd_get_full_information(this.ptr);
54 * Indicates if the query recipient maintains up-to-date channel
55 * information for the `chain_hash`
57 public void set_full_information(bool val) {
58 bindings.ReplyShortChannelIdsEnd_set_full_information(this.ptr, val);
64 * Constructs a new ReplyShortChannelIdsEnd given each field
66 public static ReplyShortChannelIdsEnd of(byte[] chain_hash_arg, bool full_information_arg) {
67 long ret = bindings.ReplyShortChannelIdsEnd_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(chain_hash_arg, 32)), full_information_arg);
68 GC.KeepAlive(chain_hash_arg);
69 GC.KeepAlive(full_information_arg);
70 if (ret >= 0 && ret <= 4096) { return null; }
71 org.ldk.structs.ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyShortChannelIdsEnd(null, ret); }
72 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
76 internal long clone_ptr() {
77 long ret = bindings.ReplyShortChannelIdsEnd_clone_ptr(this.ptr);
83 * Creates a copy of the ReplyShortChannelIdsEnd
85 public ReplyShortChannelIdsEnd clone() {
86 long ret = bindings.ReplyShortChannelIdsEnd_clone(this.ptr);
88 if (ret >= 0 && ret <= 4096) { return null; }
89 org.ldk.structs.ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyShortChannelIdsEnd(null, ret); }
90 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
95 * Generates a non-cryptographic 64-bit hash of the ReplyShortChannelIdsEnd.
98 long ret = bindings.ReplyShortChannelIdsEnd_hash(this.ptr);
103 public override int GetHashCode() {
104 return (int)this.hash();
107 * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
108 * This ignores pointers and is_owned flags and looks at the values in fields.
109 * Two objects with NULL inner values will be considered "equal" here.
111 public bool eq(org.ldk.structs.ReplyShortChannelIdsEnd b) {
112 bool ret = bindings.ReplyShortChannelIdsEnd_eq(this.ptr, b.ptr);
115 if (this != null) { this.ptrs_to.AddLast(b); };
119 public override bool Equals(object o) {
120 if (!(o is ReplyShortChannelIdsEnd)) return false;
121 return this.eq((ReplyShortChannelIdsEnd)o);
124 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
126 public byte[] write() {
127 long ret = bindings.ReplyShortChannelIdsEnd_write(this.ptr);
129 if (ret >= 0 && ret <= 4096) { return null; }
130 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
135 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
137 public static Result_ReplyShortChannelIdsEndDecodeErrorZ read(byte[] ser) {
138 long ret = bindings.ReplyShortChannelIdsEnd_read(InternalUtils.encodeUint8Array(ser));
140 if (ret >= 0 && ret <= 4096) { return null; }
141 Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);