Update auto-updated Java files
[ldk-java] / ts / structs / ChannelInfo.ts
1
2             
3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
5
6
7
8             export default class ChannelInfo extends CommonBase {
9                 constructor(_dummy: object, ptr: number) {
10                     super(ptr);
11                 }
12
13                 
14                 protected finalize() {
15                     super.finalize();
16
17                     if (this.ptr != 0) {
18                         bindings.ChannelInfo_free(this.ptr);
19                     }
20                 }
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);
25                 return ret_hu_conv;
26         }
27
28         public void set_features(ChannelFeatures val) {
29                 bindings.ChannelInfo_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
30         }
31
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);
36                 return ret_hu_conv;
37         }
38
39         public void set_node_one(NodeId val) {
40                 bindings.ChannelInfo_set_node_one(this.ptr, val == null ? 0 : val.ptr & ~1);
41         }
42
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);
47                 return ret_hu_conv;
48         }
49
50         public void set_one_to_two(DirectionalChannelInfo val) {
51                 bindings.ChannelInfo_set_one_to_two(this.ptr, val == null ? 0 : val.ptr & ~1);
52         }
53
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);
58                 return ret_hu_conv;
59         }
60
61         public void set_node_two(NodeId val) {
62                 bindings.ChannelInfo_set_node_two(this.ptr, val == null ? 0 : val.ptr & ~1);
63         }
64
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);
69                 return ret_hu_conv;
70         }
71
72         public void set_two_to_one(DirectionalChannelInfo val) {
73                 bindings.ChannelInfo_set_two_to_one(this.ptr, val == null ? 0 : val.ptr & ~1);
74         }
75
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);
80                 return ret_hu_conv;
81         }
82
83         public void set_capacity_sats(Option_u64Z val) {
84                 bindings.ChannelInfo_set_capacity_sats(this.ptr, val.ptr);
85         }
86
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);
91                 return ret_hu_conv;
92         }
93
94         public void set_announcement_message(ChannelAnnouncement val) {
95                 bindings.ChannelInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1);
96         }
97
98         public number clone_ptr() {
99                 number ret = bindings.ChannelInfo_clone_ptr(this.ptr);
100                 return ret;
101         }
102
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);
107                 return ret_hu_conv;
108         }
109
110         public Uint8Array write() {
111                 Uint8Array ret = bindings.ChannelInfo_write(this.ptr);
112                 return ret;
113         }
114
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);
118                 return ret_hu_conv;
119         }
120
121 }