Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / TrustedCommitmentTransaction.swift
1 import LDKCHeaders
2
3 public class TrustedCommitmentTransaction {
4
5     public internal(set) var cOpaqueStruct: LDKTrustedCommitmentTransaction?;
6
7         
8
9     public init(pointer: LDKTrustedCommitmentTransaction){
10                 self.cOpaqueStruct = pointer
11         }
12
13     /* STRUCT_METHODS_START */
14
15     public func txid() -> [UInt8] {
16         
17         return Bindings.LDKThirtyTwoBytes_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKTrustedCommitmentTransaction>) in
18 TrustedCommitmentTransaction_txid(this_argPointer)
19 });
20     }
21
22     public func built_transaction() -> BuiltCommitmentTransaction {
23         
24         return BuiltCommitmentTransaction(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKTrustedCommitmentTransaction>) in
25 TrustedCommitmentTransaction_built_transaction(this_argPointer)
26 });
27     }
28
29     public func keys() -> TxCreationKeys {
30         
31         return TxCreationKeys(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKTrustedCommitmentTransaction>) in
32 TrustedCommitmentTransaction_keys(this_argPointer)
33 });
34     }
35
36     public func get_htlc_sigs(htlc_base_key: [UInt8], channel_parameters: DirectedChannelTransactionParameters) -> Result_CVec_SignatureZNoneZ {
37         
38         return Result_CVec_SignatureZNoneZ(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKTrustedCommitmentTransaction>) in
39 withUnsafePointer(to: Bindings.array_to_tuple32(array: htlc_base_key)) { (htlc_base_keyPointer: UnsafePointer<(UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8)>) in
40 withUnsafePointer(to: channel_parameters.cOpaqueStruct!) { (channel_parametersPointer: UnsafePointer<LDKDirectedChannelTransactionParameters>) in
41 TrustedCommitmentTransaction_get_htlc_sigs(this_argPointer, htlc_base_keyPointer, channel_parametersPointer)
42 }
43 }
44 });
45     }
46
47                                 
48         deinit {
49                                         if self.cOpaqueStruct?.is_owned == false {
50
51                                         
52                                         
53                 TrustedCommitmentTransaction_free(self.cOpaqueStruct!)
54                                         
55 }
56                                 
57         }
58                         
59     /* STRUCT_METHODS_END */
60
61 }