+
import CommonBase from './CommonBase';
import * as bindings from '../bindings' // TODO: figure out location
-public class DirectionalChannelInfo extends CommonBase {
- DirectionalChannelInfo(Object _dummy, long ptr) { super(ptr); }
- @Override @SuppressWarnings("deprecation")
- protected void finalize() throws Throwable {
- super.finalize();
- if (ptr != 0) { bindings.DirectionalChannelInfo_free(ptr); }
- }
- public int get_last_update() {
- int ret = bindings.DirectionalChannelInfo_get_last_update(this.ptr);
+
+ export default class DirectionalChannelInfo extends CommonBase {
+ constructor(_dummy: object, ptr: number) {
+ super(ptr);
+ }
+
+
+ protected finalize() {
+ super.finalize();
+
+ if (this.ptr != 0) {
+ bindings.DirectionalChannelInfo_free(this.ptr);
+ }
+ }
+ public number get_last_update() {
+ number ret = bindings.DirectionalChannelInfo_get_last_update(this.ptr);
return ret;
}
- public void set_last_update(int val) {
+ public void set_last_update(number val) {
bindings.DirectionalChannelInfo_set_last_update(this.ptr, val);
}
bindings.DirectionalChannelInfo_set_enabled(this.ptr, val);
}
- public short get_cltv_expiry_delta() {
- short ret = bindings.DirectionalChannelInfo_get_cltv_expiry_delta(this.ptr);
+ public number get_cltv_expiry_delta() {
+ number ret = bindings.DirectionalChannelInfo_get_cltv_expiry_delta(this.ptr);
return ret;
}
- public void set_cltv_expiry_delta(short val) {
+ public void set_cltv_expiry_delta(number val) {
bindings.DirectionalChannelInfo_set_cltv_expiry_delta(this.ptr, val);
}
- public long get_htlc_minimum_msat() {
- long ret = bindings.DirectionalChannelInfo_get_htlc_minimum_msat(this.ptr);
+ public number get_htlc_minimum_msat() {
+ number ret = bindings.DirectionalChannelInfo_get_htlc_minimum_msat(this.ptr);
return ret;
}
- public void set_htlc_minimum_msat(long val) {
+ public void set_htlc_minimum_msat(number val) {
bindings.DirectionalChannelInfo_set_htlc_minimum_msat(this.ptr, val);
}
+ public Option_u64Z get_htlc_maximum_msat() {
+ number ret = bindings.DirectionalChannelInfo_get_htlc_maximum_msat(this.ptr);
+ Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public void set_htlc_maximum_msat(Option_u64Z val) {
+ bindings.DirectionalChannelInfo_set_htlc_maximum_msat(this.ptr, val.ptr);
+ }
+
public RoutingFees get_fees() {
- uint32_t ret = bindings.DirectionalChannelInfo_get_fees(this.ptr);
- RoutingFees ret_hu_conv = new RoutingFees(null, ret);
+ number ret = bindings.DirectionalChannelInfo_get_fees(this.ptr);
+ const ret_hu_conv: RoutingFees = new RoutingFees(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
public void set_fees(RoutingFees val) {
bindings.DirectionalChannelInfo_set_fees(this.ptr, val == null ? 0 : val.ptr & ~1);
- this.ptrs_to.add(val);
}
public ChannelUpdate get_last_update_message() {
- uint32_t ret = bindings.DirectionalChannelInfo_get_last_update_message(this.ptr);
- ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret);
+ number ret = bindings.DirectionalChannelInfo_get_last_update_message(this.ptr);
+ const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
public void set_last_update_message(ChannelUpdate val) {
bindings.DirectionalChannelInfo_set_last_update_message(this.ptr, val == null ? 0 : val.ptr & ~1);
- this.ptrs_to.add(val);
}
- public byte[] write() {
- byte[] ret = bindings.DirectionalChannelInfo_write(this.ptr);
+ public static DirectionalChannelInfo constructor_new(number last_update_arg, boolean enabled_arg, number cltv_expiry_delta_arg, number htlc_minimum_msat_arg, Option_u64Z htlc_maximum_msat_arg, RoutingFees fees_arg, ChannelUpdate last_update_message_arg) {
+ number ret = bindings.DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg.ptr, fees_arg == null ? 0 : fees_arg.ptr & ~1, last_update_message_arg == null ? 0 : last_update_message_arg.ptr & ~1);
+ const ret_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ public number clone_ptr() {
+ number ret = bindings.DirectionalChannelInfo_clone_ptr(this.ptr);
+ return ret;
+ }
+
+ public DirectionalChannelInfo clone() {
+ number ret = bindings.DirectionalChannelInfo_clone(this.ptr);
+ const ret_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public Uint8Array write() {
+ Uint8Array ret = bindings.DirectionalChannelInfo_write(this.ptr);
return ret;
}
- public static DirectionalChannelInfo constructor_read(byte[] ser) {
- uint32_t ret = bindings.DirectionalChannelInfo_read(ser);
- DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret);
+ public static Result_DirectionalChannelInfoDecodeErrorZ constructor_read(Uint8Array ser) {
+ number ret = bindings.DirectionalChannelInfo_read(ser);
+ Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}