Skip to content

Commit 002be67

Browse files
committed
Update generated files to 118.
1 parent f0a2c32 commit 002be67

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3288
-1015
lines changed

out/Bindings.swift

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ public class Bindings {
400400
return returnValue
401401
}
402402

403-
/// Fetches the set of [`InitFeatures`] flags which are provided by or required by
403+
/// Fetches the set of [`InitFeatures`] flags that are provided by or required by
404404
/// [`ChannelManager`].
405405
public class func providedInitFeatures(config: UserConfig) -> InitFeatures {
406406
// native call variable prep
@@ -1433,12 +1433,14 @@ public class Bindings {
14331433
return returnValue
14341434
}
14351435

1436-
/// Create an onion message with contents `message` to the destination of `path`.
1437-
/// Returns (introduction_node_id, onion_msg)
1436+
/// Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
1437+
/// `path`.
1438+
///
1439+
/// Returns both the node id of the peer to send the message to and the message itself.
14381440
///
14391441
/// Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
14401442
public class func createOnionMessage(
1441-
entropySource: EntropySource, nodeSigner: NodeSigner, path: OnionMessagePath, message: OnionMessageContents,
1443+
entropySource: EntropySource, nodeSigner: NodeSigner, path: OnionMessagePath, contents: OnionMessageContents,
14421444
replyPath: BlindedPath
14431445
) -> Result_C2Tuple_PublicKeyOnionMessageZSendErrorZ {
14441446
// native call variable prep
@@ -1453,7 +1455,7 @@ public class Bindings {
14531455
(nodeSignerPointer: UnsafePointer<LDKNodeSigner>) in
14541456
create_onion_message(
14551457
entropySourcePointer, nodeSignerPointer, path.dynamicallyDangledClone().cType!,
1456-
message.danglingClone().cType!, replyPath.dynamicallyDangledClone().cType!)
1458+
contents.activate().cType!, replyPath.dynamicallyDangledClone().cType!)
14571459
}
14581460

14591461
}
@@ -1470,6 +1472,36 @@ public class Bindings {
14701472
return returnValue
14711473
}
14721474

1475+
/// Decode one layer of an incoming [`OnionMessage`].
1476+
///
1477+
/// Returns either the next layer of the onion for forwarding or the decrypted content for the
1478+
/// receiver.
1479+
public class func peelOnionMessage(
1480+
msg: OnionMessage, nodeSigner: NodeSigner, logger: Logger, customHandler: CustomOnionMessageHandler
1481+
) -> Result_PeeledOnionNoneZ {
1482+
// native call variable prep
1483+
1484+
1485+
// native method call
1486+
let nativeCallResult =
1487+
withUnsafePointer(to: msg.cType!) { (msgPointer: UnsafePointer<LDKOnionMessage>) in
1488+
peel_onion_message(
1489+
msgPointer, nodeSigner.activate().cType!, logger.activate().cType!, customHandler.activate().cType!)
1490+
}
1491+
1492+
1493+
// cleanup
1494+
1495+
1496+
// return value (do some wrapping)
1497+
let returnValue = Result_PeeledOnionNoneZ(
1498+
cType: nativeCallResult, instantiationContext: "Bindings.swift::\(#function):\(#line)")
1499+
1500+
1501+
try! returnValue.addAnchor(anchor: msg)
1502+
return returnValue
1503+
}
1504+
14731505
/// Pays the given [`Bolt11Invoice`], retrying if needed based on [`Retry`].
14741506
///
14751507
/// [`Bolt11Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long

out/VersionDescriptor.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
extension Bindings {
66
public class func getLDKSwiftBindingsSerializationHash() -> String {
7-
return "3306eaf9d996970e7040eebe5287b47dc30e5a5e64ae7cd1460768ad62f00a75"
7+
return "f648b3a8393e53cb007c6b2d58df2e242a376535e61e428e2994b1f5a137bda7"
88
}
99
public class func getLDKSwiftBindingsVersion() -> String {
10-
return "0.0.116-7-ga0e95f8d-dirty"
10+
return "0.0.116-24-gf0a2c328-dirty"
1111
}
1212
public class func getLDKSwiftBindingsCommitHash() -> String {
13-
return "a0e95f8d512595f491c48d3860397f7b52be7e4d"
13+
return "f0a2c3287f3f8c0061c11c373bbbded2e6cc1009"
1414
}
1515
}

out/enums/complex/BumpTransactionEvent.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ extension Bindings {
132132
///
133133
/// [`EcdsaChannelSigner`]: crate::sign::EcdsaChannelSigner
134134
/// [`EcdsaChannelSigner::sign_holder_htlc_transaction`]: crate::sign::EcdsaChannelSigner::sign_holder_htlc_transaction
135-
/// [`HTLCDescriptor::tx_input_witness`]: HTLCDescriptor::tx_input_witness
136135
case HTLCResolution
137136

138137
}

out/enums/complex/Event.swift

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

out/enums/complex/OffersMessage.swift

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -213,28 +213,6 @@ extension Bindings {
213213
return returnValue
214214
}
215215

216-
/// The TLV record type for the message as used in an `onionmsg_tlv` TLV stream.
217-
public func tlvType() -> UInt64 {
218-
// native call variable prep
219-
220-
221-
// native method call
222-
let nativeCallResult =
223-
withUnsafePointer(to: self.cType!) { (thisArgPointer: UnsafePointer<LDKOffersMessage>) in
224-
OffersMessage_tlv_type(thisArgPointer)
225-
}
226-
227-
228-
// cleanup
229-
230-
231-
// return value (do some wrapping)
232-
let returnValue = nativeCallResult
233-
234-
235-
return returnValue
236-
}
237-
238216
/// Serialize the OffersMessage object into a byte array which can be read by OffersMessage_read
239217
public func write() -> [UInt8] {
240218
// native call variable prep

0 commit comments

Comments
 (0)