Bindings updates
[ldk-java] / ts / structs / ChannelDetails.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 ChannelDetails 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.ChannelDetails_free(this.ptr);
19                     }
20                 }
21         public ChannelDetails clone() {
22                 number ret = bindings.ChannelDetails_clone(this.ptr);
23                 const ret_hu_conv: ChannelDetails = new ChannelDetails(null, ret);
24                 ret_hu_conv.ptrs_to.add(this);
25                 return ret_hu_conv;
26         }
27
28         public Uint8Array get_channel_id() {
29                 Uint8Array ret = bindings.ChannelDetails_get_channel_id(this.ptr);
30                 return ret;
31         }
32
33         public void set_channel_id(Uint8Array val) {
34                 bindings.ChannelDetails_set_channel_id(this.ptr, val);
35         }
36
37         public Uint8Array get_remote_network_id() {
38                 Uint8Array ret = bindings.ChannelDetails_get_remote_network_id(this.ptr);
39                 return ret;
40         }
41
42         public void set_remote_network_id(Uint8Array val) {
43                 bindings.ChannelDetails_set_remote_network_id(this.ptr, val);
44         }
45
46         public InitFeatures get_counterparty_features() {
47                 number ret = bindings.ChannelDetails_get_counterparty_features(this.ptr);
48                 const ret_hu_conv: InitFeatures = new InitFeatures(null, ret);
49                 ret_hu_conv.ptrs_to.add(this);
50                 return ret_hu_conv;
51         }
52
53         public void set_counterparty_features(InitFeatures val) {
54                 bindings.ChannelDetails_set_counterparty_features(this.ptr, val == null ? 0 : val.ptr & ~1);
55                 this.ptrs_to.add(val);
56                 // Due to rust's strict-ownership memory model, in some cases we need to "move"
57                 // an object to pass exclusive ownership to the function being called.
58                 // In most cases, we avoid this being visible in GC'd languages by cloning the object
59                 // at the FFI layer, creating a new object which Rust can claim ownership of
60                 // However, in some cases (eg here), there is no way to clone an object, and thus
61                 // we actually have to pass full ownership to Rust.
62                 // Thus, after this call, val is reset to null and is now a dummy object.
63                 val.ptr = 0;
64         }
65
66         public number get_channel_value_satoshis() {
67                 number ret = bindings.ChannelDetails_get_channel_value_satoshis(this.ptr);
68                 return ret;
69         }
70
71         public void set_channel_value_satoshis(number val) {
72                 bindings.ChannelDetails_set_channel_value_satoshis(this.ptr, val);
73         }
74
75         public number get_user_id() {
76                 number ret = bindings.ChannelDetails_get_user_id(this.ptr);
77                 return ret;
78         }
79
80         public void set_user_id(number val) {
81                 bindings.ChannelDetails_set_user_id(this.ptr, val);
82         }
83
84         public number get_outbound_capacity_msat() {
85                 number ret = bindings.ChannelDetails_get_outbound_capacity_msat(this.ptr);
86                 return ret;
87         }
88
89         public void set_outbound_capacity_msat(number val) {
90                 bindings.ChannelDetails_set_outbound_capacity_msat(this.ptr, val);
91         }
92
93         public number get_inbound_capacity_msat() {
94                 number ret = bindings.ChannelDetails_get_inbound_capacity_msat(this.ptr);
95                 return ret;
96         }
97
98         public void set_inbound_capacity_msat(number val) {
99                 bindings.ChannelDetails_set_inbound_capacity_msat(this.ptr, val);
100         }
101
102         public boolean get_is_live() {
103                 boolean ret = bindings.ChannelDetails_get_is_live(this.ptr);
104                 return ret;
105         }
106
107         public void set_is_live(boolean val) {
108                 bindings.ChannelDetails_set_is_live(this.ptr, val);
109         }
110
111 }