Skip to content

Commit

Permalink
Update Swift bindings to version 0.3.1-dev1
Browse files Browse the repository at this point in the history
  • Loading branch information
SDK release tagger committed Sep 11, 2024
1 parent bffb92a commit d1df57b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 48 deletions.
2 changes: 1 addition & 1 deletion BreezSDKLiquid.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "BreezSDKLiquid"
spec.version = "0.3.0"
spec.version = "0.3.1-dev1"
spec.license = { :type => "MIT" }
spec.summary = "Swift bindings to the Breez Liquid SDK"
spec.homepage = "https://breez.technology"
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let package = Package(
.library(name: "BreezSDKLiquid", targets: ["breez_sdk_liquidFFI", "BreezSDKLiquid"]),
],
targets: [
.binaryTarget(name: "breez_sdk_liquidFFI", url: "https://github.com/breez/breez-sdk-liquid-swift/releases/download/0.3.0/breez_sdk_liquidFFI.xcframework.zip", checksum: "a61357a8d1ca25c4740fc859fcd67fc56682da283945f820aa2c71c70dfa72fb"),
.binaryTarget(name: "breez_sdk_liquidFFI", url: "https://github.com/breez/breez-sdk-liquid-swift/releases/download/0.3.1-dev1/breez_sdk_liquidFFI.xcframework.zip", checksum: "839770b00935e86200aeb3b49b5380821a10e7a730e9a1bff63ec6b57098091f"),
.target(name: "BreezSDKLiquid", dependencies: ["breez_sdk_liquidFFI"]),
]
)
69 changes: 24 additions & 45 deletions Sources/BreezSDKLiquid/BreezSDKLiquid.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2943,21 +2943,21 @@ public struct Payment {
public var feesSat: UInt64
public var paymentType: PaymentType
public var status: PaymentState
public var details: PaymentDetails
public var destination: String?
public var txId: String?
public var details: PaymentDetails?

// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(timestamp: UInt32, amountSat: UInt64, feesSat: UInt64, paymentType: PaymentType, status: PaymentState, destination: String? = nil, txId: String? = nil, details: PaymentDetails? = nil) {
public init(timestamp: UInt32, amountSat: UInt64, feesSat: UInt64, paymentType: PaymentType, status: PaymentState, details: PaymentDetails, destination: String? = nil, txId: String? = nil) {
self.timestamp = timestamp
self.amountSat = amountSat
self.feesSat = feesSat
self.paymentType = paymentType
self.status = status
self.details = details
self.destination = destination
self.txId = txId
self.details = details
}
}

