Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / ChannelPublicKeys.swift
1 import LDKCHeaders
2
3 public class ChannelPublicKeys {
4
5     public internal(set) var cOpaqueStruct: LDKChannelPublicKeys?;
6
7         /* DEFAULT_CONSTRUCTOR_START */
8     public init(funding_pubkey_arg: [UInt8], revocation_basepoint_arg: [UInt8], payment_point_arg: [UInt8], delayed_payment_basepoint_arg: [UInt8], htlc_basepoint_arg: [UInt8]) {
9         
10         self.cOpaqueStruct = ChannelPublicKeys_new(Bindings.new_LDKPublicKey(array: funding_pubkey_arg), Bindings.new_LDKPublicKey(array: revocation_basepoint_arg), Bindings.new_LDKPublicKey(array: payment_point_arg), Bindings.new_LDKPublicKey(array: delayed_payment_basepoint_arg), Bindings.new_LDKPublicKey(array: htlc_basepoint_arg))
11     }
12     /* DEFAULT_CONSTRUCTOR_END */
13
14     public init(pointer: LDKChannelPublicKeys){
15                 self.cOpaqueStruct = pointer
16         }
17
18     /* STRUCT_METHODS_START */
19
20     public func get_funding_pubkey() -> [UInt8] {
21         
22         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelPublicKeys>) in
23 ChannelPublicKeys_get_funding_pubkey(this_ptrPointer)
24 });
25     }
26
27     public func set_funding_pubkey(val: [UInt8]) -> Void {
28         
29                                                         let this_ptrPointer = UnsafeMutablePointer<LDKChannelPublicKeys>.allocate(capacity: 1)
30                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
31                                                 
32         return ChannelPublicKeys_set_funding_pubkey(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
33     }
34
35     public func get_revocation_basepoint() -> [UInt8] {
36         
37         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelPublicKeys>) in
38 ChannelPublicKeys_get_revocation_basepoint(this_ptrPointer)
39 });
40     }
41
42     public func set_revocation_basepoint(val: [UInt8]) -> Void {
43         
44                                                         let this_ptrPointer = UnsafeMutablePointer<LDKChannelPublicKeys>.allocate(capacity: 1)
45                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
46                                                 
47         return ChannelPublicKeys_set_revocation_basepoint(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
48     }
49
50     public func get_payment_point() -> [UInt8] {
51         
52         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelPublicKeys>) in
53 ChannelPublicKeys_get_payment_point(this_ptrPointer)
54 });
55     }
56
57     public func set_payment_point(val: [UInt8]) -> Void {
58         
59                                                         let this_ptrPointer = UnsafeMutablePointer<LDKChannelPublicKeys>.allocate(capacity: 1)
60                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
61                                                 
62         return ChannelPublicKeys_set_payment_point(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
63     }
64
65     public func get_delayed_payment_basepoint() -> [UInt8] {
66         
67         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelPublicKeys>) in
68 ChannelPublicKeys_get_delayed_payment_basepoint(this_ptrPointer)
69 });
70     }
71
72     public func set_delayed_payment_basepoint(val: [UInt8]) -> Void {
73         
74                                                         let this_ptrPointer = UnsafeMutablePointer<LDKChannelPublicKeys>.allocate(capacity: 1)
75                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
76                                                 
77         return ChannelPublicKeys_set_delayed_payment_basepoint(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
78     }
79
80     public func get_htlc_basepoint() -> [UInt8] {
81         
82         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelPublicKeys>) in
83 ChannelPublicKeys_get_htlc_basepoint(this_ptrPointer)
84 });
85     }
86
87     public func set_htlc_basepoint(val: [UInt8]) -> Void {
88         
89                                                         let this_ptrPointer = UnsafeMutablePointer<LDKChannelPublicKeys>.allocate(capacity: 1)
90                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
91                                                 
92         return ChannelPublicKeys_set_htlc_basepoint(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
93     }
94
95     public func clone(orig: ChannelPublicKeys) -> ChannelPublicKeys {
96         
97         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKChannelPublicKeys>) in
98 ChannelPublicKeys(pointer: ChannelPublicKeys_clone(origPointer))
99 };
100     }
101
102     public func write(obj: ChannelPublicKeys) -> [UInt8] {
103         
104         return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKChannelPublicKeys>) in
105 ChannelPublicKeys_write(objPointer)
106 });
107     }
108
109     public func read(ser: [UInt8]) -> Result_ChannelPublicKeysDecodeErrorZ {
110         
111         return Result_ChannelPublicKeysDecodeErrorZ(pointer: ChannelPublicKeys_read(Bindings.new_LDKu8slice(array: ser)));
112     }
113
114                                 
115         deinit {
116                                         if self.cOpaqueStruct?.is_owned == false {
117
118                                         
119                                         
120                 ChannelPublicKeys_free(self.cOpaqueStruct!)
121                                         
122 }
123                                 
124         }
125                         
126     /* STRUCT_METHODS_END */
127
128 }