3 public class RawInvoice {
5 public internal(set) var cOpaqueStruct: LDKRawInvoice?;
9 public init(pointer: LDKRawInvoice){
10 self.cOpaqueStruct = pointer
13 /* STRUCT_METHODS_START */
15 public func get_data() -> RawDataPart {
17 return RawDataPart(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRawInvoice>) in
18 RawInvoice_get_data(this_ptrPointer)
22 public func set_data(val: RawDataPart) -> Void {
24 let this_ptrPointer = UnsafeMutablePointer<LDKRawInvoice>.allocate(capacity: 1)
25 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
27 return RawInvoice_set_data(this_ptrPointer, val.cOpaqueStruct!);
30 public func eq(a: RawInvoice, b: RawInvoice) -> Bool {
32 return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKRawInvoice>) in
33 withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKRawInvoice>) in
34 RawInvoice_eq(aPointer, bPointer)
39 public func clone(orig: RawInvoice) -> RawInvoice {
41 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKRawInvoice>) in
42 RawInvoice(pointer: RawInvoice_clone(origPointer))
46 public func hash() -> [UInt8] {
48 return Bindings.LDKThirtyTwoBytes_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKRawInvoice>) in
49 RawInvoice_hash(this_argPointer)
53 public func payment_hash() -> Sha256 {
55 return Sha256(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKRawInvoice>) in
56 RawInvoice_payment_hash(this_argPointer)
60 public func description() -> Description {
62 return Description(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKRawInvoice>) in
63 RawInvoice_description(this_argPointer)
67 public func payee_pub_key() -> PayeePubKey {
69 return PayeePubKey(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKRawInvoice>) in
70 RawInvoice_payee_pub_key(this_argPointer)
74 public func description_hash() -> Sha256 {
76 return Sha256(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKRawInvoice>) in
77 RawInvoice_description_hash(this_argPointer)
81 public func expiry_time() -> ExpiryTime {
83 return ExpiryTime(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKRawInvoice>) in
84 RawInvoice_expiry_time(this_argPointer)
88 public func min_final_cltv_expiry() -> MinFinalCltvExpiry {
90 return MinFinalCltvExpiry(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKRawInvoice>) in
91 RawInvoice_min_final_cltv_expiry(this_argPointer)
95 public func payment_secret() -> [UInt8] {
97 return Bindings.LDKThirtyTwoBytes_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKRawInvoice>) in
98 RawInvoice_payment_secret(this_argPointer)
102 public func features() -> InvoiceFeatures {
104 return InvoiceFeatures(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKRawInvoice>) in
105 RawInvoice_features(this_argPointer)
109 public func private_routes() -> [LDKPrivateRoute] {
111 return Bindings.LDKCVec_PrivateRouteZ_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKRawInvoice>) in
112 RawInvoice_private_routes(this_argPointer)
116 public func amount_pico_btc() -> Option_u64Z {
118 return Option_u64Z(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKRawInvoice>) in
119 RawInvoice_amount_pico_btc(this_argPointer)
123 public func currency() -> LDKCurrency {
125 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKRawInvoice>) in
126 RawInvoice_currency(this_argPointer)
132 if self.cOpaqueStruct?.is_owned == false {
136 RawInvoice_free(self.cOpaqueStruct!)
142 /* STRUCT_METHODS_END */