1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import javax.annotation.Nullable;
11 * A query_short_channel_ids message is used to query a peer for
12 * routing gossip messages related to one or more short_channel_ids.
13 * The query recipient will reply with the latest, if available,
14 * channel_announcement, channel_update and node_announcement messages
15 * it maintains for the requested short_channel_ids followed by a
16 * reply_short_channel_ids_end message. The short_channel_ids 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 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
21 public class QueryShortChannelIds extends CommonBase {
22 QueryShortChannelIds(Object _dummy, long ptr) { super(ptr); }
23 @Override @SuppressWarnings("deprecation")
24 protected void finalize() throws Throwable {
26 if (ptr != 0) { bindings.QueryShortChannelIds_free(ptr); }
30 * The genesis hash of the blockchain being queried
32 public byte[] get_chain_hash() {
33 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, val);
45 * The short_channel_ids that are being queried
47 public void set_short_channel_ids(long[] val) {
48 bindings.QueryShortChannelIds_set_short_channel_ids(this.ptr, val);
52 * Constructs a new QueryShortChannelIds given each field
54 public static QueryShortChannelIds of(byte[] chain_hash_arg, long[] short_channel_ids_arg) {
55 long ret = bindings.QueryShortChannelIds_new(chain_hash_arg, short_channel_ids_arg);
56 if (ret < 1024) { return null; }
57 QueryShortChannelIds ret_hu_conv = new QueryShortChannelIds(null, ret);
58 ret_hu_conv.ptrs_to.add(ret_hu_conv);
63 * Creates a copy of the QueryShortChannelIds
65 public QueryShortChannelIds clone() {
66 long ret = bindings.QueryShortChannelIds_clone(this.ptr);
67 if (ret < 1024) { return null; }
68 QueryShortChannelIds ret_hu_conv = new QueryShortChannelIds(null, ret);
69 ret_hu_conv.ptrs_to.add(this);
74 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
76 public static Result_QueryShortChannelIdsDecodeErrorZ read(byte[] ser) {
77 long ret = bindings.QueryShortChannelIds_read(ser);
78 if (ret < 1024) { return null; }
79 Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret);
84 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
86 public byte[] write() {
87 byte[] ret = bindings.QueryShortChannelIds_write(this.ptr);