Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / AcceptChannel.swift
1 import LDKCHeaders
2
3 public class AcceptChannel {
4
5     public internal(set) var cOpaqueStruct: LDKAcceptChannel?;
6
7         
8
9     public init(pointer: LDKAcceptChannel){
10                 self.cOpaqueStruct = pointer
11         }
12
13     /* STRUCT_METHODS_START */
14
15     public func get_temporary_channel_id() -> [UInt8] {
16         
17         return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKAcceptChannel>) in
18 AcceptChannel_get_temporary_channel_id(this_ptrPointer)
19 }.pointee);
20     }
21
22     public func set_temporary_channel_id(val: [UInt8]) -> Void {
23         
24                                                         let this_ptrPointer = UnsafeMutablePointer<LDKAcceptChannel>.allocate(capacity: 1)
25                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
26                                                 
27         return AcceptChannel_set_temporary_channel_id(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
28     }
29
30     public func get_dust_limit_satoshis() -> UInt64 {
31         
32         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKAcceptChannel>) in
33 AcceptChannel_get_dust_limit_satoshis(this_ptrPointer)
34 };
35     }
36
37     public func set_dust_limit_satoshis(val: UInt64) -> Void {
38         
39                                                         let this_ptrPointer = UnsafeMutablePointer<LDKAcceptChannel>.allocate(capacity: 1)
40                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
41                                                 
42         return AcceptChannel_set_dust_limit_satoshis(this_ptrPointer, val);
43     }
44
45     public func get_max_htlc_value_in_flight_msat() -> UInt64 {
46         
47         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKAcceptChannel>) in
48 AcceptChannel_get_max_htlc_value_in_flight_msat(this_ptrPointer)
49 };
50     }
51
52     public func set_max_htlc_value_in_flight_msat(val: UInt64) -> Void {
53         
54                                                         let this_ptrPointer = UnsafeMutablePointer<LDKAcceptChannel>.allocate(capacity: 1)
55                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
56                                                 
57         return AcceptChannel_set_max_htlc_value_in_flight_msat(this_ptrPointer, val);
58     }
59
60     public func get_channel_reserve_satoshis() -> UInt64 {
61         
62         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKAcceptChannel>) in
63 AcceptChannel_get_channel_reserve_satoshis(this_ptrPointer)
64 };
65     }
66
67     public func set_channel_reserve_satoshis(val: UInt64) -> Void {
68         
69                                                         let this_ptrPointer = UnsafeMutablePointer<LDKAcceptChannel>.allocate(capacity: 1)
70                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
71                                                 
72         return AcceptChannel_set_channel_reserve_satoshis(this_ptrPointer, val);
73     }
74
75     public func get_htlc_minimum_msat() -> UInt64 {
76         
77         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKAcceptChannel>) in
78 AcceptChannel_get_htlc_minimum_msat(this_ptrPointer)
79 };
80     }
81
82     public func set_htlc_minimum_msat(val: UInt64) -> Void {
83         
84                                                         let this_ptrPointer = UnsafeMutablePointer<LDKAcceptChannel>.allocate(capacity: 1)
85                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
86                                                 
87         return AcceptChannel_set_htlc_minimum_msat(this_ptrPointer, val);
88     }
89
90     public func get_minimum_depth() -> UInt32 {
91         
92         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKAcceptChannel>) in
93 AcceptChannel_get_minimum_depth(this_ptrPointer)
94 };
95     }
96
97     public func set_minimum_depth(val: UInt32) -> Void {
98         
99                                                         let this_ptrPointer = UnsafeMutablePointer<LDKAcceptChannel>.allocate(capacity: 1)
100                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
101                                                 
102         return AcceptChannel_set_minimum_depth(this_ptrPointer, val);
103     }
104
105     public func get_to_self_delay() -> UInt16 {
106         
107         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKAcceptChannel>) in
108 AcceptChannel_get_to_self_delay(this_ptrPointer)
109 };
110     }
111
112     public func set_to_self_delay(val: UInt16) -> Void {
113         
114                                                         let this_ptrPointer = UnsafeMutablePointer<LDKAcceptChannel>.allocate(capacity: 1)
115                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
116                                                 
117         return AcceptChannel_set_to_self_delay(this_ptrPointer, val);
118     }
119
120     public func get_max_accepted_htlcs() -> UInt16 {
121         
122         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKAcceptChannel>) in
123 AcceptChannel_get_max_accepted_htlcs(this_ptrPointer)
124 };
125     }
126
127     public func set_max_accepted_htlcs(val: UInt16) -> Void {
128         
129                                                         let this_ptrPointer = UnsafeMutablePointer<LDKAcceptChannel>.allocate(capacity: 1)
130                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
131                                                 
132         return AcceptChannel_set_max_accepted_htlcs(this_ptrPointer, val);
133     }
134
135     public func get_funding_pubkey() -> [UInt8] {
136         
137         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKAcceptChannel>) in
138 AcceptChannel_get_funding_pubkey(this_ptrPointer)
139 });
140     }
141
142     public func set_funding_pubkey(val: [UInt8]) -> Void {
143         
144                                                         let this_ptrPointer = UnsafeMutablePointer<LDKAcceptChannel>.allocate(capacity: 1)
145                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
146                                                 
147         return AcceptChannel_set_funding_pubkey(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
148     }
149
150     public func get_revocation_basepoint() -> [UInt8] {
151         
152         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKAcceptChannel>) in
153 AcceptChannel_get_revocation_basepoint(this_ptrPointer)
154 });
155     }
156
157     public func set_revocation_basepoint(val: [UInt8]) -> Void {
158         
159                                                         let this_ptrPointer = UnsafeMutablePointer<LDKAcceptChannel>.allocate(capacity: 1)
160                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
161                                                 
162         return AcceptChannel_set_revocation_basepoint(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
163     }
164
165     public func get_payment_point() -> [UInt8] {
166         
167         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKAcceptChannel>) in
168 AcceptChannel_get_payment_point(this_ptrPointer)
169 });
170     }
171
172     public func set_payment_point(val: [UInt8]) -> Void {
173         
174                                                         let this_ptrPointer = UnsafeMutablePointer<LDKAcceptChannel>.allocate(capacity: 1)
175                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
176                                                 
177         return AcceptChannel_set_payment_point(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
178     }
179
180     public func get_delayed_payment_basepoint() -> [UInt8] {
181         
182         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKAcceptChannel>) in
183 AcceptChannel_get_delayed_payment_basepoint(this_ptrPointer)
184 });
185     }
186
187     public func set_delayed_payment_basepoint(val: [UInt8]) -> Void {
188         
189                                                         let this_ptrPointer = UnsafeMutablePointer<LDKAcceptChannel>.allocate(capacity: 1)
190                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
191                                                 
192         return AcceptChannel_set_delayed_payment_basepoint(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
193     }
194
195     public func get_htlc_basepoint() -> [UInt8] {
196         
197         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKAcceptChannel>) in
198 AcceptChannel_get_htlc_basepoint(this_ptrPointer)
199 });
200     }
201
202     public func set_htlc_basepoint(val: [UInt8]) -> Void {
203         
204                                                         let this_ptrPointer = UnsafeMutablePointer<LDKAcceptChannel>.allocate(capacity: 1)
205                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
206                                                 
207         return AcceptChannel_set_htlc_basepoint(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
208     }
209
210     public func get_first_per_commitment_point() -> [UInt8] {
211         
212         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKAcceptChannel>) in
213 AcceptChannel_get_first_per_commitment_point(this_ptrPointer)
214 });
215     }
216
217     public func set_first_per_commitment_point(val: [UInt8]) -> Void {
218         
219                                                         let this_ptrPointer = UnsafeMutablePointer<LDKAcceptChannel>.allocate(capacity: 1)
220                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
221                                                 
222         return AcceptChannel_set_first_per_commitment_point(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
223     }
224
225     public func clone(orig: AcceptChannel) -> AcceptChannel {
226         
227         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKAcceptChannel>) in
228 AcceptChannel(pointer: AcceptChannel_clone(origPointer))
229 };
230     }
231
232     public func write(obj: AcceptChannel) -> [UInt8] {
233         
234         return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKAcceptChannel>) in
235 AcceptChannel_write(objPointer)
236 });
237     }
238
239     public func read(ser: [UInt8]) -> Result_AcceptChannelDecodeErrorZ {
240         
241         return Result_AcceptChannelDecodeErrorZ(pointer: AcceptChannel_read(Bindings.new_LDKu8slice(array: ser)));
242     }
243
244                                 
245         deinit {
246                                         if self.cOpaqueStruct?.is_owned == false {
247
248                                         
249                                         
250                 AcceptChannel_free(self.cOpaqueStruct!)
251                                         
252 }
253                                 
254         }
255                         
256     /* STRUCT_METHODS_END */
257
258 }