3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class ChannelInfo extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.ChannelInfo_free(this.ptr);
21 public ChannelFeatures get_features() {
22 number ret = bindings.ChannelInfo_get_features(this.ptr);
23 const ret_hu_conv: ChannelFeatures = new ChannelFeatures(null, ret);
24 ret_hu_conv.ptrs_to.add(this);
28 public void set_features(ChannelFeatures val) {
29 bindings.ChannelInfo_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
32 public NodeId get_node_one() {
33 number ret = bindings.ChannelInfo_get_node_one(this.ptr);
34 const ret_hu_conv: NodeId = new NodeId(null, ret);
35 ret_hu_conv.ptrs_to.add(this);
39 public void set_node_one(NodeId val) {
40 bindings.ChannelInfo_set_node_one(this.ptr, val == null ? 0 : val.ptr & ~1);
43 public DirectionalChannelInfo get_one_to_two() {
44 number ret = bindings.ChannelInfo_get_one_to_two(this.ptr);
45 const ret_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, ret);
46 ret_hu_conv.ptrs_to.add(this);
50 public void set_one_to_two(DirectionalChannelInfo val) {
51 bindings.ChannelInfo_set_one_to_two(this.ptr, val == null ? 0 : val.ptr & ~1);
54 public NodeId get_node_two() {
55 number ret = bindings.ChannelInfo_get_node_two(this.ptr);
56 const ret_hu_conv: NodeId = new NodeId(null, ret);
57 ret_hu_conv.ptrs_to.add(this);
61 public void set_node_two(NodeId val) {
62 bindings.ChannelInfo_set_node_two(this.ptr, val == null ? 0 : val.ptr & ~1);
65 public DirectionalChannelInfo get_two_to_one() {
66 number ret = bindings.ChannelInfo_get_two_to_one(this.ptr);
67 const ret_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, ret);
68 ret_hu_conv.ptrs_to.add(this);
72 public void set_two_to_one(DirectionalChannelInfo val) {
73 bindings.ChannelInfo_set_two_to_one(this.ptr, val == null ? 0 : val.ptr & ~1);
76 public Option_u64Z get_capacity_sats() {
77 number ret = bindings.ChannelInfo_get_capacity_sats(this.ptr);
78 Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
79 ret_hu_conv.ptrs_to.add(this);
83 public void set_capacity_sats(Option_u64Z val) {
84 bindings.ChannelInfo_set_capacity_sats(this.ptr, val.ptr);
87 public ChannelAnnouncement get_announcement_message() {
88 number ret = bindings.ChannelInfo_get_announcement_message(this.ptr);
89 const ret_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, ret);
90 ret_hu_conv.ptrs_to.add(this);
94 public void set_announcement_message(ChannelAnnouncement val) {
95 bindings.ChannelInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1);
98 public number clone_ptr() {
99 number ret = bindings.ChannelInfo_clone_ptr(this.ptr);
103 public ChannelInfo clone() {
104 number ret = bindings.ChannelInfo_clone(this.ptr);
105 const ret_hu_conv: ChannelInfo = new ChannelInfo(null, ret);
106 ret_hu_conv.ptrs_to.add(this);
110 public Uint8Array write() {
111 Uint8Array ret = bindings.ChannelInfo_write(this.ptr);
115 public static Result_ChannelInfoDecodeErrorZ constructor_read(Uint8Array ser) {
116 number ret = bindings.ChannelInfo_read(ser);
117 Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret);