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 gossip_timestamp_filter message is used by a node to request
12 * gossip relay for messages in the requested time range when the
13 * gossip_queries feature has been negotiated.
15 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
16 public class GossipTimestampFilter extends CommonBase {
17 GossipTimestampFilter(Object _dummy, long ptr) { super(ptr); }
18 @Override @SuppressWarnings("deprecation")
19 protected void finalize() throws Throwable {
21 if (ptr != 0) { bindings.GossipTimestampFilter_free(ptr); }
25 * The genesis hash of the blockchain for channel and node information
27 public byte[] get_chain_hash() {
28 byte[] ret = bindings.GossipTimestampFilter_get_chain_hash(this.ptr);
33 * The genesis hash of the blockchain for channel and node information
35 public void set_chain_hash(byte[] val) {
36 bindings.GossipTimestampFilter_set_chain_hash(this.ptr, val);
40 * The starting unix timestamp
42 public int get_first_timestamp() {
43 int ret = bindings.GossipTimestampFilter_get_first_timestamp(this.ptr);
48 * The starting unix timestamp
50 public void set_first_timestamp(int val) {
51 bindings.GossipTimestampFilter_set_first_timestamp(this.ptr, val);
55 * The range of information in seconds
57 public int get_timestamp_range() {
58 int ret = bindings.GossipTimestampFilter_get_timestamp_range(this.ptr);
63 * The range of information in seconds
65 public void set_timestamp_range(int val) {
66 bindings.GossipTimestampFilter_set_timestamp_range(this.ptr, val);
70 * Constructs a new GossipTimestampFilter given each field
72 public static GossipTimestampFilter of(byte[] chain_hash_arg, int first_timestamp_arg, int timestamp_range_arg) {
73 long ret = bindings.GossipTimestampFilter_new(chain_hash_arg, first_timestamp_arg, timestamp_range_arg);
74 if (ret < 1024) { return null; }
75 GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret);
76 ret_hu_conv.ptrs_to.add(ret_hu_conv);
81 * Creates a copy of the GossipTimestampFilter
83 public GossipTimestampFilter clone() {
84 long ret = bindings.GossipTimestampFilter_clone(this.ptr);
85 if (ret < 1024) { return null; }
86 GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret);
87 ret_hu_conv.ptrs_to.add(this);
92 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
94 public byte[] write() {
95 byte[] ret = bindings.GossipTimestampFilter_write(this.ptr);
100 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
102 public static Result_GossipTimestampFilterDecodeErrorZ read(byte[] ser) {
103 long ret = bindings.GossipTimestampFilter_read(ser);
104 if (ret < 1024) { return null; }
105 Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret);