1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
10 * A gossip_timestamp_filter message is used by a node to request
11 * gossip relay for messages in the requested time range when the
12 * gossip_queries feature has been negotiated.
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class GossipTimestampFilter extends CommonBase {
16 GossipTimestampFilter(Object _dummy, long ptr) { super(ptr); }
17 @Override @SuppressWarnings("deprecation")
18 protected void finalize() throws Throwable {
20 if (ptr != 0) { bindings.GossipTimestampFilter_free(ptr); }
24 * The genesis hash of the blockchain for channel and node information
26 public byte[] get_chain_hash() {
27 byte[] ret = bindings.GossipTimestampFilter_get_chain_hash(this.ptr);
32 * The genesis hash of the blockchain for channel and node information
34 public void set_chain_hash(byte[] val) {
35 bindings.GossipTimestampFilter_set_chain_hash(this.ptr, val);
39 * The starting unix timestamp
41 public int get_first_timestamp() {
42 int ret = bindings.GossipTimestampFilter_get_first_timestamp(this.ptr);
47 * The starting unix timestamp
49 public void set_first_timestamp(int val) {
50 bindings.GossipTimestampFilter_set_first_timestamp(this.ptr, val);
54 * The range of information in seconds
56 public int get_timestamp_range() {
57 int ret = bindings.GossipTimestampFilter_get_timestamp_range(this.ptr);
62 * The range of information in seconds
64 public void set_timestamp_range(int val) {
65 bindings.GossipTimestampFilter_set_timestamp_range(this.ptr, val);
69 * Constructs a new GossipTimestampFilter given each field
71 public static GossipTimestampFilter constructor_new(byte[] chain_hash_arg, int first_timestamp_arg, int timestamp_range_arg) {
72 long ret = bindings.GossipTimestampFilter_new(chain_hash_arg, first_timestamp_arg, timestamp_range_arg);
73 GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret);
74 ret_hu_conv.ptrs_to.add(ret_hu_conv);
79 * Creates a copy of the GossipTimestampFilter
81 public GossipTimestampFilter clone() {
82 long ret = bindings.GossipTimestampFilter_clone(this.ptr);
83 GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret);
84 ret_hu_conv.ptrs_to.add(this);
89 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
91 public static Result_GossipTimestampFilterDecodeErrorZ constructor_read(byte[] ser) {
92 long ret = bindings.GossipTimestampFilter_read(ser);
93 Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret);
98 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
100 public byte[] write() {
101 byte[] ret = bindings.GossipTimestampFilter_write(this.ptr);