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);
30 this.ptrs_to.add(val);
33 public Uint8Array get_node_one() {
34 Uint8Array ret = bindings.ChannelInfo_get_node_one(this.ptr);
38 public void set_node_one(Uint8Array val) {
39 bindings.ChannelInfo_set_node_one(this.ptr, val);
42 public DirectionalChannelInfo get_one_to_two() {
43 number ret = bindings.ChannelInfo_get_one_to_two(this.ptr);
44 const ret_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, ret);
45 ret_hu_conv.ptrs_to.add(this);
49 public void set_one_to_two(DirectionalChannelInfo val) {
50 bindings.ChannelInfo_set_one_to_two(this.ptr, val == null ? 0 : val.ptr & ~1);
51 this.ptrs_to.add(val);
54 public Uint8Array get_node_two() {
55 Uint8Array ret = bindings.ChannelInfo_get_node_two(this.ptr);
59 public void set_node_two(Uint8Array val) {
60 bindings.ChannelInfo_set_node_two(this.ptr, val);
63 public DirectionalChannelInfo get_two_to_one() {
64 number ret = bindings.ChannelInfo_get_two_to_one(this.ptr);
65 const ret_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, ret);
66 ret_hu_conv.ptrs_to.add(this);
70 public void set_two_to_one(DirectionalChannelInfo val) {
71 bindings.ChannelInfo_set_two_to_one(this.ptr, val == null ? 0 : val.ptr & ~1);
72 this.ptrs_to.add(val);
75 public Option_u64Z get_capacity_sats() {
76 number ret = bindings.ChannelInfo_get_capacity_sats(this.ptr);
77 Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
78 ret_hu_conv.ptrs_to.add(this);
82 public void set_capacity_sats(Option_u64Z val) {
83 bindings.ChannelInfo_set_capacity_sats(this.ptr, val.ptr);
86 public ChannelAnnouncement get_announcement_message() {
87 number ret = bindings.ChannelInfo_get_announcement_message(this.ptr);
88 const ret_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, ret);
89 ret_hu_conv.ptrs_to.add(this);
93 public void set_announcement_message(ChannelAnnouncement val) {
94 bindings.ChannelInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1);
95 this.ptrs_to.add(val);
98 public static ChannelInfo constructor_new(ChannelFeatures features_arg, Uint8Array node_one_arg, DirectionalChannelInfo one_to_two_arg, Uint8Array node_two_arg, DirectionalChannelInfo two_to_one_arg, Option_u64Z capacity_sats_arg, ChannelAnnouncement announcement_message_arg) {
99 number ret = bindings.ChannelInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, node_one_arg, one_to_two_arg == null ? 0 : one_to_two_arg.ptr & ~1, node_two_arg, 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);
100 const ret_hu_conv: ChannelInfo = new ChannelInfo(null, ret);
101 ret_hu_conv.ptrs_to.add(ret_hu_conv);
102 ret_hu_conv.ptrs_to.add(features_arg);
103 ret_hu_conv.ptrs_to.add(one_to_two_arg);
104 ret_hu_conv.ptrs_to.add(two_to_one_arg);
105 ret_hu_conv.ptrs_to.add(announcement_message_arg);
109 public ChannelInfo clone() {
110 number ret = bindings.ChannelInfo_clone(this.ptr);
111 const ret_hu_conv: ChannelInfo = new ChannelInfo(null, ret);
112 ret_hu_conv.ptrs_to.add(this);
116 public Uint8Array write() {
117 Uint8Array ret = bindings.ChannelInfo_write(this.ptr);
121 public static Result_ChannelInfoDecodeErrorZ constructor_read(Uint8Array ser) {
122 number ret = bindings.ChannelInfo_read(ser);
123 Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret);