6 namespace org { namespace ldk { namespace structs {
10 * A query_short_channel_ids message is used to query a peer for
11 * routing gossip messages related to one or more short_channel_ids.
12 * The query recipient will reply with the latest, if available,
13 * channel_announcement, channel_update and node_announcement messages
14 * it maintains for the requested short_channel_ids followed by a
15 * reply_short_channel_ids_end message. The short_channel_ids sent in
16 * this query are encoded. We only support encoding_type=0 uncompressed
17 * serialization and do not support encoding_type=1 zlib serialization.
19 public class QueryShortChannelIds : CommonBase {
20 internal QueryShortChannelIds(object _dummy, long ptr) : base(ptr) { }
21 ~QueryShortChannelIds() {
22 if (ptr != 0) { bindings.QueryShortChannelIds_free(ptr); }
26 * The genesis hash of the blockchain being queried
28 public byte[] get_chain_hash() {
29 byte[] ret = bindings.QueryShortChannelIds_get_chain_hash(this.ptr);
35 * The genesis hash of the blockchain being queried
37 public void set_chain_hash(byte[] val) {
38 bindings.QueryShortChannelIds_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
44 * The short_channel_ids that are being queried
46 * Returns a copy of the field.
48 public long[] get_short_channel_ids() {
49 long[] ret = bindings.QueryShortChannelIds_get_short_channel_ids(this.ptr);
55 * The short_channel_ids that are being queried
57 public void set_short_channel_ids(long[] val) {
58 bindings.QueryShortChannelIds_set_short_channel_ids(this.ptr, val);
64 * Constructs a new QueryShortChannelIds given each field
66 public static QueryShortChannelIds of(byte[] chain_hash_arg, long[] short_channel_ids_arg) {
67 long ret = bindings.QueryShortChannelIds_new(InternalUtils.check_arr_len(chain_hash_arg, 32), short_channel_ids_arg);
68 GC.KeepAlive(chain_hash_arg);
69 GC.KeepAlive(short_channel_ids_arg);
70 if (ret >= 0 && ret <= 4096) { return null; }
71 org.ldk.structs.QueryShortChannelIds ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.QueryShortChannelIds(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.QueryShortChannelIds_clone_ptr(this.ptr);
83 * Creates a copy of the QueryShortChannelIds
85 public QueryShortChannelIds clone() {
86 long ret = bindings.QueryShortChannelIds_clone(this.ptr);
88 if (ret >= 0 && ret <= 4096) { return null; }
89 org.ldk.structs.QueryShortChannelIds ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, ret); }
90 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
95 * Checks if two QueryShortChannelIdss contain equal inner contents.
96 * This ignores pointers and is_owned flags and looks at the values in fields.
97 * Two objects with NULL inner values will be considered "equal" here.
99 public bool eq(org.ldk.structs.QueryShortChannelIds b) {
100 bool ret = bindings.QueryShortChannelIds_eq(this.ptr, b == null ? 0 : b.ptr);
103 if (this != null) { this.ptrs_to.AddLast(b); };
107 public override bool Equals(object o) {
108 if (!(o is QueryShortChannelIds)) return false;
109 return this.eq((QueryShortChannelIds)o);
112 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
114 public static Result_QueryShortChannelIdsDecodeErrorZ read(byte[] ser) {
115 long ret = bindings.QueryShortChannelIds_read(ser);
117 if (ret >= 0 && ret <= 4096) { return null; }
118 Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret);
123 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
125 public byte[] write() {
126 byte[] ret = bindings.QueryShortChannelIds_write(this.ptr);