5 public internal(set) var cOpaqueStruct: LDKInvoice?;
9 public init(pointer: LDKInvoice){
10 self.cOpaqueStruct = pointer
13 /* STRUCT_METHODS_START */
15 public func eq(a: Invoice, b: Invoice) -> Bool {
17 return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKInvoice>) in
18 withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKInvoice>) in
19 Invoice_eq(aPointer, bPointer)
24 public func clone(orig: Invoice) -> Invoice {
26 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKInvoice>) in
27 Invoice(pointer: Invoice_clone(origPointer))
31 public func into_signed_raw() -> SignedRawInvoice {
33 return SignedRawInvoice(pointer: Invoice_into_signed_raw(self.cOpaqueStruct!));
36 public func check_signature() -> Result_NoneSemanticErrorZ {
38 return Result_NoneSemanticErrorZ(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInvoice>) in
39 Invoice_check_signature(this_argPointer)
43 public func from_signed(signed_invoice: SignedRawInvoice) -> Result_InvoiceSemanticErrorZ {
45 return Result_InvoiceSemanticErrorZ(pointer: Invoice_from_signed(signed_invoice.cOpaqueStruct!));
48 public func timestamp() -> UInt64 {
50 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInvoice>) in
51 Invoice_timestamp(this_argPointer)
55 public func payment_hash() -> [UInt8] {
57 return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInvoice>) in
58 Invoice_payment_hash(this_argPointer)
62 public func payee_pub_key() -> [UInt8] {
64 return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInvoice>) in
65 Invoice_payee_pub_key(this_argPointer)
69 public func payment_secret() -> [UInt8] {
71 return Bindings.LDKThirtyTwoBytes_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInvoice>) in
72 Invoice_payment_secret(this_argPointer)
76 public func features() -> InvoiceFeatures {
78 return InvoiceFeatures(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInvoice>) in
79 Invoice_features(this_argPointer)
83 public func recover_payee_pub_key() -> [UInt8] {
85 return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInvoice>) in
86 Invoice_recover_payee_pub_key(this_argPointer)
90 public func expiry_time() -> UInt64 {
92 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInvoice>) in
93 Invoice_expiry_time(this_argPointer)
97 public func min_final_cltv_expiry() -> UInt64 {
99 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInvoice>) in
100 Invoice_min_final_cltv_expiry(this_argPointer)
104 public func private_routes() -> [LDKPrivateRoute] {
106 return Bindings.LDKCVec_PrivateRouteZ_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInvoice>) in
107 Invoice_private_routes(this_argPointer)
111 public func route_hints() -> [LDKRouteHint] {
113 return Bindings.LDKCVec_RouteHintZ_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInvoice>) in
114 Invoice_route_hints(this_argPointer)
118 public func currency() -> LDKCurrency {
120 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInvoice>) in
121 Invoice_currency(this_argPointer)
125 public func amount_pico_btc() -> Option_u64Z {
127 return Option_u64Z(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInvoice>) in
128 Invoice_amount_pico_btc(this_argPointer)
132 public func from_str(s: String) -> Result_InvoiceNoneZ {
134 return Result_InvoiceNoneZ(pointer: Invoice_from_str(Bindings.new_LDKStr(string: s)));
137 public func to_str(o: Invoice) -> String {
139 return Bindings.LDKStr_to_string(nativeType: withUnsafePointer(to: o.cOpaqueStruct!) { (oPointer: UnsafePointer<LDKInvoice>) in
140 Invoice_to_str(oPointer)
146 if self.cOpaqueStruct?.is_owned == false {
150 Invoice_free(self.cOpaqueStruct!)
156 /* STRUCT_METHODS_END */