X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FChannelInfo.ts;h=0101375df6dd49e9792caf1560c5035a8556524f;hb=f3e670e9341decac613d33fc52febf19cea32f20;hp=ea7a292f8cacf9cabb302524ee2571cb7ff1ab46;hpb=276893d3b8bd3fcb2bb10e3cab73a69d34831909;p=ldk-java diff --git a/ts/structs/ChannelInfo.ts b/ts/structs/ChannelInfo.ts index ea7a292f..0101375d 100644 --- a/ts/structs/ChannelInfo.ts +++ b/ts/structs/ChannelInfo.ts @@ -27,16 +27,17 @@ import * as bindings from '../bindings' // TODO: figure out location public void set_features(ChannelFeatures val) { bindings.ChannelInfo_set_features(this.ptr, val == null ? 0 : val.ptr & ~1); - this.ptrs_to.add(val); } - public Uint8Array get_node_one() { - Uint8Array ret = bindings.ChannelInfo_get_node_one(this.ptr); - return ret; + public NodeId get_node_one() { + number ret = bindings.ChannelInfo_get_node_one(this.ptr); + const ret_hu_conv: NodeId = new NodeId(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; } - public void set_node_one(Uint8Array val) { - bindings.ChannelInfo_set_node_one(this.ptr, val); + public void set_node_one(NodeId val) { + bindings.ChannelInfo_set_node_one(this.ptr, val == null ? 0 : val.ptr & ~1); } public DirectionalChannelInfo get_one_to_two() { @@ -48,16 +49,17 @@ import * as bindings from '../bindings' // TODO: figure out location public void set_one_to_two(DirectionalChannelInfo val) { bindings.ChannelInfo_set_one_to_two(this.ptr, val == null ? 0 : val.ptr & ~1); - this.ptrs_to.add(val); } - public Uint8Array get_node_two() { - Uint8Array ret = bindings.ChannelInfo_get_node_two(this.ptr); - return ret; + public NodeId get_node_two() { + number ret = bindings.ChannelInfo_get_node_two(this.ptr); + const ret_hu_conv: NodeId = new NodeId(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; } - public void set_node_two(Uint8Array val) { - bindings.ChannelInfo_set_node_two(this.ptr, val); + public void set_node_two(NodeId val) { + bindings.ChannelInfo_set_node_two(this.ptr, val == null ? 0 : val.ptr & ~1); } public DirectionalChannelInfo get_two_to_one() { @@ -69,7 +71,17 @@ import * as bindings from '../bindings' // TODO: figure out location public void set_two_to_one(DirectionalChannelInfo val) { bindings.ChannelInfo_set_two_to_one(this.ptr, val == null ? 0 : val.ptr & ~1); - this.ptrs_to.add(val); + } + + public Option_u64Z get_capacity_sats() { + number ret = bindings.ChannelInfo_get_capacity_sats(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_capacity_sats(Option_u64Z val) { + bindings.ChannelInfo_set_capacity_sats(this.ptr, val.ptr); } public ChannelAnnouncement get_announcement_message() { @@ -81,7 +93,18 @@ import * as bindings from '../bindings' // TODO: figure out location public void set_announcement_message(ChannelAnnouncement val) { bindings.ChannelInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1); - this.ptrs_to.add(val); + } + + public static ChannelInfo constructor_new(ChannelFeatures features_arg, NodeId node_one_arg, DirectionalChannelInfo one_to_two_arg, NodeId node_two_arg, DirectionalChannelInfo two_to_one_arg, Option_u64Z capacity_sats_arg, ChannelAnnouncement announcement_message_arg) { + number ret = bindings.ChannelInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, node_one_arg == null ? 0 : node_one_arg.ptr & ~1, one_to_two_arg == null ? 0 : one_to_two_arg.ptr & ~1, node_two_arg == null ? 0 : node_two_arg.ptr & ~1, two_to_one_arg == null ? 0 : two_to_one_arg.ptr & ~1, capacity_sats_arg.ptr, announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1); + const ret_hu_conv: ChannelInfo = new ChannelInfo(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public number clone_ptr() { + number ret = bindings.ChannelInfo_clone_ptr(this.ptr); + return ret; } public ChannelInfo clone() {