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 byte[] ret = bindings.QueryShortChannelIds_get_chain_hash(this.ptr);
38 * The genesis hash of the blockchain being queried
40 public void set_chain_hash(byte[] val) {
41 bindings.QueryShortChannelIds_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
47 * The short_channel_ids that are being queried
49 * Returns a copy of the field.
51 public long[] get_short_channel_ids() {
52 long[] ret = bindings.QueryShortChannelIds_get_short_channel_ids(this.ptr);
58 * The short_channel_ids that are being queried
60 public void set_short_channel_ids(long[] val) {
61 bindings.QueryShortChannelIds_set_short_channel_ids(this.ptr, val);
67 * Constructs a new QueryShortChannelIds given each field
69 public static QueryShortChannelIds of(byte[] chain_hash_arg, long[] short_channel_ids_arg) {
70 long ret = bindings.QueryShortChannelIds_new(InternalUtils.check_arr_len(chain_hash_arg, 32), short_channel_ids_arg);
71 GC.KeepAlive(chain_hash_arg);
72 GC.KeepAlive(short_channel_ids_arg);
73 if (ret >= 0 && ret <= 4096) { return null; }
74 org.ldk.structs.QueryShortChannelIds ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, ret); }
75 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
79 internal long clone_ptr() {
80 long ret = bindings.QueryShortChannelIds_clone_ptr(this.ptr);
86 * Creates a copy of the QueryShortChannelIds
88 public QueryShortChannelIds clone() {
89 long ret = bindings.QueryShortChannelIds_clone(this.ptr);
91 if (ret >= 0 && ret <= 4096) { return null; }
92 org.ldk.structs.QueryShortChannelIds ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, ret); }
93 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
98 * Checks if two QueryShortChannelIdss contain equal inner contents.
99 * This ignores pointers and is_owned flags and looks at the values in fields.
100 * Two objects with NULL inner values will be considered "equal" here.
102 public bool eq(org.ldk.structs.QueryShortChannelIds b) {
103 bool ret = bindings.QueryShortChannelIds_eq(this.ptr, b == null ? 0 : b.ptr);
106 if (this != null) { this.ptrs_to.AddLast(b); };
110 public override bool Equals(object o) {
111 if (!(o is QueryShortChannelIds)) return false;
112 return this.eq((QueryShortChannelIds)o);
115 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
117 public static Result_QueryShortChannelIdsDecodeErrorZ read(byte[] ser) {
118 long ret = bindings.QueryShortChannelIds_read(ser);
120 if (ret >= 0 && ret <= 4096) { return null; }
121 Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret);
126 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
128 public byte[] write() {
129 byte[] ret = bindings.QueryShortChannelIds_write(this.ptr);