Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / traits / ChannelMessageHandler.swift
1 import LDKCHeaders
2 import LDKCHeaders
3 open class ChannelMessageHandler {
4
5     public var cOpaqueStruct: LDKChannelMessageHandler?;
6
7     public init() {
8
9         /* NATIVE_CALLBACKS_START */
10
11                 func handle_open_channelCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, their_features: LDKInitFeatures, msgPointer: UnsafePointer<LDKOpenChannel>) -> Void {
12                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::handle_open_channel")
13                         let msg = OpenChannel(pointer: msgPointer.pointee);
14
15                         return instance.handle_open_channel(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), their_features: InitFeatures(pointer: their_features), msg: msg);
16                 }
17
18                 func handle_accept_channelCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, their_features: LDKInitFeatures, msgPointer: UnsafePointer<LDKAcceptChannel>) -> Void {
19                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::handle_accept_channel")
20                         let msg = AcceptChannel(pointer: msgPointer.pointee);
21
22                         return instance.handle_accept_channel(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), their_features: InitFeatures(pointer: their_features), msg: msg);
23                 }
24
25                 func handle_funding_createdCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, msgPointer: UnsafePointer<LDKFundingCreated>) -> Void {
26                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::handle_funding_created")
27                         let msg = FundingCreated(pointer: msgPointer.pointee);
28
29                         return instance.handle_funding_created(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), msg: msg);
30                 }
31
32                 func handle_funding_signedCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, msgPointer: UnsafePointer<LDKFundingSigned>) -> Void {
33                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::handle_funding_signed")
34                         let msg = FundingSigned(pointer: msgPointer.pointee);
35
36                         return instance.handle_funding_signed(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), msg: msg);
37                 }
38
39                 func handle_funding_lockedCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, msgPointer: UnsafePointer<LDKFundingLocked>) -> Void {
40                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::handle_funding_locked")
41                         let msg = FundingLocked(pointer: msgPointer.pointee);
42
43                         return instance.handle_funding_locked(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), msg: msg);
44                 }
45
46                 func handle_shutdownCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, their_featuresPointer: UnsafePointer<LDKInitFeatures>, msgPointer: UnsafePointer<LDKShutdown>) -> Void {
47                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::handle_shutdown")
48                         let their_features = InitFeatures(pointer: their_featuresPointer.pointee);
49 let msg = Shutdown(pointer: msgPointer.pointee);
50
51                         return instance.handle_shutdown(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), their_features: their_features, msg: msg);
52                 }
53
54                 func handle_closing_signedCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, msgPointer: UnsafePointer<LDKClosingSigned>) -> Void {
55                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::handle_closing_signed")
56                         let msg = ClosingSigned(pointer: msgPointer.pointee);
57
58                         return instance.handle_closing_signed(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), msg: msg);
59                 }
60
61                 func handle_update_add_htlcCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, msgPointer: UnsafePointer<LDKUpdateAddHTLC>) -> Void {
62                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::handle_update_add_htlc")
63                         let msg = UpdateAddHTLC(pointer: msgPointer.pointee);
64
65                         return instance.handle_update_add_htlc(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), msg: msg);
66                 }
67
68                 func handle_update_fulfill_htlcCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, msgPointer: UnsafePointer<LDKUpdateFulfillHTLC>) -> Void {
69                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::handle_update_fulfill_htlc")
70                         let msg = UpdateFulfillHTLC(pointer: msgPointer.pointee);
71
72                         return instance.handle_update_fulfill_htlc(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), msg: msg);
73                 }
74
75                 func handle_update_fail_htlcCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, msgPointer: UnsafePointer<LDKUpdateFailHTLC>) -> Void {
76                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::handle_update_fail_htlc")
77                         let msg = UpdateFailHTLC(pointer: msgPointer.pointee);
78
79                         return instance.handle_update_fail_htlc(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), msg: msg);
80                 }
81
82                 func handle_update_fail_malformed_htlcCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, msgPointer: UnsafePointer<LDKUpdateFailMalformedHTLC>) -> Void {
83                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::handle_update_fail_malformed_htlc")
84                         let msg = UpdateFailMalformedHTLC(pointer: msgPointer.pointee);
85
86                         return instance.handle_update_fail_malformed_htlc(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), msg: msg);
87                 }
88
89                 func handle_commitment_signedCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, msgPointer: UnsafePointer<LDKCommitmentSigned>) -> Void {
90                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::handle_commitment_signed")
91                         let msg = CommitmentSigned(pointer: msgPointer.pointee);
92
93                         return instance.handle_commitment_signed(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), msg: msg);
94                 }
95
96                 func handle_revoke_and_ackCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, msgPointer: UnsafePointer<LDKRevokeAndACK>) -> Void {
97                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::handle_revoke_and_ack")
98                         let msg = RevokeAndACK(pointer: msgPointer.pointee);
99
100                         return instance.handle_revoke_and_ack(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), msg: msg);
101                 }
102
103                 func handle_update_feeCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, msgPointer: UnsafePointer<LDKUpdateFee>) -> Void {
104                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::handle_update_fee")
105                         let msg = UpdateFee(pointer: msgPointer.pointee);
106
107                         return instance.handle_update_fee(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), msg: msg);
108                 }
109
110                 func handle_announcement_signaturesCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, msgPointer: UnsafePointer<LDKAnnouncementSignatures>) -> Void {
111                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::handle_announcement_signatures")
112                         let msg = AnnouncementSignatures(pointer: msgPointer.pointee);
113
114                         return instance.handle_announcement_signatures(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), msg: msg);
115                 }
116
117                 func peer_disconnectedCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, no_connection_possible: Bool) -> Void {
118                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::peer_disconnected")
119                         
120                         return instance.peer_disconnected(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), no_connection_possible: no_connection_possible);
121                 }
122
123                 func peer_connectedCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, msgPointer: UnsafePointer<LDKInit>) -> Void {
124                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::peer_connected")
125                         let msg = Init(pointer: msgPointer.pointee);
126
127                         return instance.peer_connected(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), msg: msg);
128                 }
129
130                 func handle_channel_reestablishCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, msgPointer: UnsafePointer<LDKChannelReestablish>) -> Void {
131                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::handle_channel_reestablish")
132                         let msg = ChannelReestablish(pointer: msgPointer.pointee);
133
134                         return instance.handle_channel_reestablish(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), msg: msg);
135                 }
136
137                 func handle_channel_updateCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, msgPointer: UnsafePointer<LDKChannelUpdate>) -> Void {
138                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::handle_channel_update")
139                         let msg = ChannelUpdate(pointer: msgPointer.pointee);
140
141                         return instance.handle_channel_update(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), msg: msg);
142                 }
143
144                 func handle_errorCallback(pointer: UnsafeRawPointer?, their_node_id: LDKPublicKey, msgPointer: UnsafePointer<LDKErrorMessage>) -> Void {
145                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::handle_error")
146                         let msg = ErrorMessage(pointer: msgPointer.pointee);
147
148                         return instance.handle_error(their_node_id: Bindings.tuple33_to_array(nativeType: their_node_id.compressed_form), msg: msg);
149                 }
150
151                 func freeCallback(pointer: UnsafeMutableRawPointer?) -> Void {
152                         let instance: ChannelMessageHandler = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "ChannelMessageHandler.swift::free")
153                         
154                         return instance.free();
155                 }
156
157                 /* NATIVE_CALLBACKS_END */
158
159         self.cOpaqueStruct = LDKChannelMessageHandler(this_arg: Bindings.instanceToPointer(instance: self), 
160                         handle_open_channel: handle_open_channelCallback,
161                         handle_accept_channel: handle_accept_channelCallback,
162                         handle_funding_created: handle_funding_createdCallback,
163                         handle_funding_signed: handle_funding_signedCallback,
164                         handle_funding_locked: handle_funding_lockedCallback,
165                         handle_shutdown: handle_shutdownCallback,
166                         handle_closing_signed: handle_closing_signedCallback,
167                         handle_update_add_htlc: handle_update_add_htlcCallback,
168                         handle_update_fulfill_htlc: handle_update_fulfill_htlcCallback,
169                         handle_update_fail_htlc: handle_update_fail_htlcCallback,
170                         handle_update_fail_malformed_htlc: handle_update_fail_malformed_htlcCallback,
171                         handle_commitment_signed: handle_commitment_signedCallback,
172                         handle_revoke_and_ack: handle_revoke_and_ackCallback,
173                         handle_update_fee: handle_update_feeCallback,
174                         handle_announcement_signatures: handle_announcement_signaturesCallback,
175                         peer_disconnected: peer_disconnectedCallback,
176                         peer_connected: peer_connectedCallback,
177                         handle_channel_reestablish: handle_channel_reestablishCallback,
178                         handle_channel_update: handle_channel_updateCallback,
179                         handle_error: handle_errorCallback,
180                         MessageSendEventsProvider: LDKMessageSendEventsProvider(),
181                         free: freeCallback)
182     }
183
184     public init(pointer: LDKChannelMessageHandler){
185                 self.cOpaqueStruct = pointer
186         }
187
188     /* SWIFT_CALLBACKS_START */
189
190     open func handle_open_channel(their_node_id: [UInt8], their_features: InitFeatures, msg: OpenChannel) -> Void {
191         /* EDIT ME */
192                 
193     }
194
195     open func handle_accept_channel(their_node_id: [UInt8], their_features: InitFeatures, msg: AcceptChannel) -> Void {
196         /* EDIT ME */
197                 
198     }
199
200     open func handle_funding_created(their_node_id: [UInt8], msg: FundingCreated) -> Void {
201         /* EDIT ME */
202                 
203     }
204
205     open func handle_funding_signed(their_node_id: [UInt8], msg: FundingSigned) -> Void {
206         /* EDIT ME */
207                 
208     }
209
210     open func handle_funding_locked(their_node_id: [UInt8], msg: FundingLocked) -> Void {
211         /* EDIT ME */
212                 
213     }
214
215     open func handle_shutdown(their_node_id: [UInt8], their_features: InitFeatures, msg: Shutdown) -> Void {
216         /* EDIT ME */
217                 
218     }
219
220     open func handle_closing_signed(their_node_id: [UInt8], msg: ClosingSigned) -> Void {
221         /* EDIT ME */
222                 
223     }
224
225     open func handle_update_add_htlc(their_node_id: [UInt8], msg: UpdateAddHTLC) -> Void {
226         /* EDIT ME */
227                 
228     }
229
230     open func handle_update_fulfill_htlc(their_node_id: [UInt8], msg: UpdateFulfillHTLC) -> Void {
231         /* EDIT ME */
232                 
233     }
234
235     open func handle_update_fail_htlc(their_node_id: [UInt8], msg: UpdateFailHTLC) -> Void {
236         /* EDIT ME */
237                 
238     }
239
240     open func handle_update_fail_malformed_htlc(their_node_id: [UInt8], msg: UpdateFailMalformedHTLC) -> Void {
241         /* EDIT ME */
242                 
243     }
244
245     open func handle_commitment_signed(their_node_id: [UInt8], msg: CommitmentSigned) -> Void {
246         /* EDIT ME */
247                 
248     }
249
250     open func handle_revoke_and_ack(their_node_id: [UInt8], msg: RevokeAndACK) -> Void {
251         /* EDIT ME */
252                 
253     }
254
255     open func handle_update_fee(their_node_id: [UInt8], msg: UpdateFee) -> Void {
256         /* EDIT ME */
257                 
258     }
259
260     open func handle_announcement_signatures(their_node_id: [UInt8], msg: AnnouncementSignatures) -> Void {
261         /* EDIT ME */
262                 
263     }
264
265     open func peer_disconnected(their_node_id: [UInt8], no_connection_possible: Bool) -> Void {
266         /* EDIT ME */
267                 
268     }
269
270     open func peer_connected(their_node_id: [UInt8], msg: Init) -> Void {
271         /* EDIT ME */
272                 
273     }
274
275     open func handle_channel_reestablish(their_node_id: [UInt8], msg: ChannelReestablish) -> Void {
276         /* EDIT ME */
277                 
278     }
279
280     open func handle_channel_update(their_node_id: [UInt8], msg: ChannelUpdate) -> Void {
281         /* EDIT ME */
282                 
283     }
284
285     open func handle_error(their_node_id: [UInt8], msg: ErrorMessage) -> Void {
286         /* EDIT ME */
287                 
288     }
289
290     open func free() -> Void {
291         /* EDIT ME */
292                 
293     }
294
295     /* SWIFT_CALLBACKS_END */
296
297 }
298
299
300 public class NativelyImplementedChannelMessageHandler: ChannelMessageHandler {
301         /* SWIFT_DEFAULT_CALLBACKS_START */
302
303         public override func handle_open_channel(their_node_id: [UInt8], their_features: InitFeatures, msg: OpenChannel) -> Void {
304                 
305                                 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKOpenChannel>) in
306
307                                 self.cOpaqueStruct!.handle_open_channel(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), their_features.cOpaqueStruct!, msgPointer)
308                                 
309 }
310                         
311         }
312
313         public override func handle_accept_channel(their_node_id: [UInt8], their_features: InitFeatures, msg: AcceptChannel) -> Void {
314                 
315                                 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKAcceptChannel>) in
316
317                                 self.cOpaqueStruct!.handle_accept_channel(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), their_features.cOpaqueStruct!, msgPointer)
318                                 
319 }
320                         
321         }
322
323         public override func handle_funding_created(their_node_id: [UInt8], msg: FundingCreated) -> Void {
324                 
325                                 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKFundingCreated>) in
326
327                                 self.cOpaqueStruct!.handle_funding_created(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), msgPointer)
328                                 
329 }
330                         
331         }
332
333         public override func handle_funding_signed(their_node_id: [UInt8], msg: FundingSigned) -> Void {
334                 
335                                 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKFundingSigned>) in
336
337                                 self.cOpaqueStruct!.handle_funding_signed(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), msgPointer)
338                                 
339 }
340                         
341         }
342
343         public override func handle_funding_locked(their_node_id: [UInt8], msg: FundingLocked) -> Void {
344                 
345                                 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKFundingLocked>) in
346
347                                 self.cOpaqueStruct!.handle_funding_locked(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), msgPointer)
348                                 
349 }
350                         
351         }
352
353         public override func handle_shutdown(their_node_id: [UInt8], their_features: InitFeatures, msg: Shutdown) -> Void {
354                 
355                                 withUnsafePointer(to: their_features.cOpaqueStruct!) { (their_featuresPointer: UnsafePointer<LDKInitFeatures>) in
356 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKShutdown>) in
357
358                                 self.cOpaqueStruct!.handle_shutdown(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), their_featuresPointer, msgPointer)
359                                 
360 }
361 }
362                         
363         }
364
365         public override func handle_closing_signed(their_node_id: [UInt8], msg: ClosingSigned) -> Void {
366                 
367                                 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKClosingSigned>) in
368
369                                 self.cOpaqueStruct!.handle_closing_signed(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), msgPointer)
370                                 
371 }
372                         
373         }
374
375         public override func handle_update_add_htlc(their_node_id: [UInt8], msg: UpdateAddHTLC) -> Void {
376                 
377                                 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKUpdateAddHTLC>) in
378
379                                 self.cOpaqueStruct!.handle_update_add_htlc(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), msgPointer)
380                                 
381 }
382                         
383         }
384
385         public override func handle_update_fulfill_htlc(their_node_id: [UInt8], msg: UpdateFulfillHTLC) -> Void {
386                 
387                                 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKUpdateFulfillHTLC>) in
388
389                                 self.cOpaqueStruct!.handle_update_fulfill_htlc(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), msgPointer)
390                                 
391 }
392                         
393         }
394
395         public override func handle_update_fail_htlc(their_node_id: [UInt8], msg: UpdateFailHTLC) -> Void {
396                 
397                                 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKUpdateFailHTLC>) in
398
399                                 self.cOpaqueStruct!.handle_update_fail_htlc(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), msgPointer)
400                                 
401 }
402                         
403         }
404
405         public override func handle_update_fail_malformed_htlc(their_node_id: [UInt8], msg: UpdateFailMalformedHTLC) -> Void {
406                 
407                                 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKUpdateFailMalformedHTLC>) in
408
409                                 self.cOpaqueStruct!.handle_update_fail_malformed_htlc(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), msgPointer)
410                                 
411 }
412                         
413         }
414
415         public override func handle_commitment_signed(their_node_id: [UInt8], msg: CommitmentSigned) -> Void {
416                 
417                                 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKCommitmentSigned>) in
418
419                                 self.cOpaqueStruct!.handle_commitment_signed(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), msgPointer)
420                                 
421 }
422                         
423         }
424
425         public override func handle_revoke_and_ack(their_node_id: [UInt8], msg: RevokeAndACK) -> Void {
426                 
427                                 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKRevokeAndACK>) in
428
429                                 self.cOpaqueStruct!.handle_revoke_and_ack(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), msgPointer)
430                                 
431 }
432                         
433         }
434
435         public override func handle_update_fee(their_node_id: [UInt8], msg: UpdateFee) -> Void {
436                 
437                                 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKUpdateFee>) in
438
439                                 self.cOpaqueStruct!.handle_update_fee(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), msgPointer)
440                                 
441 }
442                         
443         }
444
445         public override func handle_announcement_signatures(their_node_id: [UInt8], msg: AnnouncementSignatures) -> Void {
446                 
447                                 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKAnnouncementSignatures>) in
448
449                                 self.cOpaqueStruct!.handle_announcement_signatures(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), msgPointer)
450                                 
451 }
452                         
453         }
454
455         public override func peer_disconnected(their_node_id: [UInt8], no_connection_possible: Bool) -> Void {
456                 
457                                 
458                                 self.cOpaqueStruct!.peer_disconnected(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), no_connection_possible)
459                                 
460                         
461         }
462
463         public override func peer_connected(their_node_id: [UInt8], msg: Init) -> Void {
464                 
465                                 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKInit>) in
466
467                                 self.cOpaqueStruct!.peer_connected(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), msgPointer)
468                                 
469 }
470                         
471         }
472
473         public override func handle_channel_reestablish(their_node_id: [UInt8], msg: ChannelReestablish) -> Void {
474                 
475                                 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKChannelReestablish>) in
476
477                                 self.cOpaqueStruct!.handle_channel_reestablish(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), msgPointer)
478                                 
479 }
480                         
481         }
482
483         public override func handle_channel_update(their_node_id: [UInt8], msg: ChannelUpdate) -> Void {
484                 
485                                 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKChannelUpdate>) in
486
487                                 self.cOpaqueStruct!.handle_channel_update(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), msgPointer)
488                                 
489 }
490                         
491         }
492
493         public override func handle_error(their_node_id: [UInt8], msg: ErrorMessage) -> Void {
494                 
495                                 withUnsafePointer(to: msg.cOpaqueStruct!) { (msgPointer: UnsafePointer<LDKErrorMessage>) in
496
497                                 self.cOpaqueStruct!.handle_error(self.cOpaqueStruct!.this_arg, Bindings.new_LDKPublicKey(array: their_node_id), msgPointer)
498                                 
499 }
500                         
501         }
502
503         public override func free() -> Void {
504                 
505                                 
506                                 self.cOpaqueStruct!.free(self.cOpaqueStruct!.this_arg)
507                                 
508                         
509         }
510
511         /* SWIFT_DEFAULT_CALLBACKS_END */
512 }