@@ -125,6 +125,16 @@ extension Bindings {
125125 /// [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
126126 case PaymentClaimed
127127
128+ /// Indicates a request for an invoice failed to yield a response in a reasonable amount of time
129+ /// or was explicitly abandoned by [`ChannelManager::abandon_payment`]. This may be for an
130+ /// [`InvoiceRequest`] sent for an [`Offer`] or for a [`Refund`] that hasn't been redeemed.
131+ ///
132+ /// [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
133+ /// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
134+ /// [`Offer`]: crate::offers::offer::Offer
135+ /// [`Refund`]: crate::offers::refund::Refund
136+ case InvoiceRequestFailed
137+
128138 /// Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
129139 /// and we got back the payment preimage for it).
130140 ///
@@ -285,6 +295,9 @@ extension Bindings {
285295 case LDKEvent_PaymentClaimed:
286296 return . PaymentClaimed
287297
298+ case LDKEvent_InvoiceRequestFailed:
299+ return . InvoiceRequestFailed
300+
288301 case LDKEvent_PaymentSent:
289302 return . PaymentSent
290303
@@ -530,6 +543,30 @@ extension Bindings {
530543 return returnValue
531544 }
532545
546+ /// Utility method to constructs a new InvoiceRequestFailed-variant Event
547+ public class func initWithInvoiceRequestFailed( paymentId: [ UInt8 ] ) -> Event {
548+ // native call variable prep
549+
550+ let paymentIdPrimitiveWrapper = ThirtyTwoBytes (
551+ value: paymentId, instantiationContext: " Event.swift:: \( #function) : \( #line) " )
552+
553+
554+ // native method call
555+ let nativeCallResult = Event_invoice_request_failed ( paymentIdPrimitiveWrapper. cType!)
556+
557+ // cleanup
558+
559+ // for elided types, we need this
560+ paymentIdPrimitiveWrapper. noOpRetain ( )
561+
562+
563+ // return value (do some wrapping)
564+ let returnValue = Event ( cType: nativeCallResult, instantiationContext: " Event.swift:: \( #function) : \( #line) " )
565+
566+
567+ return returnValue
568+ }
569+
533570 /// Utility method to constructs a new PaymentSent-variant Event
534571 public class func initWithPaymentSent(
535572 paymentId: [ UInt8 ] ? , paymentPreimage: [ UInt8 ] , paymentHash: [ UInt8 ] , feePaidMsat: UInt64 ?
@@ -1236,6 +1273,16 @@ extension Bindings {
12361273 anchor: self )
12371274 }
12381275
1276+ public func getValueAsInvoiceRequestFailed( ) -> InvoiceRequestFailed ? {
1277+ if self . cType? . tag != LDKEvent_InvoiceRequestFailed {
1278+ return nil
1279+ }
1280+
1281+ return Event_LDKInvoiceRequestFailed_Body (
1282+ cType: self . cType!. invoice_request_failed, instantiationContext: " Event.swift:: \( #function) : \( #line) " ,
1283+ anchor: self )
1284+ }
1285+
12391286 public func getValueAsPaymentSent( ) -> PaymentSent ? {
12401287 if self . cType? . tag != LDKEvent_PaymentSent {
12411288 return nil
@@ -1889,6 +1936,78 @@ extension Bindings {
18891936 }
18901937
18911938
1939+ ///
1940+ internal typealias Event_LDKInvoiceRequestFailed_Body = InvoiceRequestFailed
1941+
1942+
1943+ ///
1944+ public class InvoiceRequestFailed : NativeTypeWrapper {
1945+
1946+
1947+ /// Set to false to suppress an individual type's deinit log statements.
1948+ /// Only applicable when log threshold is set to `.Debug`.
1949+ public static var enableDeinitLogging = true
1950+
1951+ /// Set to true to suspend the freeing of this type's associated Rust memory.
1952+ /// Should only ever be used for debugging purposes, and will likely be
1953+ /// deprecated soon.
1954+ public static var suspendFreedom = false
1955+
1956+ private static var instanceCounter : UInt = 0
1957+ internal let instanceNumber : UInt
1958+
1959+ internal var cType : LDKEvent_LDKInvoiceRequestFailed_Body ?
1960+
1961+ internal init ( cType: LDKEvent_LDKInvoiceRequestFailed_Body , instantiationContext: String ) {
1962+ Self . instanceCounter += 1
1963+ self . instanceNumber = Self . instanceCounter
1964+ self . cType = cType
1965+
1966+ super. init ( conflictAvoidingVariableName: 0 , instantiationContext: instantiationContext)
1967+ }
1968+
1969+ internal init (
1970+ cType: LDKEvent_LDKInvoiceRequestFailed_Body , instantiationContext: String , anchor: NativeTypeWrapper
1971+ ) {
1972+ Self . instanceCounter += 1
1973+ self . instanceNumber = Self . instanceCounter
1974+ self . cType = cType
1975+
1976+ super. init ( conflictAvoidingVariableName: 0 , instantiationContext: instantiationContext)
1977+ self . dangling = true
1978+ try ! self . addAnchor ( anchor: anchor)
1979+ }
1980+
1981+ internal init (
1982+ cType: LDKEvent_LDKInvoiceRequestFailed_Body , instantiationContext: String , anchor: NativeTypeWrapper ,
1983+ dangle: Bool = false
1984+ ) {
1985+ Self . instanceCounter += 1
1986+ self . instanceNumber = Self . instanceCounter
1987+ self . cType = cType
1988+
1989+ super. init ( conflictAvoidingVariableName: 0 , instantiationContext: instantiationContext)
1990+ self . dangling = dangle
1991+ try ! self . addAnchor ( anchor: anchor)
1992+ }
1993+
1994+
1995+ /// The `payment_id` to have been associated with payment for the requested invoice.
1996+ public func getPaymentId( ) -> [ UInt8 ] {
1997+ // return value (do some wrapping)
1998+ let returnValue = ThirtyTwoBytes (
1999+ cType: self . cType!. payment_id, instantiationContext: " Event.swift:: \( #function) : \( #line) " ,
2000+ anchor: self
2001+ )
2002+ . getValue ( )
2003+
2004+ return returnValue
2005+ }
2006+
2007+
2008+ }
2009+
2010+
18922011 ///
18932012 internal typealias Event_LDKPaymentSent_Body = PaymentSent
18942013
0 commit comments