X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FChannelTransactionParameters.ts;h=3d6e367ffae3a59ae6e21524534ab287335112fd;hb=22f5f4208b1f3b5542292250f1612b944f5cd7fd;hp=45cf099abb6c445e9290b4bc70bc32d28e08ed1f;hpb=56e9910ffaa7fccf2cb777dc9cf55e01a9681543;p=ldk-java diff --git a/ts/structs/ChannelTransactionParameters.ts b/ts/structs/ChannelTransactionParameters.ts index 45cf099a..3d6e367f 100644 --- a/ts/structs/ChannelTransactionParameters.ts +++ b/ts/structs/ChannelTransactionParameters.ts @@ -1,24 +1,32 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ChannelTransactionParameters extends CommonBase { - ChannelTransactionParameters(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ChannelTransactionParameters_free(ptr); } - } + + export default class ChannelTransactionParameters extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ChannelTransactionParameters_free(this.ptr); + } + } public ChannelTransactionParameters clone() { - uint32_t ret = bindings.ChannelTransactionParameters_clone(this.ptr); - ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret); + number ret = bindings.ChannelTransactionParameters_clone(this.ptr); + const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret); return ret_hu_conv; } public ChannelPublicKeys get_holder_pubkeys() { - uint32_t ret = bindings.ChannelTransactionParameters_get_holder_pubkeys(this.ptr); - ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); + number ret = bindings.ChannelTransactionParameters_get_holder_pubkeys(this.ptr); + const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); return ret_hu_conv; } @@ -27,12 +35,12 @@ public class ChannelTransactionParameters extends CommonBase { this.ptrs_to.add(val); } - public short get_holder_selected_contest_delay() { - short ret = bindings.ChannelTransactionParameters_get_holder_selected_contest_delay(this.ptr); + public number get_holder_selected_contest_delay() { + number ret = bindings.ChannelTransactionParameters_get_holder_selected_contest_delay(this.ptr); return ret; } - public void set_holder_selected_contest_delay(short val) { + public void set_holder_selected_contest_delay(number val) { bindings.ChannelTransactionParameters_set_holder_selected_contest_delay(this.ptr, val); } @@ -46,8 +54,8 @@ public class ChannelTransactionParameters extends CommonBase { } public CounterpartyChannelTransactionParameters get_counterparty_parameters() { - uint32_t ret = bindings.ChannelTransactionParameters_get_counterparty_parameters(this.ptr); - CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret); + number ret = bindings.ChannelTransactionParameters_get_counterparty_parameters(this.ptr); + const ret_hu_conv: CounterpartyChannelTransactionParameters = new CounterpartyChannelTransactionParameters(null, ret); return ret_hu_conv; } @@ -57,8 +65,8 @@ public class ChannelTransactionParameters extends CommonBase { } public OutPoint get_funding_outpoint() { - uint32_t ret = bindings.ChannelTransactionParameters_get_funding_outpoint(this.ptr); - OutPoint ret_hu_conv = new OutPoint(null, ret); + number ret = bindings.ChannelTransactionParameters_get_funding_outpoint(this.ptr); + const ret_hu_conv: OutPoint = new OutPoint(null, ret); return ret_hu_conv; } @@ -67,9 +75,9 @@ public class ChannelTransactionParameters extends CommonBase { this.ptrs_to.add(val); } - public static ChannelTransactionParameters constructor_new(ChannelPublicKeys holder_pubkeys_arg, short holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, CounterpartyChannelTransactionParameters counterparty_parameters_arg, OutPoint funding_outpoint_arg) { - uint32_t ret = bindings.ChannelTransactionParameters_new(holder_pubkeys_arg == null ? 0 : holder_pubkeys_arg.ptr & ~1, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg == null ? 0 : counterparty_parameters_arg.ptr & ~1, funding_outpoint_arg == null ? 0 : funding_outpoint_arg.ptr & ~1); - ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret); + public static ChannelTransactionParameters constructor_new(ChannelPublicKeys holder_pubkeys_arg, number holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, CounterpartyChannelTransactionParameters counterparty_parameters_arg, OutPoint funding_outpoint_arg) { + number ret = bindings.ChannelTransactionParameters_new(holder_pubkeys_arg == null ? 0 : holder_pubkeys_arg.ptr & ~1, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg == null ? 0 : counterparty_parameters_arg.ptr & ~1, funding_outpoint_arg == null ? 0 : funding_outpoint_arg.ptr & ~1); + const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret); ret_hu_conv.ptrs_to.add(holder_pubkeys_arg); ret_hu_conv.ptrs_to.add(counterparty_parameters_arg); ret_hu_conv.ptrs_to.add(funding_outpoint_arg); @@ -82,25 +90,25 @@ public class ChannelTransactionParameters extends CommonBase { } public DirectedChannelTransactionParameters as_holder_broadcastable() { - uint32_t ret = bindings.ChannelTransactionParameters_as_holder_broadcastable(this.ptr); - DirectedChannelTransactionParameters ret_hu_conv = new DirectedChannelTransactionParameters(null, ret); + number ret = bindings.ChannelTransactionParameters_as_holder_broadcastable(this.ptr); + const ret_hu_conv: DirectedChannelTransactionParameters = new DirectedChannelTransactionParameters(null, ret); return ret_hu_conv; } public DirectedChannelTransactionParameters as_counterparty_broadcastable() { - uint32_t ret = bindings.ChannelTransactionParameters_as_counterparty_broadcastable(this.ptr); - DirectedChannelTransactionParameters ret_hu_conv = new DirectedChannelTransactionParameters(null, ret); + number ret = bindings.ChannelTransactionParameters_as_counterparty_broadcastable(this.ptr); + const ret_hu_conv: DirectedChannelTransactionParameters = new DirectedChannelTransactionParameters(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.ChannelTransactionParameters_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.ChannelTransactionParameters_write(this.ptr); return ret; } - public static ChannelTransactionParameters constructor_read(byte[] ser) { - uint32_t ret = bindings.ChannelTransactionParameters_read(ser); - ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret); + public static ChannelTransactionParameters constructor_read(Uint8Array ser) { + number ret = bindings.ChannelTransactionParameters_read(ser); + const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret); return ret_hu_conv; }