1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
10 * A reply_channel_range message is a reply to a query_channel_range
11 * message. Multiple reply_channel_range messages can be sent in reply
12 * to a single query_channel_range message. The query recipient makes a
13 * best effort to respond based on their local network view which may
14 * not be a perfect view of the network. The short_channel_ids in the
15 * reply are encoded. We only support encoding_type=0 uncompressed
16 * serialization and do not support encoding_type=1 zlib serialization.
18 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
19 public class ReplyChannelRange extends CommonBase {
20 ReplyChannelRange(Object _dummy, long ptr) { super(ptr); }
21 @Override @SuppressWarnings("deprecation")
22 protected void finalize() throws Throwable {
24 if (ptr != 0) { bindings.ReplyChannelRange_free(ptr); }
28 * The genesis hash of the blockchain being queried
30 public byte[] get_chain_hash() {
31 byte[] ret = bindings.ReplyChannelRange_get_chain_hash(this.ptr);
36 * The genesis hash of the blockchain being queried
38 public void set_chain_hash(byte[] val) {
39 bindings.ReplyChannelRange_set_chain_hash(this.ptr, val);
43 * The height of the first block in the range of the reply
45 public int get_first_blocknum() {
46 int ret = bindings.ReplyChannelRange_get_first_blocknum(this.ptr);
51 * The height of the first block in the range of the reply
53 public void set_first_blocknum(int val) {
54 bindings.ReplyChannelRange_set_first_blocknum(this.ptr, val);
58 * The number of blocks included in the range of the reply
60 public int get_number_of_blocks() {
61 int ret = bindings.ReplyChannelRange_get_number_of_blocks(this.ptr);
66 * The number of blocks included in the range of the reply
68 public void set_number_of_blocks(int val) {
69 bindings.ReplyChannelRange_set_number_of_blocks(this.ptr, val);
73 * True when this is the final reply for a query
75 public boolean get_sync_complete() {
76 boolean ret = bindings.ReplyChannelRange_get_sync_complete(this.ptr);
81 * True when this is the final reply for a query
83 public void set_sync_complete(boolean val) {
84 bindings.ReplyChannelRange_set_sync_complete(this.ptr, val);
88 * The short_channel_ids in the channel range
90 public void set_short_channel_ids(long[] val) {
91 bindings.ReplyChannelRange_set_short_channel_ids(this.ptr, val);
95 * Constructs a new ReplyChannelRange given each field
97 public static ReplyChannelRange constructor_new(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg, boolean sync_complete_arg, long[] short_channel_ids_arg) {
98 long ret = bindings.ReplyChannelRange_new(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg);
99 ReplyChannelRange ret_hu_conv = new ReplyChannelRange(null, ret);
100 ret_hu_conv.ptrs_to.add(ret_hu_conv);
105 * Creates a copy of the ReplyChannelRange
107 public ReplyChannelRange clone() {
108 long ret = bindings.ReplyChannelRange_clone(this.ptr);
109 ReplyChannelRange ret_hu_conv = new ReplyChannelRange(null, ret);
110 ret_hu_conv.ptrs_to.add(this);
115 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
117 public static Result_ReplyChannelRangeDecodeErrorZ constructor_read(byte[] ser) {
118 long ret = bindings.ReplyChannelRange_read(ser);
119 Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret);
124 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
126 public byte[] write() {
127 byte[] ret = bindings.ReplyChannelRange_write(this.ptr);