Expand All @@ -2979,13 +2979,13 @@ extension Payment: Equatable, Hashable {
if lhs.status != rhs.status {
return false
}
if lhs.destination != rhs.destination {
if lhs.details != rhs.details {
return false
}
if lhs.txId != rhs.txId {
if lhs.destination != rhs.destination {
return false
}
if lhs.details != rhs.details {
if lhs.txId != rhs.txId {
return false
}
return true
Expand All @@ -2997,9 +2997,9 @@ extension Payment: Equatable, Hashable {
hasher.combine(feesSat)
hasher.combine(paymentType)
hasher.combine(status)
hasher.combine(details)
hasher.combine(destination)
hasher.combine(txId)
hasher.combine(details)
}
}

Expand All @@ -3012,9 +3012,9 @@ public struct FfiConverterTypePayment: FfiConverterRustBuffer {
feesSat: FfiConverterUInt64.read(from: &buf),
paymentType: FfiConverterTypePaymentType.read(from: &buf),
status: FfiConverterTypePaymentState.read(from: &buf),
details: FfiConverterTypePaymentDetails.read(from: &buf),
destination: FfiConverterOptionString.read(from: &buf),
txId: FfiConverterOptionString.read(from: &buf),
details: FfiConverterOptionTypePaymentDetails.read(from: &buf)
txId: FfiConverterOptionString.read(from: &buf)
)
}

Expand All @@ -3024,9 +3024,9 @@ public struct FfiConverterTypePayment: FfiConverterRustBuffer {
FfiConverterUInt64.write(value.feesSat, into: &buf)
FfiConverterTypePaymentType.write(value.paymentType, into: &buf)
FfiConverterTypePaymentState.write(value.status, into: &buf)
FfiConverterTypePaymentDetails.write(value.details, into: &buf)
FfiConverterOptionString.write(value.destination, into: &buf)
FfiConverterOptionString.write(value.txId, into: &buf)
FfiConverterOptionTypePaymentDetails.write(value.details, into: &buf)
}
}

Expand Down Expand Up @@ -3277,47 +3277,47 @@ public func FfiConverterTypePreparePayOnchainResponse_lower(_ value: PreparePayO


public struct PrepareReceiveRequest {
public var payerAmountSat: UInt64?
public var paymentMethod: PaymentMethod
public var payerAmountSat: UInt64?

// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(payerAmountSat: UInt64?, paymentMethod: PaymentMethod) {
self.payerAmountSat = payerAmountSat
public init(paymentMethod: PaymentMethod, payerAmountSat: UInt64? = nil) {
self.paymentMethod = paymentMethod
self.payerAmountSat = payerAmountSat
}
}


extension PrepareReceiveRequest: Equatable, Hashable {
public static func ==(lhs: PrepareReceiveRequest, rhs: PrepareReceiveRequest) -> Bool {
if lhs.payerAmountSat != rhs.payerAmountSat {
if lhs.paymentMethod != rhs.paymentMethod {
return false
}
if lhs.paymentMethod != rhs.paymentMethod {
if lhs.payerAmountSat != rhs.payerAmountSat {
return false
}
return true
}

public func hash(into hasher: inout Hasher) {
hasher.combine(payerAmountSat)
hasher.combine(paymentMethod)
hasher.combine(payerAmountSat)
}
}


public struct FfiConverterTypePrepareReceiveRequest: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PrepareReceiveRequest {
return try PrepareReceiveRequest(
payerAmountSat: FfiConverterOptionUInt64.read(from: &buf),
paymentMethod: FfiConverterTypePaymentMethod.read(from: &buf)
paymentMethod: FfiConverterTypePaymentMethod.read(from: &buf),
payerAmountSat: FfiConverterOptionUInt64.read(from: &buf)
)
}

public static func write(_ value: PrepareReceiveRequest, into buf: inout [UInt8]) {
FfiConverterOptionUInt64.write(value.payerAmountSat, into: &buf)
FfiConverterTypePaymentMethod.write(value.paymentMethod, into: &buf)
FfiConverterOptionUInt64.write(value.payerAmountSat, into: &buf)
}
}

Expand Down Expand Up @@ -3526,7 +3526,7 @@ public struct PrepareSendRequest {

// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(destination: String, amountSat: UInt64?) {
public init(destination: String, amountSat: UInt64? = nil) {
self.destination = destination
self.amountSat = amountSat
}
Expand Down Expand Up @@ -4143,7 +4143,7 @@ public func FfiConverterTypeRouteHint_lower(_ value: RouteHint) -> RustBuffer {

public struct RouteHintHop {
public var srcNodeId: String
public var shortChannelId: UInt64
public var shortChannelId: String
public var feesBaseMsat: UInt32
public var feesProportionalMillionths: UInt32
public var cltvExpiryDelta: UInt64
Expand All @@ -4152,7 +4152,7 @@ public struct RouteHintHop {

// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(srcNodeId: String, shortChannelId: UInt64, feesBaseMsat: UInt32, feesProportionalMillionths: UInt32, cltvExpiryDelta: UInt64, htlcMinimumMsat: UInt64?, htlcMaximumMsat: UInt64?) {
public init(srcNodeId: String, shortChannelId: String, feesBaseMsat: UInt32, feesProportionalMillionths: UInt32, cltvExpiryDelta: UInt64, htlcMinimumMsat: UInt64?, htlcMaximumMsat: UInt64?) {
self.srcNodeId = srcNodeId
self.shortChannelId = shortChannelId
self.feesBaseMsat = feesBaseMsat
Expand Down Expand Up @@ -4206,7 +4206,7 @@ public struct FfiConverterTypeRouteHintHop: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RouteHintHop {
return try RouteHintHop(
srcNodeId: FfiConverterString.read(from: &buf),
shortChannelId: FfiConverterUInt64.read(from: &buf),
shortChannelId: FfiConverterString.read(from: &buf),
feesBaseMsat: FfiConverterUInt32.read(from: &buf),
feesProportionalMillionths: FfiConverterUInt32.read(from: &buf),
cltvExpiryDelta: FfiConverterUInt64.read(from: &buf),
Expand All @@ -4217,7 +4217,7 @@ public struct FfiConverterTypeRouteHintHop: FfiConverterRustBuffer {

public static func write(_ value: RouteHintHop, into buf: inout [UInt8]) {
FfiConverterString.write(value.srcNodeId, into: &buf)
FfiConverterUInt64.write(value.shortChannelId, into: &buf)
FfiConverterString.write(value.shortChannelId, into: &buf)
FfiConverterUInt32.write(value.feesBaseMsat, into: &buf)
FfiConverterUInt32.write(value.feesProportionalMillionths, into: &buf)
FfiConverterUInt64.write(value.cltvExpiryDelta, into: &buf)
Expand Down Expand Up @@ -6635,27 +6635,6 @@ fileprivate struct FfiConverterOptionTypeSymbol: FfiConverterRustBuffer {
}
}

fileprivate struct FfiConverterOptionTypePaymentDetails: FfiConverterRustBuffer {
typealias SwiftType = PaymentDetails?

public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
guard let value = value else {
writeInt(&buf, Int8(0))
return
}
writeInt(&buf, Int8(1))
FfiConverterTypePaymentDetails.write(value, into: &buf)
}

public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
switch try readInt(&buf) as Int8 {
case 0: return nil
case 1: return try FfiConverterTypePaymentDetails.read(from: &buf)
default: throw UniffiInternalError.unexpectedOptionalTag
}
}
}

fileprivate struct FfiConverterOptionTypeSuccessActionProcessed: FfiConverterRustBuffer {
typealias SwiftType = SuccessActionProcessed?

Expand Down
2 changes: 1 addition & 1 deletion breez_sdk_liquidFFI.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "breez_sdk_liquidFFI"
spec.version = "0.3.0"
spec.version = "0.3.1-dev1"
spec.license = { :type => "MIT" }
spec.summary = "Low-level bindings to the Breez Liquid SDK Rust API"
spec.homepage = "https://breez.technology"
Expand Down

0 comments on commit d1df57b

Please sign in to comment.