X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FHTLCOutputInCommitment.ts;h=938d16f84f2bbebb33dacf480f0b38d00b6302c1;hb=22f5f4208b1f3b5542292250f1612b944f5cd7fd;hp=cee9cf8e1b842472463baf68ff4a3b06a7491a53;hpb=56e9910ffaa7fccf2cb777dc9cf55e01a9681543;p=ldk-java diff --git a/ts/structs/HTLCOutputInCommitment.ts b/ts/structs/HTLCOutputInCommitment.ts index cee9cf8e..938d16f8 100644 --- a/ts/structs/HTLCOutputInCommitment.ts +++ b/ts/structs/HTLCOutputInCommitment.ts @@ -1,18 +1,26 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class HTLCOutputInCommitment extends CommonBase { - HTLCOutputInCommitment(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.HTLCOutputInCommitment_free(ptr); } - } + + export default class HTLCOutputInCommitment extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.HTLCOutputInCommitment_free(this.ptr); + } + } public HTLCOutputInCommitment clone() { - uint32_t ret = bindings.HTLCOutputInCommitment_clone(this.ptr); - HTLCOutputInCommitment ret_hu_conv = new HTLCOutputInCommitment(null, ret); + number ret = bindings.HTLCOutputInCommitment_clone(this.ptr); + const ret_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, ret); return ret_hu_conv; } @@ -25,41 +33,41 @@ public class HTLCOutputInCommitment extends CommonBase { bindings.HTLCOutputInCommitment_set_offered(this.ptr, val); } - public long get_amount_msat() { - long ret = bindings.HTLCOutputInCommitment_get_amount_msat(this.ptr); + public number get_amount_msat() { + number ret = bindings.HTLCOutputInCommitment_get_amount_msat(this.ptr); return ret; } - public void set_amount_msat(long val) { + public void set_amount_msat(number val) { bindings.HTLCOutputInCommitment_set_amount_msat(this.ptr, val); } - public int get_cltv_expiry() { - int ret = bindings.HTLCOutputInCommitment_get_cltv_expiry(this.ptr); + public number get_cltv_expiry() { + number ret = bindings.HTLCOutputInCommitment_get_cltv_expiry(this.ptr); return ret; } - public void set_cltv_expiry(int val) { + public void set_cltv_expiry(number val) { bindings.HTLCOutputInCommitment_set_cltv_expiry(this.ptr, val); } - public byte[] get_payment_hash() { - byte[] ret = bindings.HTLCOutputInCommitment_get_payment_hash(this.ptr); + public Uint8Array get_payment_hash() { + Uint8Array ret = bindings.HTLCOutputInCommitment_get_payment_hash(this.ptr); return ret; } - public void set_payment_hash(byte[] val) { + public void set_payment_hash(Uint8Array val) { bindings.HTLCOutputInCommitment_set_payment_hash(this.ptr, val); } - public byte[] write() { - byte[] ret = bindings.HTLCOutputInCommitment_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.HTLCOutputInCommitment_write(this.ptr); return ret; } - public static HTLCOutputInCommitment constructor_read(byte[] ser) { - uint32_t ret = bindings.HTLCOutputInCommitment_read(ser); - HTLCOutputInCommitment ret_hu_conv = new HTLCOutputInCommitment(null, ret); + public static HTLCOutputInCommitment constructor_read(Uint8Array ser) { + number ret = bindings.HTLCOutputInCommitment_read(ser); + const ret_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, ret); return ret_hu_conv; }