3 public class OpenChannel {
5 public internal(set) var cOpaqueStruct: LDKOpenChannel?;
9 public init(pointer: LDKOpenChannel){
10 self.cOpaqueStruct = pointer
13 /* STRUCT_METHODS_START */
15 public func get_chain_hash() -> [UInt8] {
17 return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
18 OpenChannel_get_chain_hash(this_ptrPointer)
22 public func set_chain_hash(val: [UInt8]) -> Void {
24 let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
25 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
27 return OpenChannel_set_chain_hash(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
30 public func get_temporary_channel_id() -> [UInt8] {
32 return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
33 OpenChannel_get_temporary_channel_id(this_ptrPointer)
37 public func set_temporary_channel_id(val: [UInt8]) -> Void {
39 let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
40 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
42 return OpenChannel_set_temporary_channel_id(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
45 public func get_funding_satoshis() -> UInt64 {
47 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
48 OpenChannel_get_funding_satoshis(this_ptrPointer)
52 public func set_funding_satoshis(val: UInt64) -> Void {
54 let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
55 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
57 return OpenChannel_set_funding_satoshis(this_ptrPointer, val);
60 public func get_push_msat() -> UInt64 {
62 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
63 OpenChannel_get_push_msat(this_ptrPointer)
67 public func set_push_msat(val: UInt64) -> Void {
69 let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
70 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
72 return OpenChannel_set_push_msat(this_ptrPointer, val);
75 public func get_dust_limit_satoshis() -> UInt64 {
77 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
78 OpenChannel_get_dust_limit_satoshis(this_ptrPointer)
82 public func set_dust_limit_satoshis(val: UInt64) -> Void {
84 let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
85 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
87 return OpenChannel_set_dust_limit_satoshis(this_ptrPointer, val);
90 public func get_max_htlc_value_in_flight_msat() -> UInt64 {
92 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
93 OpenChannel_get_max_htlc_value_in_flight_msat(this_ptrPointer)
97 public func set_max_htlc_value_in_flight_msat(val: UInt64) -> Void {
99 let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
100 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
102 return OpenChannel_set_max_htlc_value_in_flight_msat(this_ptrPointer, val);
105 public func get_channel_reserve_satoshis() -> UInt64 {
107 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
108 OpenChannel_get_channel_reserve_satoshis(this_ptrPointer)
112 public func set_channel_reserve_satoshis(val: UInt64) -> Void {
114 let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
115 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
117 return OpenChannel_set_channel_reserve_satoshis(this_ptrPointer, val);
120 public func get_htlc_minimum_msat() -> UInt64 {
122 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
123 OpenChannel_get_htlc_minimum_msat(this_ptrPointer)
127 public func set_htlc_minimum_msat(val: UInt64) -> Void {
129 let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
130 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
132 return OpenChannel_set_htlc_minimum_msat(this_ptrPointer, val);
135 public func get_feerate_per_kw() -> UInt32 {
137 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
138 OpenChannel_get_feerate_per_kw(this_ptrPointer)
142 public func set_feerate_per_kw(val: UInt32) -> Void {
144 let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
145 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
147 return OpenChannel_set_feerate_per_kw(this_ptrPointer, val);
150 public func get_to_self_delay() -> UInt16 {
152 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
153 OpenChannel_get_to_self_delay(this_ptrPointer)
157 public func set_to_self_delay(val: UInt16) -> Void {
159 let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
160 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
162 return OpenChannel_set_to_self_delay(this_ptrPointer, val);
165 public func get_max_accepted_htlcs() -> UInt16 {
167 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
168 OpenChannel_get_max_accepted_htlcs(this_ptrPointer)
172 public func set_max_accepted_htlcs(val: UInt16) -> Void {
174 let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
175 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
177 return OpenChannel_set_max_accepted_htlcs(this_ptrPointer, val);
180 public func get_funding_pubkey() -> [UInt8] {
182 return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
183 OpenChannel_get_funding_pubkey(this_ptrPointer)
187 public func set_funding_pubkey(val: [UInt8]) -> Void {
189 let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
190 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
192 return OpenChannel_set_funding_pubkey(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
195 public func get_revocation_basepoint() -> [UInt8] {
197 return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
198 OpenChannel_get_revocation_basepoint(this_ptrPointer)
202 public func set_revocation_basepoint(val: [UInt8]) -> Void {
204 let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
205 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
207 return OpenChannel_set_revocation_basepoint(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
210 public func get_payment_point() -> [UInt8] {
212 return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
213 OpenChannel_get_payment_point(this_ptrPointer)
217 public func set_payment_point(val: [UInt8]) -> Void {
219 let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
220 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
222 return OpenChannel_set_payment_point(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
225 public func get_delayed_payment_basepoint() -> [UInt8] {
227 return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
228 OpenChannel_get_delayed_payment_basepoint(this_ptrPointer)
232 public func set_delayed_payment_basepoint(val: [UInt8]) -> Void {
234 let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
235 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
237 return OpenChannel_set_delayed_payment_basepoint(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
240 public func get_htlc_basepoint() -> [UInt8] {
242 return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
243 OpenChannel_get_htlc_basepoint(this_ptrPointer)
247 public func set_htlc_basepoint(val: [UInt8]) -> Void {
249 let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
250 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
252 return OpenChannel_set_htlc_basepoint(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
255 public func get_first_per_commitment_point() -> [UInt8] {
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)
262 public func set_first_per_commitment_point(val: [UInt8]) -> Void {
264 let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
265 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
267 return OpenChannel_set_first_per_commitment_point(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
270 public func get_channel_flags() -> UInt8 {
272 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKOpenChannel>) in
273 OpenChannel_get_channel_flags(this_ptrPointer)
277 public func set_channel_flags(val: UInt8) -> Void {
279 let this_ptrPointer = UnsafeMutablePointer<LDKOpenChannel>.allocate(capacity: 1)
280 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
282 return OpenChannel_set_channel_flags(this_ptrPointer, val);
285 public func clone(orig: OpenChannel) -> OpenChannel {
287 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKOpenChannel>) in
288 OpenChannel(pointer: OpenChannel_clone(origPointer))
292 public func write(obj: OpenChannel) -> [UInt8] {
294 return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKOpenChannel>) in
295 OpenChannel_write(objPointer)
299 public func read(ser: [UInt8]) -> Result_OpenChannelDecodeErrorZ {
301 return Result_OpenChannelDecodeErrorZ(pointer: OpenChannel_read(Bindings.new_LDKu8slice(array: ser)));
306 if self.cOpaqueStruct?.is_owned == false {
310 OpenChannel_free(self.cOpaqueStruct!)
316 /* STRUCT_METHODS_END */