X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FChannelHandshakeConfig.ts;h=2c06b274874b3e3a27aa602b2ea73eebd1ed24f1;hb=f3e670e9341decac613d33fc52febf19cea32f20;hp=f37c057f1cfd3e036895ff91af5e3a1f2c94e783;hpb=822471992c6bf6f9985e531cc5940e4cc35e3e4c;p=ldk-java diff --git a/ts/structs/ChannelHandshakeConfig.ts b/ts/structs/ChannelHandshakeConfig.ts index f37c057f..2c06b274 100644 --- a/ts/structs/ChannelHandshakeConfig.ts +++ b/ts/structs/ChannelHandshakeConfig.ts @@ -1,57 +1,73 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ChannelHandshakeConfig extends CommonBase { - ChannelHandshakeConfig(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ChannelHandshakeConfig_free(ptr); } - } - public ChannelHandshakeConfig clone() { - uint32_t ret = bindings.ChannelHandshakeConfig_clone(this.ptr); - ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret); - return ret_hu_conv; - } - public int get_minimum_depth() { - int ret = bindings.ChannelHandshakeConfig_get_minimum_depth(this.ptr); + export default class ChannelHandshakeConfig extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ChannelHandshakeConfig_free(this.ptr); + } + } + public number get_minimum_depth() { + number ret = bindings.ChannelHandshakeConfig_get_minimum_depth(this.ptr); return ret; } - public void set_minimum_depth(int val) { + public void set_minimum_depth(number val) { bindings.ChannelHandshakeConfig_set_minimum_depth(this.ptr, val); } - public short get_our_to_self_delay() { - short ret = bindings.ChannelHandshakeConfig_get_our_to_self_delay(this.ptr); + public number get_our_to_self_delay() { + number ret = bindings.ChannelHandshakeConfig_get_our_to_self_delay(this.ptr); return ret; } - public void set_our_to_self_delay(short val) { + public void set_our_to_self_delay(number val) { bindings.ChannelHandshakeConfig_set_our_to_self_delay(this.ptr, val); } - public long get_our_htlc_minimum_msat() { - long ret = bindings.ChannelHandshakeConfig_get_our_htlc_minimum_msat(this.ptr); + public number get_our_htlc_minimum_msat() { + number ret = bindings.ChannelHandshakeConfig_get_our_htlc_minimum_msat(this.ptr); return ret; } - public void set_our_htlc_minimum_msat(long val) { + public void set_our_htlc_minimum_msat(number val) { bindings.ChannelHandshakeConfig_set_our_htlc_minimum_msat(this.ptr, val); } - public static ChannelHandshakeConfig constructor_new(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg) { - uint32_t ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg); - ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret); + public static ChannelHandshakeConfig constructor_new(number minimum_depth_arg, number our_to_self_delay_arg, number our_htlc_minimum_msat_arg) { + number ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg); + const ret_hu_conv: ChannelHandshakeConfig = new ChannelHandshakeConfig(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public number clone_ptr() { + number ret = bindings.ChannelHandshakeConfig_clone_ptr(this.ptr); + return ret; + } + + public ChannelHandshakeConfig clone() { + number ret = bindings.ChannelHandshakeConfig_clone(this.ptr); + const ret_hu_conv: ChannelHandshakeConfig = new ChannelHandshakeConfig(null, ret); + ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } public static ChannelHandshakeConfig constructor_default() { - uint32_t ret = bindings.ChannelHandshakeConfig_default(); - ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret); + number ret = bindings.ChannelHandshakeConfig_default(); + const ret_hu_conv: ChannelHandshakeConfig = new ChannelHandshakeConfig(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; }