diff --git a/LibXMTP.podspec b/LibXMTP.podspec index e98b4fd..2573e0e 100644 --- a/LibXMTP.podspec +++ b/LibXMTP.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'LibXMTP' - s.version = '0.5.3-beta0' + s.version = '0.5.3-beta1' s.summary = 'XMTP shared Rust code that powers cross-platform SDKs' s.homepage = 'https://github.com/xmtp/libxmtp-swift' @@ -10,7 +10,7 @@ Pod::Spec.new do |s| s.platform = :ios, '14.0', :macos, '11.0' s.swift_version = '5.3' - s.source = { :http => "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-03b1a89/LibXMTPSwiftFFI.zip", :type => :zip } + s.source = { :http => "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-1e09690/LibXMTPSwiftFFI.zip", :type => :zip } s.vendored_frameworks = 'LibXMTPSwiftFFI.xcframework' s.source_files = 'Sources/LibXMTP/**/*' end diff --git a/Package.swift b/Package.swift index 338cb6f..0cd4f8e 100644 --- a/Package.swift +++ b/Package.swift @@ -27,8 +27,8 @@ let package = Package( ), .binaryTarget( name: "LibXMTPSwiftFFI", - url: "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-03b1a89/LibXMTPSwiftFFI.zip", - checksum: "9a5fa90da30fc461561b5ce8ef48af9eff2d9a5f109c3c21d34eb1d9233ec439" + url: "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-1e09690/LibXMTPSwiftFFI.zip", + checksum: "2552273b2c9f61b588f942b530a7e9707265d81c44b0482c40134ad2a2407fb8" ), .testTarget(name: "LibXMTPTests", dependencies: ["LibXMTP"]), ] diff --git a/Sources/LibXMTP/libxmtp-version.txt b/Sources/LibXMTP/libxmtp-version.txt index df2fb1f..e8e461b 100644 --- a/Sources/LibXMTP/libxmtp-version.txt +++ b/Sources/LibXMTP/libxmtp-version.txt @@ -1,3 +1,3 @@ -Version: 03b1a89e +Version: 1e096906 Branch: main -Date: 2024-06-21 23:35:06 +0000 +Date: 2024-06-24 17:58:00 +0000 diff --git a/Sources/LibXMTP/xmtpv3.swift b/Sources/LibXMTP/xmtpv3.swift index 0197b0c..fcdf6e4 100644 --- a/Sources/LibXMTP/xmtpv3.swift +++ b/Sources/LibXMTP/xmtpv3.swift @@ -1930,10 +1930,16 @@ public protocol FfiXmtpClientProtocol: AnyObject { func dbReconnect() async throws + func findInboxId(address: String) async throws -> String? + + func group(groupId: Data) throws -> FfiGroup + func inboxId() -> String func installationId() -> Data + func message(messageId: Data) throws -> FfiMessage + func registerIdentity(signatureRequest: FfiSignatureRequest) async throws func releaseDbConnection() throws @@ -2022,6 +2028,30 @@ open class FfiXmtpClient: ) } + open func findInboxId(address: String) async throws -> String? { + return + try await uniffiRustCallAsync( + rustFutureFunc: { + uniffi_xmtpv3_fn_method_ffixmtpclient_find_inbox_id( + self.uniffiClonePointer(), + FfiConverterString.lower(address) + ) + }, + pollFunc: ffi_xmtpv3_rust_future_poll_rust_buffer, + completeFunc: ffi_xmtpv3_rust_future_complete_rust_buffer, + freeFunc: ffi_xmtpv3_rust_future_free_rust_buffer, + liftFunc: FfiConverterOptionString.lift, + errorHandler: FfiConverterTypeGenericError.lift + ) + } + + open func group(groupId: Data) throws -> FfiGroup { + return try FfiConverterTypeFfiGroup.lift(rustCallWithError(FfiConverterTypeGenericError.lift) { + uniffi_xmtpv3_fn_method_ffixmtpclient_group(self.uniffiClonePointer(), + FfiConverterData.lower(groupId), $0) + }) + } + open func inboxId() -> String { return try! FfiConverterString.lift(try! rustCall { uniffi_xmtpv3_fn_method_ffixmtpclient_inbox_id(self.uniffiClonePointer(), $0) @@ -2034,6 +2064,13 @@ open class FfiXmtpClient: }) } + open func message(messageId: Data) throws -> FfiMessage { + return try FfiConverterTypeFfiMessage.lift(rustCallWithError(FfiConverterTypeGenericError.lift) { + uniffi_xmtpv3_fn_method_ffixmtpclient_message(self.uniffiClonePointer(), + FfiConverterData.lower(messageId), $0) + }) + } + open func registerIdentity(signatureRequest: FfiSignatureRequest) async throws { return try await uniffiRustCallAsync( @@ -4451,12 +4488,21 @@ private var initializationResult: InitializationResult { if uniffi_xmtpv3_checksum_method_ffixmtpclient_db_reconnect() != 6707 { return InitializationResult.apiChecksumMismatch } + if uniffi_xmtpv3_checksum_method_ffixmtpclient_find_inbox_id() != 59020 { + return InitializationResult.apiChecksumMismatch + } + if uniffi_xmtpv3_checksum_method_ffixmtpclient_group() != 64533 { + return InitializationResult.apiChecksumMismatch + } if uniffi_xmtpv3_checksum_method_ffixmtpclient_inbox_id() != 25128 { return InitializationResult.apiChecksumMismatch } if uniffi_xmtpv3_checksum_method_ffixmtpclient_installation_id() != 37173 { return InitializationResult.apiChecksumMismatch } + if uniffi_xmtpv3_checksum_method_ffixmtpclient_message() != 26932 { + return InitializationResult.apiChecksumMismatch + } if uniffi_xmtpv3_checksum_method_ffixmtpclient_register_identity() != 42003 { return InitializationResult.apiChecksumMismatch }