Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / FundingCreated.swift
1 import LDKCHeaders
2
3 public class FundingCreated {
4
5     public internal(set) var cOpaqueStruct: LDKFundingCreated?;
6
7         /* DEFAULT_CONSTRUCTOR_START */
8     public init(temporary_channel_id_arg: [UInt8], funding_txid_arg: [UInt8], funding_output_index_arg: UInt16, signature_arg: [UInt8]) {
9         
10         self.cOpaqueStruct = FundingCreated_new(Bindings.new_LDKThirtyTwoBytes(array: temporary_channel_id_arg), Bindings.new_LDKThirtyTwoBytes(array: funding_txid_arg), funding_output_index_arg, Bindings.new_LDKSignature(array: signature_arg))
11     }
12     /* DEFAULT_CONSTRUCTOR_END */
13
14     public init(pointer: LDKFundingCreated){
15                 self.cOpaqueStruct = pointer
16         }
17
18     /* STRUCT_METHODS_START */
19
20     public func get_temporary_channel_id() -> [UInt8] {
21         
22         return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKFundingCreated>) in
23 FundingCreated_get_temporary_channel_id(this_ptrPointer)
24 }.pointee);
25     }
26
27     public func set_temporary_channel_id(val: [UInt8]) -> Void {
28         
29                                                         let this_ptrPointer = UnsafeMutablePointer<LDKFundingCreated>.allocate(capacity: 1)
30                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
31                                                 
32         return FundingCreated_set_temporary_channel_id(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
33     }
34
35     public func get_funding_txid() -> [UInt8] {
36         
37         return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKFundingCreated>) in
38 FundingCreated_get_funding_txid(this_ptrPointer)
39 }.pointee);
40     }
41
42     public func set_funding_txid(val: [UInt8]) -> Void {
43         
44                                                         let this_ptrPointer = UnsafeMutablePointer<LDKFundingCreated>.allocate(capacity: 1)
45                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
46                                                 
47         return FundingCreated_set_funding_txid(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
48     }
49
50     public func get_funding_output_index() -> UInt16 {
51         
52         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKFundingCreated>) in
53 FundingCreated_get_funding_output_index(this_ptrPointer)
54 };
55     }
56
57     public func set_funding_output_index(val: UInt16) -> Void {
58         
59                                                         let this_ptrPointer = UnsafeMutablePointer<LDKFundingCreated>.allocate(capacity: 1)
60                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
61                                                 
62         return FundingCreated_set_funding_output_index(this_ptrPointer, val);
63     }
64
65     public func get_signature() -> [UInt8] {
66         
67         return Bindings.LDKSignature_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKFundingCreated>) in
68 FundingCreated_get_signature(this_ptrPointer)
69 });
70     }
71
72     public func set_signature(val: [UInt8]) -> Void {
73         
74                                                         let this_ptrPointer = UnsafeMutablePointer<LDKFundingCreated>.allocate(capacity: 1)
75                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
76                                                 
77         return FundingCreated_set_signature(this_ptrPointer, Bindings.new_LDKSignature(array: val));
78     }
79
80     public func clone(orig: FundingCreated) -> FundingCreated {
81         
82         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKFundingCreated>) in
83 FundingCreated(pointer: FundingCreated_clone(origPointer))
84 };
85     }
86
87     public func write(obj: FundingCreated) -> [UInt8] {
88         
89         return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKFundingCreated>) in
90 FundingCreated_write(objPointer)
91 });
92     }
93
94     public func read(ser: [UInt8]) -> Result_FundingCreatedDecodeErrorZ {
95         
96         return Result_FundingCreatedDecodeErrorZ(pointer: FundingCreated_read(Bindings.new_LDKu8slice(array: ser)));
97     }
98
99                                 
100         deinit {
101                                         if self.cOpaqueStruct?.is_owned == false {
102
103                                         
104                                         
105                 FundingCreated_free(self.cOpaqueStruct!)
106                                         
107 }
108                                 
109         }
110                         
111     /* STRUCT_METHODS_END */
112
113 }