X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FUnsignedNodeAnnouncement.ts;h=abd16c565f98658f159561a023f086d859370e70;hb=22f5f4208b1f3b5542292250f1612b944f5cd7fd;hp=6c67010d0e992adf5438529df851cef0800cca49;hpb=56e9910ffaa7fccf2cb777dc9cf55e01a9681543;p=ldk-java diff --git a/ts/structs/UnsignedNodeAnnouncement.ts b/ts/structs/UnsignedNodeAnnouncement.ts index 6c67010d..abd16c56 100644 --- a/ts/structs/UnsignedNodeAnnouncement.ts +++ b/ts/structs/UnsignedNodeAnnouncement.ts @@ -1,24 +1,32 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class UnsignedNodeAnnouncement extends CommonBase { - UnsignedNodeAnnouncement(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.UnsignedNodeAnnouncement_free(ptr); } - } + + export default class UnsignedNodeAnnouncement extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.UnsignedNodeAnnouncement_free(this.ptr); + } + } public UnsignedNodeAnnouncement clone() { - uint32_t ret = bindings.UnsignedNodeAnnouncement_clone(this.ptr); - UnsignedNodeAnnouncement ret_hu_conv = new UnsignedNodeAnnouncement(null, ret); + number ret = bindings.UnsignedNodeAnnouncement_clone(this.ptr); + const ret_hu_conv: UnsignedNodeAnnouncement = new UnsignedNodeAnnouncement(null, ret); return ret_hu_conv; } public NodeFeatures get_features() { - uint32_t ret = bindings.UnsignedNodeAnnouncement_get_features(this.ptr); - NodeFeatures ret_hu_conv = new NodeFeatures(null, ret); + number ret = bindings.UnsignedNodeAnnouncement_get_features(this.ptr); + const ret_hu_conv: NodeFeatures = new NodeFeatures(null, ret); return ret_hu_conv; } @@ -27,54 +35,54 @@ public class UnsignedNodeAnnouncement extends CommonBase { this.ptrs_to.add(val); } - public int get_timestamp() { - int ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this.ptr); + public number get_timestamp() { + number ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this.ptr); return ret; } - public void set_timestamp(int val) { + public void set_timestamp(number val) { bindings.UnsignedNodeAnnouncement_set_timestamp(this.ptr, val); } - public byte[] get_node_id() { - byte[] ret = bindings.UnsignedNodeAnnouncement_get_node_id(this.ptr); + public Uint8Array get_node_id() { + Uint8Array ret = bindings.UnsignedNodeAnnouncement_get_node_id(this.ptr); return ret; } - public void set_node_id(byte[] val) { + public void set_node_id(Uint8Array val) { bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, val); } - public byte[] get_rgb() { - byte[] ret = bindings.UnsignedNodeAnnouncement_get_rgb(this.ptr); + public Uint8Array get_rgb() { + Uint8Array ret = bindings.UnsignedNodeAnnouncement_get_rgb(this.ptr); return ret; } - public void set_rgb(byte[] val) { + public void set_rgb(Uint8Array val) { bindings.UnsignedNodeAnnouncement_set_rgb(this.ptr, val); } - public byte[] get_alias() { - byte[] ret = bindings.UnsignedNodeAnnouncement_get_alias(this.ptr); + public Uint8Array get_alias() { + Uint8Array ret = bindings.UnsignedNodeAnnouncement_get_alias(this.ptr); return ret; } - public void set_alias(byte[] val) { + public void set_alias(Uint8Array val) { bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, val); } public void set_addresses(NetAddress[] val) { - bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, (uint32_t[])Arrays.stream(val).map(arr_conv_12 -> arr_conv_12.ptr).toArray()); + bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, (number[])Arrays.stream(val).map(arr_conv_12 -> arr_conv_12.ptr).toArray()); /* TODO 2 NetAddress */; } - public byte[] write() { - byte[] ret = bindings.UnsignedNodeAnnouncement_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.UnsignedNodeAnnouncement_write(this.ptr); return ret; } - public static Result_UnsignedNodeAnnouncementDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.UnsignedNodeAnnouncement_read(ser); + public static Result_UnsignedNodeAnnouncementDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.UnsignedNodeAnnouncement_read(ser); Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }