Skip to content

Commit

Permalink
Merge pull request #38 from xmtp/np/sdk-updates
Browse files Browse the repository at this point in the history
Bump the bindings
  • Loading branch information
nplasterer authored Jun 24, 2024
2 parents e5c0e66 + 16bb63e commit e7df1b0
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 6 deletions.
4 changes: 2 additions & 2 deletions LibXMTP.podspec
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"]),
]
Expand Down
4 changes: 2 additions & 2 deletions Sources/LibXMTP/libxmtp-version.txt
Original file line number Diff line number Diff line change
@@ -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
46 changes: 46 additions & 0 deletions Sources/LibXMTP/xmtpv3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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(
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit e7df1b0

Please sign in to comment.