X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FHTLCUpdate.ts;h=52dd102ee00be0cbefd4f284162298633a226504;hb=22f5f4208b1f3b5542292250f1612b944f5cd7fd;hp=deb3d0f192bb1cbf9c1d9898731eb6f0d888c8b0;hpb=56e9910ffaa7fccf2cb777dc9cf55e01a9681543;p=ldk-java diff --git a/ts/structs/HTLCUpdate.ts b/ts/structs/HTLCUpdate.ts index deb3d0f1..52dd102e 100644 --- a/ts/structs/HTLCUpdate.ts +++ b/ts/structs/HTLCUpdate.ts @@ -1,29 +1,37 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class HTLCUpdate extends CommonBase { - HTLCUpdate(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.HTLCUpdate_free(ptr); } - } + + export default class HTLCUpdate extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.HTLCUpdate_free(this.ptr); + } + } public HTLCUpdate clone() { - uint32_t ret = bindings.HTLCUpdate_clone(this.ptr); - HTLCUpdate ret_hu_conv = new HTLCUpdate(null, ret); + number ret = bindings.HTLCUpdate_clone(this.ptr); + const ret_hu_conv: HTLCUpdate = new HTLCUpdate(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.HTLCUpdate_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.HTLCUpdate_write(this.ptr); return ret; } - public static HTLCUpdate constructor_read(byte[] ser) { - uint32_t ret = bindings.HTLCUpdate_read(ser); - HTLCUpdate ret_hu_conv = new HTLCUpdate(null, ret); + public static HTLCUpdate constructor_read(Uint8Array ser) { + number ret = bindings.HTLCUpdate_read(ser); + const ret_hu_conv: HTLCUpdate = new HTLCUpdate(null, ret); return ret_hu_conv; }