Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / DataLossProtect.swift
1 import LDKCHeaders
2
3 public class DataLossProtect {
4
5     public internal(set) var cOpaqueStruct: LDKDataLossProtect?;
6
7         /* DEFAULT_CONSTRUCTOR_START */
8     public init(your_last_per_commitment_secret_arg: [UInt8], my_current_per_commitment_point_arg: [UInt8]) {
9         
10         self.cOpaqueStruct = DataLossProtect_new(Bindings.new_LDKThirtyTwoBytes(array: your_last_per_commitment_secret_arg), Bindings.new_LDKPublicKey(array: my_current_per_commitment_point_arg))
11     }
12     /* DEFAULT_CONSTRUCTOR_END */
13
14     public init(pointer: LDKDataLossProtect){
15                 self.cOpaqueStruct = pointer
16         }
17
18     /* STRUCT_METHODS_START */
19
20     public func get_your_last_per_commitment_secret() -> [UInt8] {
21         
22         return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKDataLossProtect>) in
23 DataLossProtect_get_your_last_per_commitment_secret(this_ptrPointer)
24 }.pointee);
25     }
26
27     public func set_your_last_per_commitment_secret(val: [UInt8]) -> Void {
28         
29                                                         let this_ptrPointer = UnsafeMutablePointer<LDKDataLossProtect>.allocate(capacity: 1)
30                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
31                                                 
32         return DataLossProtect_set_your_last_per_commitment_secret(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
33     }
34
35     public func get_my_current_per_commitment_point() -> [UInt8] {
36         
37         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKDataLossProtect>) in
38 DataLossProtect_get_my_current_per_commitment_point(this_ptrPointer)
39 });
40     }
41
42     public func set_my_current_per_commitment_point(val: [UInt8]) -> Void {
43         
44                                                         let this_ptrPointer = UnsafeMutablePointer<LDKDataLossProtect>.allocate(capacity: 1)
45                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
46                                                 
47         return DataLossProtect_set_my_current_per_commitment_point(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
48     }
49
50     public func clone(orig: DataLossProtect) -> DataLossProtect {
51         
52         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKDataLossProtect>) in
53 DataLossProtect(pointer: DataLossProtect_clone(origPointer))
54 };
55     }
56
57                                 
58         deinit {
59                                         if self.cOpaqueStruct?.is_owned == false {
60
61                                         
62                                         
63                 DataLossProtect_free(self.cOpaqueStruct!)
64                                         
65 }
66                                 
67         }
68                         
69     /* STRUCT_METHODS_END */
70
71 }