From 7df7cf3635c5d8c227b51e5a169b2b4234f13634 Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Fri, 20 Dec 2024 09:54:22 -0800 Subject: [PATCH] bump versions --- LibXMTP.podspec | 4 +-- Package.swift | 4 +-- Sources/LibXMTP/libxmtp-version.txt | 4 +-- Sources/LibXMTP/xmtpv3.swift | 48 ++++++++++++++++++++++------- 4 files changed, 43 insertions(+), 17 deletions(-) diff --git a/LibXMTP.podspec b/LibXMTP.podspec index 78f465c..cbc7163 100644 --- a/LibXMTP.podspec +++ b/LibXMTP.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'LibXMTP' - s.version = '3.0.14' + s.version = '3.0.15' 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-eccce06/LibXMTPSwiftFFI.zip", :type => :zip } + s.source = { :http => "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-33c06af/LibXMTPSwiftFFI.zip", :type => :zip } s.vendored_frameworks = 'LibXMTPSwiftFFI.xcframework' s.source_files = 'Sources/LibXMTP/**/*' end diff --git a/Package.swift b/Package.swift index 380c392..0328e91 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-eccce06/LibXMTPSwiftFFI.zip", - checksum: "50aa2f37ac40182d7c6ea1847a6a89c9eca72275552d932b11f022a2cd2882cd" + url: "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-33c06af/LibXMTPSwiftFFI.zip", + checksum: "d7e0667ebea3d5e68bf8d6a6d014219263697436ee1714e89fe9a7362f38925b" ), .testTarget(name: "LibXMTPTests", dependencies: ["LibXMTP"]), ] diff --git a/Sources/LibXMTP/libxmtp-version.txt b/Sources/LibXMTP/libxmtp-version.txt index 153a32f..3de9cf4 100644 --- a/Sources/LibXMTP/libxmtp-version.txt +++ b/Sources/LibXMTP/libxmtp-version.txt @@ -1,3 +1,3 @@ -Version: eccce061 +Version: 33c06af6 Branch: main -Date: 2024-12-18 17:39:46 +0000 +Date: 2024-12-20 17:34:43 +0000 diff --git a/Sources/LibXMTP/xmtpv3.swift b/Sources/LibXMTP/xmtpv3.swift index 284d230..3d0a345 100644 --- a/Sources/LibXMTP/xmtpv3.swift +++ b/Sources/LibXMTP/xmtpv3.swift @@ -1701,6 +1701,8 @@ public protocol FfiConversationsProtocol: AnyObject { func createGroup(accountAddresses: [String], opts: FfiCreateGroupOptions) async throws -> FfiConversation + func getHmacKeys() throws -> [Data: [FfiHmacKey]] + func getSyncGroup() throws -> FfiConversation func list(opts: FfiListConversationsOptions) async throws -> [FfiConversation] @@ -1825,6 +1827,12 @@ open class FfiConversations: ) } + open func getHmacKeys() throws -> [Data: [FfiHmacKey]] { + return try FfiConverterDictionaryDataSequenceTypeFfiHmacKey.lift(rustCallWithError(FfiConverterTypeGenericError.lift) { + uniffi_xmtpv3_fn_method_fficonversations_get_hmac_keys(self.uniffiClonePointer(), $0) + }) + } + open func getSyncGroup() throws -> FfiConversation { return try FfiConverterTypeFfiConversation.lift(rustCallWithError(FfiConverterTypeGenericError.lift) { uniffi_xmtpv3_fn_method_fficonversations_get_sync_group(self.uniffiClonePointer(), $0) @@ -3554,8 +3562,6 @@ public protocol FfiXmtpClientProtocol: AnyObject { func getConsentState(entityType: FfiConsentEntityType, entity: String) async throws -> FfiConsentState - func getHmacKeys() throws -> [FfiHmacKey] - func getLatestInboxState(inboxId: String) async throws -> FfiInboxState func inboxId() -> String @@ -3795,12 +3801,6 @@ open class FfiXmtpClient: ) } - open func getHmacKeys() throws -> [FfiHmacKey] { - return try FfiConverterSequenceTypeFfiHmacKey.lift(rustCallWithError(FfiConverterTypeGenericError.lift) { - uniffi_xmtpv3_fn_method_ffixmtpclient_get_hmac_keys(self.uniffiClonePointer(), $0) - }) - } - open func getLatestInboxState(inboxId: String) async throws -> FfiInboxState { return try await uniffiRustCallAsync( @@ -7358,6 +7358,32 @@ private struct FfiConverterDictionaryStringBool: FfiConverterRustBuffer { } } +#if swift(>=5.8) + @_documentation(visibility: private) +#endif +private struct FfiConverterDictionaryDataSequenceTypeFfiHmacKey: FfiConverterRustBuffer { + public static func write(_ value: [Data: [FfiHmacKey]], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for (key, value) in value { + FfiConverterData.write(key, into: &buf) + FfiConverterSequenceTypeFfiHmacKey.write(value, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [Data: [FfiHmacKey]] { + let len: Int32 = try readInt(&buf) + var dict = [Data: [FfiHmacKey]]() + dict.reserveCapacity(Int(len)) + for _ in 0 ..< len { + let key = try FfiConverterData.read(from: &buf) + let value = try FfiConverterSequenceTypeFfiHmacKey.read(from: &buf) + dict[key] = value + } + return dict + } +} + private let UNIFFI_RUST_FUTURE_POLL_READY: Int8 = 0 private let UNIFFI_RUST_FUTURE_POLL_MAYBE_READY: Int8 = 1 @@ -7805,6 +7831,9 @@ private var initializationResult: InitializationResult = { if uniffi_xmtpv3_checksum_method_fficonversations_create_group() != 7282 { return InitializationResult.apiChecksumMismatch } + if uniffi_xmtpv3_checksum_method_fficonversations_get_hmac_keys() != 44064 { + return InitializationResult.apiChecksumMismatch + } if uniffi_xmtpv3_checksum_method_fficonversations_get_sync_group() != 42973 { return InitializationResult.apiChecksumMismatch } @@ -7958,9 +7987,6 @@ private var initializationResult: InitializationResult = { if uniffi_xmtpv3_checksum_method_ffixmtpclient_get_consent_state() != 58208 { return InitializationResult.apiChecksumMismatch } - if uniffi_xmtpv3_checksum_method_ffixmtpclient_get_hmac_keys() != 36015 { - return InitializationResult.apiChecksumMismatch - } if uniffi_xmtpv3_checksum_method_ffixmtpclient_get_latest_inbox_state() != 3165 { return InitializationResult.apiChecksumMismatch }