Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / UnsignedChannelAnnouncement.swift
1 import LDKCHeaders
2
3 public class UnsignedChannelAnnouncement {
4
5     public internal(set) var cOpaqueStruct: LDKUnsignedChannelAnnouncement?;
6
7         
8
9     public init(pointer: LDKUnsignedChannelAnnouncement){
10                 self.cOpaqueStruct = pointer
11         }
12
13     /* STRUCT_METHODS_START */
14
15     public func get_features() -> ChannelFeatures {
16         
17         return ChannelFeatures(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUnsignedChannelAnnouncement>) in
18 UnsignedChannelAnnouncement_get_features(this_ptrPointer)
19 });
20     }
21
22     public func set_features(val: ChannelFeatures) -> Void {
23         
24                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUnsignedChannelAnnouncement>.allocate(capacity: 1)
25                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
26                                                 
27         return UnsignedChannelAnnouncement_set_features(this_ptrPointer, val.cOpaqueStruct!);
28     }
29
30     public func get_chain_hash() -> [UInt8] {
31         
32         return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUnsignedChannelAnnouncement>) in
33 UnsignedChannelAnnouncement_get_chain_hash(this_ptrPointer)
34 }.pointee);
35     }
36
37     public func set_chain_hash(val: [UInt8]) -> Void {
38         
39                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUnsignedChannelAnnouncement>.allocate(capacity: 1)
40                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
41                                                 
42         return UnsignedChannelAnnouncement_set_chain_hash(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
43     }
44
45     public func get_short_channel_id() -> UInt64 {
46         
47         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUnsignedChannelAnnouncement>) in
48 UnsignedChannelAnnouncement_get_short_channel_id(this_ptrPointer)
49 };
50     }
51
52     public func set_short_channel_id(val: UInt64) -> Void {
53         
54                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUnsignedChannelAnnouncement>.allocate(capacity: 1)
55                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
56                                                 
57         return UnsignedChannelAnnouncement_set_short_channel_id(this_ptrPointer, val);
58     }
59
60     public func get_node_id_1() -> [UInt8] {
61         
62         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUnsignedChannelAnnouncement>) in
63 UnsignedChannelAnnouncement_get_node_id_1(this_ptrPointer)
64 });
65     }
66
67     public func set_node_id_1(val: [UInt8]) -> Void {
68         
69                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUnsignedChannelAnnouncement>.allocate(capacity: 1)
70                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
71                                                 
72         return UnsignedChannelAnnouncement_set_node_id_1(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
73     }
74
75     public func get_node_id_2() -> [UInt8] {
76         
77         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUnsignedChannelAnnouncement>) in
78 UnsignedChannelAnnouncement_get_node_id_2(this_ptrPointer)
79 });
80     }
81
82     public func set_node_id_2(val: [UInt8]) -> Void {
83         
84                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUnsignedChannelAnnouncement>.allocate(capacity: 1)
85                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
86                                                 
87         return UnsignedChannelAnnouncement_set_node_id_2(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
88     }
89
90     public func get_bitcoin_key_1() -> [UInt8] {
91         
92         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUnsignedChannelAnnouncement>) in
93 UnsignedChannelAnnouncement_get_bitcoin_key_1(this_ptrPointer)
94 });
95     }
96
97     public func set_bitcoin_key_1(val: [UInt8]) -> Void {
98         
99                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUnsignedChannelAnnouncement>.allocate(capacity: 1)
100                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
101                                                 
102         return UnsignedChannelAnnouncement_set_bitcoin_key_1(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
103     }
104
105     public func get_bitcoin_key_2() -> [UInt8] {
106         
107         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUnsignedChannelAnnouncement>) in
108 UnsignedChannelAnnouncement_get_bitcoin_key_2(this_ptrPointer)
109 });
110     }
111
112     public func set_bitcoin_key_2(val: [UInt8]) -> Void {
113         
114                                                         let this_ptrPointer = UnsafeMutablePointer<LDKUnsignedChannelAnnouncement>.allocate(capacity: 1)
115                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
116                                                 
117         return UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
118     }
119
120     public func clone(orig: UnsignedChannelAnnouncement) -> UnsignedChannelAnnouncement {
121         
122         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKUnsignedChannelAnnouncement>) in
123 UnsignedChannelAnnouncement(pointer: UnsignedChannelAnnouncement_clone(origPointer))
124 };
125     }
126
127     public func write(obj: UnsignedChannelAnnouncement) -> [UInt8] {
128         
129         return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKUnsignedChannelAnnouncement>) in
130 UnsignedChannelAnnouncement_write(objPointer)
131 });
132     }
133
134     public func read(ser: [UInt8]) -> Result_UnsignedChannelAnnouncementDecodeErrorZ {
135         
136         return Result_UnsignedChannelAnnouncementDecodeErrorZ(pointer: UnsignedChannelAnnouncement_read(Bindings.new_LDKu8slice(array: ser)));
137     }
138
139                                 
140         deinit {
141                                         if self.cOpaqueStruct?.is_owned == false {
142
143                                         
144                                         
145                 UnsignedChannelAnnouncement_free(self.cOpaqueStruct!)
146                                         
147 }
148                                 
149         }
150                         
151     /* STRUCT_METHODS_END */
152
153 }