Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / DelayedPaymentOutputDescriptor.swift
1 import LDKCHeaders
2
3 public class DelayedPaymentOutputDescriptor {
4
5     public internal(set) var cOpaqueStruct: LDKDelayedPaymentOutputDescriptor?;
6
7         /* DEFAULT_CONSTRUCTOR_START */
8     public init(outpoint_arg: OutPoint, per_commitment_point_arg: [UInt8], to_self_delay_arg: UInt16, output_arg: LDKTxOut, revocation_pubkey_arg: [UInt8], channel_keys_id_arg: [UInt8], channel_value_satoshis_arg: UInt64) {
9         
10         self.cOpaqueStruct = DelayedPaymentOutputDescriptor_new(outpoint_arg.cOpaqueStruct!, Bindings.new_LDKPublicKey(array: per_commitment_point_arg), to_self_delay_arg, output_arg, Bindings.new_LDKPublicKey(array: revocation_pubkey_arg), Bindings.new_LDKThirtyTwoBytes(array: channel_keys_id_arg), channel_value_satoshis_arg)
11     }
12     /* DEFAULT_CONSTRUCTOR_END */
13
14     public init(pointer: LDKDelayedPaymentOutputDescriptor){
15                 self.cOpaqueStruct = pointer
16         }
17
18     /* STRUCT_METHODS_START */
19
20     public func get_outpoint() -> OutPoint {
21         
22         return OutPoint(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKDelayedPaymentOutputDescriptor>) in
23 DelayedPaymentOutputDescriptor_get_outpoint(this_ptrPointer)
24 });
25     }
26
27     public func set_outpoint(val: OutPoint) -> Void {
28         
29                                                         let this_ptrPointer = UnsafeMutablePointer<LDKDelayedPaymentOutputDescriptor>.allocate(capacity: 1)
30                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
31                                                 
32         return DelayedPaymentOutputDescriptor_set_outpoint(this_ptrPointer, val.cOpaqueStruct!);
33     }
34
35     public func get_per_commitment_point() -> [UInt8] {
36         
37         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKDelayedPaymentOutputDescriptor>) in
38 DelayedPaymentOutputDescriptor_get_per_commitment_point(this_ptrPointer)
39 });
40     }
41
42     public func set_per_commitment_point(val: [UInt8]) -> Void {
43         
44                                                         let this_ptrPointer = UnsafeMutablePointer<LDKDelayedPaymentOutputDescriptor>.allocate(capacity: 1)
45                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
46                                                 
47         return DelayedPaymentOutputDescriptor_set_per_commitment_point(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
48     }
49
50     public func get_to_self_delay() -> UInt16 {
51         
52         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKDelayedPaymentOutputDescriptor>) in
53 DelayedPaymentOutputDescriptor_get_to_self_delay(this_ptrPointer)
54 };
55     }
56
57     public func set_to_self_delay(val: UInt16) -> Void {
58         
59                                                         let this_ptrPointer = UnsafeMutablePointer<LDKDelayedPaymentOutputDescriptor>.allocate(capacity: 1)
60                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
61                                                 
62         return DelayedPaymentOutputDescriptor_set_to_self_delay(this_ptrPointer, val);
63     }
64
65     public func set_output(val: LDKTxOut) -> Void {
66         
67                                                         let this_ptrPointer = UnsafeMutablePointer<LDKDelayedPaymentOutputDescriptor>.allocate(capacity: 1)
68                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
69                                                 
70         return DelayedPaymentOutputDescriptor_set_output(this_ptrPointer, val);
71     }
72
73     public func get_revocation_pubkey() -> [UInt8] {
74         
75         return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKDelayedPaymentOutputDescriptor>) in
76 DelayedPaymentOutputDescriptor_get_revocation_pubkey(this_ptrPointer)
77 });
78     }
79
80     public func set_revocation_pubkey(val: [UInt8]) -> Void {
81         
82                                                         let this_ptrPointer = UnsafeMutablePointer<LDKDelayedPaymentOutputDescriptor>.allocate(capacity: 1)
83                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
84                                                 
85         return DelayedPaymentOutputDescriptor_set_revocation_pubkey(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
86     }
87
88     public func get_channel_keys_id() -> [UInt8] {
89         
90         return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKDelayedPaymentOutputDescriptor>) in
91 DelayedPaymentOutputDescriptor_get_channel_keys_id(this_ptrPointer)
92 }.pointee);
93     }
94
95     public func set_channel_keys_id(val: [UInt8]) -> Void {
96         
97                                                         let this_ptrPointer = UnsafeMutablePointer<LDKDelayedPaymentOutputDescriptor>.allocate(capacity: 1)
98                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
99                                                 
100         return DelayedPaymentOutputDescriptor_set_channel_keys_id(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
101     }
102
103     public func get_channel_value_satoshis() -> UInt64 {
104         
105         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKDelayedPaymentOutputDescriptor>) in
106 DelayedPaymentOutputDescriptor_get_channel_value_satoshis(this_ptrPointer)
107 };
108     }
109
110     public func set_channel_value_satoshis(val: UInt64) -> Void {
111         
112                                                         let this_ptrPointer = UnsafeMutablePointer<LDKDelayedPaymentOutputDescriptor>.allocate(capacity: 1)
113                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
114                                                 
115         return DelayedPaymentOutputDescriptor_set_channel_value_satoshis(this_ptrPointer, val);
116     }
117
118     public func clone(orig: DelayedPaymentOutputDescriptor) -> DelayedPaymentOutputDescriptor {
119         
120         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKDelayedPaymentOutputDescriptor>) in
121 DelayedPaymentOutputDescriptor(pointer: DelayedPaymentOutputDescriptor_clone(origPointer))
122 };
123     }
124
125     public func write(obj: DelayedPaymentOutputDescriptor) -> [UInt8] {
126         
127         return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKDelayedPaymentOutputDescriptor>) in
128 DelayedPaymentOutputDescriptor_write(objPointer)
129 });
130     }
131
132     public func read(ser: [UInt8]) -> Result_DelayedPaymentOutputDescriptorDecodeErrorZ {
133         
134         return Result_DelayedPaymentOutputDescriptorDecodeErrorZ(pointer: DelayedPaymentOutputDescriptor_read(Bindings.new_LDKu8slice(array: ser)));
135     }
136
137                                 
138         deinit {
139                                         if self.cOpaqueStruct?.is_owned == false {
140
141                                         
142                                         
143                 DelayedPaymentOutputDescriptor_free(self.cOpaqueStruct!)
144                                         
145 }
146                                 
147         }
148                         
149     /* STRUCT_METHODS_END */
150
151 }