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_id`s.
13 * The query recipient will reply with the latest, if available,
14 * [`ChannelAnnouncement`], [`ChannelUpdate`] and [`NodeAnnouncement`] messages
15 * it maintains for the requested `short_channel_id`s followed by a
16 * [`ReplyShortChannelIdsEnd`] message. The `short_channel_id`s sent in
17 * this query are encoded. We only support `encoding_type=0` uncompressed
18 * serialization and do not support `encoding_type=1` zlib serialization.
20 * [`query_short_channel_ids`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_short_channel_idsreply_short_channel_ids_end-messages
22 public class QueryShortChannelIds : CommonBase {
23 internal QueryShortChannelIds(object _dummy, long ptr) : base(ptr) { }
24 ~QueryShortChannelIds() {
25 if (ptr != 0) { bindings.QueryShortChannelIds_free(ptr); }
29 * The genesis hash of the blockchain being queried
31 public byte[] get_chain_hash() {
32 long ret = bindings.QueryShortChannelIds_get_chain_hash(this.ptr);
34 if (ret >= 0 && ret <= 4096) { return null; }
35 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
40 * The genesis hash of the blockchain being queried
42 public void set_chain_hash(byte[] val) {
43 bindings.QueryShortChannelIds_set_chain_hash(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32)));
49 * The short_channel_ids that are being queried
51 * Returns a copy of the field.
53 public long[] get_short_channel_ids() {
54 long ret = bindings.QueryShortChannelIds_get_short_channel_ids(this.ptr);
56 if (ret >= 0 && ret <= 4096) { return null; }
57 long[] ret_conv = InternalUtils.decodeUint64Array(ret);
62 * The short_channel_ids that are being queried
64 public void set_short_channel_ids(long[] val) {
65 bindings.QueryShortChannelIds_set_short_channel_ids(this.ptr, InternalUtils.encodeUint64Array(val));
71 * Constructs a new QueryShortChannelIds given each field
73 public static QueryShortChannelIds of(byte[] chain_hash_arg, long[] short_channel_ids_arg) {
74 long ret = bindings.QueryShortChannelIds_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(chain_hash_arg, 32)), InternalUtils.encodeUint64Array(short_channel_ids_arg));
75 GC.KeepAlive(chain_hash_arg);
76 GC.KeepAlive(short_channel_ids_arg);
77 if (ret >= 0 && ret <= 4096) { return null; }
78 org.ldk.structs.QueryShortChannelIds ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, ret); }
79 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
83 internal long clone_ptr() {
84 long ret = bindings.QueryShortChannelIds_clone_ptr(this.ptr);
90 * Creates a copy of the QueryShortChannelIds
92 public QueryShortChannelIds clone() {
93 long ret = bindings.QueryShortChannelIds_clone(this.ptr);
95 if (ret >= 0 && ret <= 4096) { return null; }
96 org.ldk.structs.QueryShortChannelIds ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, ret); }
97 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
102 * Generates a non-cryptographic 64-bit hash of the QueryShortChannelIds.
105 long ret = bindings.QueryShortChannelIds_hash(this.ptr);
110 public override int GetHashCode() {
111 return (int)this.hash();
114 * Checks if two QueryShortChannelIdss contain equal inner contents.
115 * This ignores pointers and is_owned flags and looks at the values in fields.
116 * Two objects with NULL inner values will be considered "equal" here.
118 public bool eq(org.ldk.structs.QueryShortChannelIds b) {
119 bool ret = bindings.QueryShortChannelIds_eq(this.ptr, b.ptr);
122 if (this != null) { this.ptrs_to.AddLast(b); };
126 public override bool Equals(object o) {
127 if (!(o is QueryShortChannelIds)) return false;
128 return this.eq((QueryShortChannelIds)o);
131 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
133 public static Result_QueryShortChannelIdsDecodeErrorZ read(byte[] ser) {
134 long ret = bindings.QueryShortChannelIds_read(InternalUtils.encodeUint8Array(ser));
136 if (ret >= 0 && ret <= 4096) { return null; }
137 Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret);
142 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
144 public byte[] write() {
145 long ret = bindings.QueryShortChannelIds_write(this.ptr);
147 if (ret >= 0 && ret <= 4096) { return null; }
148 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);