6 namespace org { namespace ldk { namespace structs {
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 public class ReplyChannelRange : CommonBase {
19 internal ReplyChannelRange(object _dummy, long ptr) : base(ptr) { }
20 ~ReplyChannelRange() {
21 if (ptr != 0) { bindings.ReplyChannelRange_free(ptr); }
25 * The genesis hash of the blockchain being queried
27 public byte[] get_chain_hash() {
28 byte[] ret = bindings.ReplyChannelRange_get_chain_hash(this.ptr);
34 * The genesis hash of the blockchain being queried
36 public void set_chain_hash(byte[] val) {
37 bindings.ReplyChannelRange_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
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);
52 * The height of the first block in the range of the reply
54 public void set_first_blocknum(int val) {
55 bindings.ReplyChannelRange_set_first_blocknum(this.ptr, val);
61 * The number of blocks included in the range of the reply
63 public int get_number_of_blocks() {
64 int ret = bindings.ReplyChannelRange_get_number_of_blocks(this.ptr);
70 * The number of blocks included in the range of the reply
72 public void set_number_of_blocks(int val) {
73 bindings.ReplyChannelRange_set_number_of_blocks(this.ptr, val);
79 * True when this is the final reply for a query
81 public bool get_sync_complete() {
82 bool ret = bindings.ReplyChannelRange_get_sync_complete(this.ptr);
88 * True when this is the final reply for a query
90 public void set_sync_complete(bool val) {
91 bindings.ReplyChannelRange_set_sync_complete(this.ptr, val);
97 * The short_channel_ids in the channel range
99 * Returns a copy of the field.
101 public long[] get_short_channel_ids() {
102 long[] ret = bindings.ReplyChannelRange_get_short_channel_ids(this.ptr);
108 * The short_channel_ids in the channel range
110 public void set_short_channel_ids(long[] val) {
111 bindings.ReplyChannelRange_set_short_channel_ids(this.ptr, val);
117 * Constructs a new ReplyChannelRange given each field
119 public static ReplyChannelRange of(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg, bool sync_complete_arg, long[] short_channel_ids_arg) {
120 long ret = bindings.ReplyChannelRange_new(InternalUtils.check_arr_len(chain_hash_arg, 32), first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg);
121 GC.KeepAlive(chain_hash_arg);
122 GC.KeepAlive(first_blocknum_arg);
123 GC.KeepAlive(number_of_blocks_arg);
124 GC.KeepAlive(sync_complete_arg);
125 GC.KeepAlive(short_channel_ids_arg);
126 if (ret >= 0 && ret <= 4096) { return null; }
127 org.ldk.structs.ReplyChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyChannelRange(null, ret); }
128 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
132 internal long clone_ptr() {
133 long ret = bindings.ReplyChannelRange_clone_ptr(this.ptr);
139 * Creates a copy of the ReplyChannelRange
141 public ReplyChannelRange clone() {
142 long ret = bindings.ReplyChannelRange_clone(this.ptr);
144 if (ret >= 0 && ret <= 4096) { return null; }
145 org.ldk.structs.ReplyChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyChannelRange(null, ret); }
146 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
151 * Checks if two ReplyChannelRanges contain equal inner contents.
152 * This ignores pointers and is_owned flags and looks at the values in fields.
153 * Two objects with NULL inner values will be considered "equal" here.
155 public bool eq(org.ldk.structs.ReplyChannelRange b) {
156 bool ret = bindings.ReplyChannelRange_eq(this.ptr, b == null ? 0 : b.ptr);
159 if (this != null) { this.ptrs_to.AddLast(b); };
163 public override bool Equals(object o) {
164 if (!(o is ReplyChannelRange)) return false;
165 return this.eq((ReplyChannelRange)o);
168 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
170 public static Result_ReplyChannelRangeDecodeErrorZ read(byte[] ser) {
171 long ret = bindings.ReplyChannelRange_read(ser);
173 if (ret >= 0 && ret <= 4096) { return null; }
174 Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret);
179 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
181 public byte[] write() {
182 byte[] ret = bindings.ReplyChannelRange_write(this.ptr);