1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
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 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
20 public class QueryShortChannelIds extends CommonBase {
21 QueryShortChannelIds(Object _dummy, long ptr) { super(ptr); }
22 @Override @SuppressWarnings("deprecation")
23 protected void finalize() throws Throwable {
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);
37 * The genesis hash of the blockchain being queried
39 public void set_chain_hash(byte[] val) {
40 bindings.QueryShortChannelIds_set_chain_hash(this.ptr, val);
44 * The short_channel_ids that are being queried
46 public void set_short_channel_ids(long[] val) {
47 bindings.QueryShortChannelIds_set_short_channel_ids(this.ptr, val);
51 * Constructs a new QueryShortChannelIds given each field
53 public static QueryShortChannelIds constructor_new(byte[] chain_hash_arg, long[] short_channel_ids_arg) {
54 long ret = bindings.QueryShortChannelIds_new(chain_hash_arg, short_channel_ids_arg);
55 QueryShortChannelIds ret_hu_conv = new QueryShortChannelIds(null, ret);
56 ret_hu_conv.ptrs_to.add(ret_hu_conv);
61 * Creates a copy of the QueryShortChannelIds
63 public QueryShortChannelIds clone() {
64 long ret = bindings.QueryShortChannelIds_clone(this.ptr);
65 QueryShortChannelIds ret_hu_conv = new QueryShortChannelIds(null, ret);
66 ret_hu_conv.ptrs_to.add(this);
71 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
73 public static Result_QueryShortChannelIdsDecodeErrorZ constructor_read(byte[] ser) {
74 long ret = bindings.QueryShortChannelIds_read(ser);
75 Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret);
80 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
82 public byte[] write() {
83 byte[] ret = bindings.QueryShortChannelIds_write(this.ptr);