3 public class DataLossProtect {
5 public internal(set) var cOpaqueStruct: LDKDataLossProtect?;
7 /* DEFAULT_CONSTRUCTOR_START */
8 public init(your_last_per_commitment_secret_arg: [UInt8], my_current_per_commitment_point_arg: [UInt8]) {
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))
12 /* DEFAULT_CONSTRUCTOR_END */
14 public init(pointer: LDKDataLossProtect){
15 self.cOpaqueStruct = pointer
18 /* STRUCT_METHODS_START */
20 public func get_your_last_per_commitment_secret() -> [UInt8] {
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)
27 public func set_your_last_per_commitment_secret(val: [UInt8]) -> Void {
29 let this_ptrPointer = UnsafeMutablePointer<LDKDataLossProtect>.allocate(capacity: 1)
30 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
32 return DataLossProtect_set_your_last_per_commitment_secret(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
35 public func get_my_current_per_commitment_point() -> [UInt8] {
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)
42 public func set_my_current_per_commitment_point(val: [UInt8]) -> Void {
44 let this_ptrPointer = UnsafeMutablePointer<LDKDataLossProtect>.allocate(capacity: 1)
45 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
47 return DataLossProtect_set_my_current_per_commitment_point(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
50 public func clone(orig: DataLossProtect) -> DataLossProtect {
52 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKDataLossProtect>) in
53 DataLossProtect(pointer: DataLossProtect_clone(origPointer))
59 if self.cOpaqueStruct?.is_owned == false {
63 DataLossProtect_free(self.cOpaqueStruct!)
69 /* STRUCT_METHODS_END */