X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=inline;f=ts%2Fstructs%2FGossipTimestampFilter.ts;h=a6557572b42bc6e890d81fdf9583f3ec9e887e86;hb=9298ef8ab8d34ee97c4fedc380e15248b54cd118;hp=dc37eda70479f09f133b543e7d0efa3fc0520671;hpb=822471992c6bf6f9985e531cc5940e4cc35e3e4c;p=ldk-java diff --git a/ts/structs/GossipTimestampFilter.ts b/ts/structs/GossipTimestampFilter.ts index dc37eda7..a6557572 100644 --- a/ts/structs/GossipTimestampFilter.ts +++ b/ts/structs/GossipTimestampFilter.ts @@ -1,62 +1,72 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class GossipTimestampFilter extends CommonBase { - GossipTimestampFilter(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.GossipTimestampFilter_free(ptr); } - } - public GossipTimestampFilter clone() { - uint32_t ret = bindings.GossipTimestampFilter_clone(this.ptr); - GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret); - return ret_hu_conv; - } - public byte[] get_chain_hash() { - byte[] ret = bindings.GossipTimestampFilter_get_chain_hash(this.ptr); + export default class GossipTimestampFilter extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.GossipTimestampFilter_free(this.ptr); + } + } + public Uint8Array get_chain_hash() { + Uint8Array ret = bindings.GossipTimestampFilter_get_chain_hash(this.ptr); return ret; } - public void set_chain_hash(byte[] val) { + public void set_chain_hash(Uint8Array val) { bindings.GossipTimestampFilter_set_chain_hash(this.ptr, val); } - public int get_first_timestamp() { - int ret = bindings.GossipTimestampFilter_get_first_timestamp(this.ptr); + public number get_first_timestamp() { + number ret = bindings.GossipTimestampFilter_get_first_timestamp(this.ptr); return ret; } - public void set_first_timestamp(int val) { + public void set_first_timestamp(number val) { bindings.GossipTimestampFilter_set_first_timestamp(this.ptr, val); } - public int get_timestamp_range() { - int ret = bindings.GossipTimestampFilter_get_timestamp_range(this.ptr); + public number get_timestamp_range() { + number ret = bindings.GossipTimestampFilter_get_timestamp_range(this.ptr); return ret; } - public void set_timestamp_range(int val) { + public void set_timestamp_range(number val) { bindings.GossipTimestampFilter_set_timestamp_range(this.ptr, val); } - public static GossipTimestampFilter constructor_new(byte[] chain_hash_arg, int first_timestamp_arg, int timestamp_range_arg) { - uint32_t ret = bindings.GossipTimestampFilter_new(chain_hash_arg, first_timestamp_arg, timestamp_range_arg); - GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret); + public static GossipTimestampFilter constructor_new(Uint8Array chain_hash_arg, number first_timestamp_arg, number timestamp_range_arg) { + number ret = bindings.GossipTimestampFilter_new(chain_hash_arg, first_timestamp_arg, timestamp_range_arg); + const ret_hu_conv: GossipTimestampFilter = new GossipTimestampFilter(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public GossipTimestampFilter clone() { + number ret = bindings.GossipTimestampFilter_clone(this.ptr); + const ret_hu_conv: GossipTimestampFilter = new GossipTimestampFilter(null, ret); + ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } - public static Result_GossipTimestampFilterDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.GossipTimestampFilter_read(ser); + public static Result_GossipTimestampFilterDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.GossipTimestampFilter_read(ser); Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.GossipTimestampFilter_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.GossipTimestampFilter_write(this.ptr); return ret; }