Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / SignedRawInvoice.swift
1 import LDKCHeaders
2
3 public class SignedRawInvoice {
4
5     public internal(set) var cOpaqueStruct: LDKSignedRawInvoice?;
6
7         
8
9     public init(pointer: LDKSignedRawInvoice){
10                 self.cOpaqueStruct = pointer
11         }
12
13     /* STRUCT_METHODS_START */
14
15     public func eq(a: SignedRawInvoice, b: SignedRawInvoice) -> Bool {
16         
17         return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKSignedRawInvoice>) in
18 withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKSignedRawInvoice>) in
19 SignedRawInvoice_eq(aPointer, bPointer)
20 }
21 };
22     }
23
24     public func clone(orig: SignedRawInvoice) -> SignedRawInvoice {
25         
26         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKSignedRawInvoice>) in
27 SignedRawInvoice(pointer: SignedRawInvoice_clone(origPointer))
28 };
29     }
30
31     public func into_parts() -> C3Tuple_RawInvoice_u832InvoiceSignatureZ {
32         
33         return C3Tuple_RawInvoice_u832InvoiceSignatureZ(pointer: SignedRawInvoice_into_parts(self.cOpaqueStruct!));
34     }
35
36     public func raw_invoice() -> RawInvoice {
37         
38         return RawInvoice(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKSignedRawInvoice>) in
39 SignedRawInvoice_raw_invoice(this_argPointer)
40 });
41     }
42
43     public func hash() -> [UInt8] {
44         
45         return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKSignedRawInvoice>) in
46 SignedRawInvoice_hash(this_argPointer)
47 }.pointee);
48     }
49
50     public func signature() -> InvoiceSignature {
51         
52         return InvoiceSignature(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKSignedRawInvoice>) in
53 SignedRawInvoice_signature(this_argPointer)
54 });
55     }
56
57     public func recover_payee_pub_key() -> Result_PayeePubKeyErrorZ {
58         
59         return Result_PayeePubKeyErrorZ(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKSignedRawInvoice>) in
60 SignedRawInvoice_recover_payee_pub_key(this_argPointer)
61 });
62     }
63
64     public func check_signature() -> Bool {
65         
66         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKSignedRawInvoice>) in
67 SignedRawInvoice_check_signature(this_argPointer)
68 };
69     }
70
71     public func from_str(s: String) -> Result_SignedRawInvoiceNoneZ {
72         
73         return Result_SignedRawInvoiceNoneZ(pointer: SignedRawInvoice_from_str(Bindings.new_LDKStr(string: s)));
74     }
75
76     public func to_str(o: SignedRawInvoice) -> String {
77         
78         return Bindings.LDKStr_to_string(nativeType: withUnsafePointer(to: o.cOpaqueStruct!) { (oPointer: UnsafePointer<LDKSignedRawInvoice>) in
79 SignedRawInvoice_to_str(oPointer)
80 });
81     }
82
83                                 
84         deinit {
85                                         if self.cOpaqueStruct?.is_owned == false {
86
87                                         
88                                         
89                 SignedRawInvoice_free(self.cOpaqueStruct!)
90                                         
91 }
92                                 
93         }
94                         
95     /* STRUCT_METHODS_END */
96
97 }