Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / OpenChannel.swift
1 import LDKCHeaders
2
3 public class OpenChannel {
4
5     public internal(set) var cOpaqueStruct: LDKOpenChannel?;
6
7         
8
9     public init(pointer: LDKOpenChannel){
10                 self.cOpaqueStruct = pointer
11         }
12
13     /* STRUCT_METHODS_START */
14
15     public func get_chain_hash() -> [UInt8] {
16         
17         return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
18 OpenChannel_get_chain_hash(this_ptrPointer)
19 }.pointee);
20     }
21
22     public func set_chain_hash(val: [UInt8]) -> Void {
23         
24                                                         let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
25                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
26                                                 
27         return OpenChannel_set_chain_hash(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
28     }
29
30     public func get_temporary_channel_id() -> [UInt8] {
31         
32         return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
33 OpenChannel_get_temporary_channel_id(this_ptrPointer)
34 }.pointee);
35     }
36
37     public func set_temporary_channel_id(val: [UInt8]) -> Void {
38         
39                                                         let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
40                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
41                                                 
42         return OpenChannel_set_temporary_channel_id(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
43     }
44
45     public func get_funding_satoshis() -> UInt64 {
46         
47         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
48 OpenChannel_get_funding_satoshis(this_ptrPointer)
49 };
50     }
51
52     public func set_funding_satoshis(val: UInt64) -> Void {
53         
54                                                         let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
55                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
56                                                 
57         return OpenChannel_set_funding_satoshis(this_ptrPointer, val);
58     }
59
60     public func get_push_msat() -> UInt64 {
61         
62         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
63 OpenChannel_get_push_msat(this_ptrPointer)
64 };
65     }
66
67     public func set_push_msat(val: UInt64) -> Void {
68         
69                                                         let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
70                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
71                                                 
72         return OpenChannel_set_push_msat(this_ptrPointer, val);
73     }
74
75     public func get_dust_limit_satoshis() -> UInt64 {
76         
77         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
78 OpenChannel_get_dust_limit_satoshis(this_ptrPointer)
79 };
80     }
81
82     public func set_dust_limit_satoshis(val: UInt64) -> Void {
83         
84                                                         let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
85                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
86                                                 
87         return OpenChannel_set_dust_limit_satoshis(this_ptrPointer, val);
88     }
89
90     public func get_max_htlc_value_in_flight_msat() -> UInt64 {
91         
92         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
93 OpenChannel_get_max_htlc_value_in_flight_msat(this_ptrPointer)
94 };
95     }
96
97     public func set_max_htlc_value_in_flight_msat(val: UInt64) -> Void {
98         
99                                                         let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
100                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
101                                                 
102         return OpenChannel_set_max_htlc_value_in_flight_msat(this_ptrPointer, val);
103     }
104
105     public func get_channel_reserve_satoshis() -> UInt64 {
106         
107         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
108 OpenChannel_get_channel_reserve_satoshis(this_ptrPointer)
109 };
110     }
111
112     public func set_channel_reserve_satoshis(val: UInt64) -> Void {
113         
114                                                         let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
115                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
116                                                 
117         return OpenChannel_set_channel_reserve_satoshis(this_ptrPointer, val);
118     }
119
120     public func get_htlc_minimum_msat() -> UInt64 {
121         
122         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
123 OpenChannel_get_htlc_minimum_msat(this_ptrPointer)
124 };
125     }
126
127     public func set_htlc_minimum_msat(val: UInt64) -> Void {
128         
129                                                         let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
130                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
131                                                 
132         return OpenChannel_set_htlc_minimum_msat(this_ptrPointer, val);
133     }
134
135     public func get_feerate_per_kw() -> UInt32 {
136         
137         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
138 OpenChannel_get_feerate_per_kw(this_ptrPointer)
139 };
140     }
141
142     public func set_feerate_per_kw(val: UInt32) -> Void {
143         
144                                                         let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
145                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
146                                                 
147         return OpenChannel_set_feerate_per_kw(this_ptrPointer, val);
148     }
149
150     public func get_to_self_delay() -> UInt16 {
151         
152         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
153 OpenChannel_get_to_self_delay(this_ptrPointer)
154 };
155     }
156
157     public func set_to_self_delay(val: UInt16) -> Void {
158         
159                                                         let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
160                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
161                                                 
162         return OpenChannel_set_to_self_delay(this_ptrPointer, val);
163     }
164
165     public func get_max_accepted_htlcs() -> UInt16 {
166         
167         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
168 OpenChannel_get_max_accepted_htlcs(this_ptrPointer)
169 };
170     }
171
172     public func set_max_accepted_htlcs(val: UInt16) -> Void {
173         
174                                                         let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
175                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
176                                                 
177         return OpenChannel_set_max_accepted_htlcs(this_ptrPointer, val);
178     }
179
180     public func get_funding_pubkey() -> [UInt8] {
181         
182         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
183 OpenChannel_get_funding_pubkey(this_ptrPointer)
184 });
185     }
186
187     public func set_funding_pubkey(val: [UInt8]) -> Void {
188         
189                                                         let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
190                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
191                                                 
192         return OpenChannel_set_funding_pubkey(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
193     }
194
195     public func get_revocation_basepoint() -> [UInt8] {
196         
197         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
198 OpenChannel_get_revocation_basepoint(this_ptrPointer)
199 });
200     }
201
202     public func set_revocation_basepoint(val: [UInt8]) -> Void {
203         
204                                                         let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
205                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
206                                                 
207         return OpenChannel_set_revocation_basepoint(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
208     }
209
210     public func get_payment_point() -> [UInt8] {
211         
212         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
213 OpenChannel_get_payment_point(this_ptrPointer)
214 });
215     }
216
217     public func set_payment_point(val: [UInt8]) -> Void {
218         
219                                                         let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
220                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
221                                                 
222         return OpenChannel_set_payment_point(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
223     }
224
225     public func get_delayed_payment_basepoint() -> [UInt8] {
226         
227         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
228 OpenChannel_get_delayed_payment_basepoint(this_ptrPointer)
229 });
230     }
231
232     public func set_delayed_payment_basepoint(val: [UInt8]) -> Void {
233         
234                                                         let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
235                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
236                                                 
237         return OpenChannel_set_delayed_payment_basepoint(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
238     }
239
240     public func get_htlc_basepoint() -> [UInt8] {
241         
242         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
243 OpenChannel_get_htlc_basepoint(this_ptrPointer)
244 });
245     }
246
247     public func set_htlc_basepoint(val: [UInt8]) -> Void {
248         
249                                                         let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
250                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
251                                                 
252         return OpenChannel_set_htlc_basepoint(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
253     }
254
255     public func get_first_per_commitment_point() -> [UInt8] {
256         
257         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
258 OpenChannel_get_first_per_commitment_point(this_ptrPointer)
259 });
260     }
261
262     public func set_first_per_commitment_point(val: [UInt8]) -> Void {
263         
264                                                         let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
265                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
266                                                 
267         return OpenChannel_set_first_per_commitment_point(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
268     }
269
270     public func get_channel_flags() -> UInt8 {
271         
272         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
273 OpenChannel_get_channel_flags(this_ptrPointer)
274 };
275     }
276
277     public func set_channel_flags(val: UInt8) -> Void {
278         
279                                                         let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
280                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
281                                                 
282         return OpenChannel_set_channel_flags(this_ptrPointer, val);
283     }
284
285     public func clone(orig: OpenChannel) -> OpenChannel {
286         
287         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKOpenChannel>) in
288 OpenChannel(pointer: OpenChannel_clone(origPointer))
289 };
290     }
291
292     public func write(obj: OpenChannel) -> [UInt8] {
293         
294         return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKOpenChannel>) in
295 OpenChannel_write(objPointer)
296 });
297     }
298
299     public func read(ser: [UInt8]) -> Result_OpenChannelDecodeErrorZ {
300         
301         return Result_OpenChannelDecodeErrorZ(pointer: OpenChannel_read(Bindings.new_LDKu8slice(array: ser)));
302     }
303
304                                 
305         deinit {
306                                         if self.cOpaqueStruct?.is_owned == false {
307
308                                         
309                                         
310                 OpenChannel_free(self.cOpaqueStruct!)
311                                         
312 }
313                                 
314         }
315                         
316     /* STRUCT_METHODS_END */
317
318 }