Skip to content

Commit

Permalink
This commit was created automatically by the lipa bot
Browse files Browse the repository at this point in the history
  • Loading branch information
lipa-github-bot committed Mar 28, 2023
1 parent ba76f0b commit b7e1daf
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 42 deletions.
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ let package = Package(
targets: [
.binaryTarget(
name: "lipalightninglibFFI",
url: "https://github.com/getlipa/lipa-lightning-lib-swift/releases/download/v0.1.0-alpha.15/lipalightninglibFFI.xcframework.zip",
checksum: "d34409ad3482768e3936d2a16c74588fceeb18ef6339fcb7b84cad8bc30f8744"),
url: "https://github.com/getlipa/lipa-lightning-lib-swift/releases/download/v0.1.0-alpha.16/lipalightninglibFFI.xcframework.zip",
checksum: "9c762daa0e40d6582490a56362aee842224508f557cf8c64f5633212cf097fff"),
.target(
name: "LipaLightningLib",
dependencies: ["lipalightninglibFFI"]),
Expand Down
80 changes: 40 additions & 40 deletions Sources/LipaLightningLib/LipaLightningLib.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ fileprivate extension RustBuffer {
}

static func from(_ ptr: UnsafeBufferPointer<UInt8>) -> RustBuffer {
try! rustCall { ffi_lipalightninglib_ea37_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
try! rustCall { ffi_lipalightninglib_4887_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
}

// Frees the buffer in place.
// The buffer must not be used after this is called.
func deallocate() {
try! rustCall { ffi_lipalightninglib_ea37_rustbuffer_free(self, $0) }
try! rustCall { ffi_lipalightninglib_4887_rustbuffer_free(self, $0) }
}
}

Expand Down Expand Up @@ -476,14 +476,14 @@ public class LightningNode: LightningNodeProtocol {

rustCallWithError(FfiConverterTypeLnError.self) {

lipalightninglib_ea37_LightningNode_new(
lipalightninglib_4887_LightningNode_new(
FfiConverterTypeConfig.lower(`config`),
FfiConverterCallbackInterfaceEventsCallback.lower(`eventsCallback`), $0)
})
}

deinit {
try! rustCall { ffi_lipalightninglib_ea37_LightningNode_object_free(pointer, $0) }
try! rustCall { ffi_lipalightninglib_4887_LightningNode_object_free(pointer, $0) }
}


Expand All @@ -494,7 +494,7 @@ public class LightningNode: LightningNodeProtocol {
try!
rustCall() {

lipalightninglib_ea37_LightningNode_get_node_info(self.pointer, $0
lipalightninglib_4887_LightningNode_get_node_info(self.pointer, $0
)
}
)
Expand All @@ -503,7 +503,7 @@ public class LightningNode: LightningNodeProtocol {
return try FfiConverterTypeLspFee.lift(
try
rustCallWithError(FfiConverterTypeLnError.self) {
lipalightninglib_ea37_LightningNode_query_lsp_fee(self.pointer, $0
lipalightninglib_4887_LightningNode_query_lsp_fee(self.pointer, $0
)
}
)
Expand All @@ -512,7 +512,7 @@ public class LightningNode: LightningNodeProtocol {
return try FfiConverterUInt64.lift(
try
rustCallWithError(FfiConverterTypeLnError.self) {
lipalightninglib_ea37_LightningNode_calculate_lsp_fee(self.pointer,
lipalightninglib_4887_LightningNode_calculate_lsp_fee(self.pointer,
FfiConverterUInt64.lower(`amountMsat`), $0
)
}
Expand All @@ -522,7 +522,7 @@ public class LightningNode: LightningNodeProtocol {
return try FfiConverterTypeInvoiceDetails.lift(
try
rustCallWithError(FfiConverterTypeLnError.self) {
lipalightninglib_ea37_LightningNode_create_invoice(self.pointer,
lipalightninglib_4887_LightningNode_create_invoice(self.pointer,
FfiConverterUInt64.lower(`amountMsat`),
FfiConverterString.lower(`description`),
FfiConverterString.lower(`metadata`), $0
Expand All @@ -534,7 +534,7 @@ public class LightningNode: LightningNodeProtocol {
return try FfiConverterTypeInvoiceDetails.lift(
try
rustCallWithError(FfiConverterTypeLnError.self) {
lipalightninglib_ea37_LightningNode_decode_invoice(self.pointer,
lipalightninglib_4887_LightningNode_decode_invoice(self.pointer,
FfiConverterString.lower(`invoice`), $0
)
}
Expand All @@ -543,7 +543,7 @@ public class LightningNode: LightningNodeProtocol {
public func `payInvoice`(`invoice`: String, `metadata`: String) throws {
try
rustCallWithError(FfiConverterTypeLnError.self) {
lipalightninglib_ea37_LightningNode_pay_invoice(self.pointer,
lipalightninglib_4887_LightningNode_pay_invoice(self.pointer,
FfiConverterString.lower(`invoice`),
FfiConverterString.lower(`metadata`), $0
)
Expand All @@ -553,7 +553,7 @@ public class LightningNode: LightningNodeProtocol {
return try FfiConverterSequenceTypePayment.lift(
try
rustCallWithError(FfiConverterTypeLnError.self) {
lipalightninglib_ea37_LightningNode_get_latest_payments(self.pointer,
lipalightninglib_4887_LightningNode_get_latest_payments(self.pointer,
FfiConverterUInt32.lower(`numberOfPayments`), $0
)
}
Expand All @@ -563,7 +563,7 @@ public class LightningNode: LightningNodeProtocol {
return try FfiConverterTypePayment.lift(
try
rustCallWithError(FfiConverterTypeLnError.self) {
lipalightninglib_ea37_LightningNode_get_payment(self.pointer,
lipalightninglib_4887_LightningNode_get_payment(self.pointer,
FfiConverterString.lower(`hash`), $0
)
}
Expand All @@ -573,23 +573,23 @@ public class LightningNode: LightningNodeProtocol {
try!
rustCall() {

lipalightninglib_ea37_LightningNode_foreground(self.pointer, $0
lipalightninglib_4887_LightningNode_foreground(self.pointer, $0
)
}
}
public func `background`() {
try!
rustCall() {

lipalightninglib_ea37_LightningNode_background(self.pointer, $0
lipalightninglib_4887_LightningNode_background(self.pointer, $0
)
}
}
public func `listCurrencyCodes`() throws -> [String] {
return try FfiConverterSequenceString.lift(
try
rustCallWithError(FfiConverterTypeLnError.self) {
lipalightninglib_ea37_LightningNode_list_currency_codes(self.pointer, $0
lipalightninglib_4887_LightningNode_list_currency_codes(self.pointer, $0
)
}
)
Expand All @@ -598,7 +598,7 @@ public class LightningNode: LightningNodeProtocol {
return try FfiConverterTypeExchangeRates.lift(
try
rustCallWithError(FfiConverterTypeLnError.self) {
lipalightninglib_ea37_LightningNode_get_exchange_rates(self.pointer, $0
lipalightninglib_4887_LightningNode_get_exchange_rates(self.pointer, $0
)
}
)
Expand All @@ -607,7 +607,7 @@ public class LightningNode: LightningNodeProtocol {
try!
rustCall() {

lipalightninglib_ea37_LightningNode_change_fiat_currency(self.pointer,
lipalightninglib_4887_LightningNode_change_fiat_currency(self.pointer,
FfiConverterString.lower(`fiatCurrency`), $0
)
}
Expand All @@ -616,7 +616,7 @@ public class LightningNode: LightningNodeProtocol {
try!
rustCall() {

lipalightninglib_ea37_LightningNode_change_timezone_config(self.pointer,
lipalightninglib_4887_LightningNode_change_timezone_config(self.pointer,
FfiConverterTypeTzConfig.lower(`timezoneConfig`), $0
)
}
Expand Down Expand Up @@ -1788,13 +1788,13 @@ public enum RuntimeErrorCode {
case `remoteStorageError`
case `rgsServiceUnavailable`
case `rgsUpdateError`
case `objectNotFound`
case `nonExistingWallet`
case `alreadyUsedInvoice`
case `payingToSelf`
case `noRouteFound`
case `sendFailure`
case `genericError`
case `objectNotFound`
}

public struct FfiConverterTypeRuntimeErrorCode: FfiConverterRustBuffer {
Expand All @@ -1818,19 +1818,19 @@ public struct FfiConverterTypeRuntimeErrorCode: FfiConverterRustBuffer {

case 7: return .`rgsUpdateError`

case 8: return .`objectNotFound`
case 8: return .`nonExistingWallet`

case 9: return .`nonExistingWallet`
case 9: return .`alreadyUsedInvoice`

case 10: return .`alreadyUsedInvoice`
case 10: return .`payingToSelf`

case 11: return .`payingToSelf`
case 11: return .`noRouteFound`

case 12: return .`noRouteFound`
case 12: return .`sendFailure`

case 13: return .`sendFailure`
case 13: return .`genericError`

case 14: return .`genericError`
case 14: return .`objectNotFound`

default: throw UniffiInternalError.unexpectedEnumCase
}
Expand Down Expand Up @@ -1868,31 +1868,31 @@ public struct FfiConverterTypeRuntimeErrorCode: FfiConverterRustBuffer {
writeInt(&buf, Int32(7))


case .`objectNotFound`:
case .`nonExistingWallet`:
writeInt(&buf, Int32(8))


case .`nonExistingWallet`:
case .`alreadyUsedInvoice`:
writeInt(&buf, Int32(9))


case .`alreadyUsedInvoice`:
case .`payingToSelf`:
writeInt(&buf, Int32(10))


case .`payingToSelf`:
case .`noRouteFound`:
writeInt(&buf, Int32(11))


case .`noRouteFound`:
case .`sendFailure`:
writeInt(&buf, Int32(12))


case .`sendFailure`:
case .`genericError`:
writeInt(&buf, Int32(13))


case .`genericError`:
case .`objectNotFound`:
writeInt(&buf, Int32(14))

}
Expand Down Expand Up @@ -2177,7 +2177,7 @@ fileprivate struct FfiConverterCallbackInterfaceEventsCallback {
private static var callbackInitialized = false
private static func initCallback() {
try! rustCall { (err: UnsafeMutablePointer<RustCallStatus>) in
ffi_lipalightninglib_ea37_EventsCallback_init_callback(foreignCallbackCallbackInterfaceEventsCallback, err)
ffi_lipalightninglib_4887_EventsCallback_init_callback(foreignCallbackCallbackInterfaceEventsCallback, err)
}
}
private static func ensureCallbackinitialized() {
Expand Down Expand Up @@ -2358,7 +2358,7 @@ public func `initNativeLoggerOnce`(`minLevel`: LogLevel) {

rustCall() {

lipalightninglib_ea37_init_native_logger_once(
lipalightninglib_4887_init_native_logger_once(
FfiConverterTypeLogLevel.lower(`minLevel`), $0)
}
}
Expand All @@ -2370,7 +2370,7 @@ public func `generateSecret`(`passphrase`: String) throws -> Secret {

rustCallWithError(FfiConverterTypeLnError.self) {

lipalightninglib_ea37_generate_secret(
lipalightninglib_4887_generate_secret(
FfiConverterString.lower(`passphrase`), $0)
}
)
Expand All @@ -2384,7 +2384,7 @@ public func `mnemonicToSecret`(`mnemonicString`: [String], `passphrase`: String)

rustCallWithError(FfiConverterTypeLnError.self) {

lipalightninglib_ea37_mnemonic_to_secret(
lipalightninglib_4887_mnemonic_to_secret(
FfiConverterSequenceString.lower(`mnemonicString`),
FfiConverterString.lower(`passphrase`), $0)
}
Expand All @@ -2399,7 +2399,7 @@ public func `wordsByPrefix`(`prefix`: String) -> [String] {

rustCall() {

lipalightninglib_ea37_words_by_prefix(
lipalightninglib_4887_words_by_prefix(
FfiConverterString.lower(`prefix`), $0)
}
)
Expand All @@ -2412,7 +2412,7 @@ public func `acceptTermsAndConditions`(`seed`: [UInt8], `graphqlUrl`: String) th

rustCallWithError(FfiConverterTypeLnError.self) {

lipalightninglib_ea37_accept_terms_and_conditions(
lipalightninglib_4887_accept_terms_and_conditions(
FfiConverterSequenceUInt8.lower(`seed`),
FfiConverterString.lower(`graphqlUrl`), $0)
}
Expand All @@ -2424,7 +2424,7 @@ public func `recoverLightningNode`(`seed`: [UInt8], `localPersistencePath`: Stri

rustCallWithError(FfiConverterTypeLnError.self) {

lipalightninglib_ea37_recover_lightning_node(
lipalightninglib_4887_recover_lightning_node(
FfiConverterSequenceUInt8.lower(`seed`),
FfiConverterString.lower(`localPersistencePath`),
FfiConverterString.lower(`graphqlUrl`),
Expand Down

0 comments on commit b7e1daf

Please sign in to comment.