Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/xmtp/libxmtp-swift into np/…
Browse files Browse the repository at this point in the history
…smart-contract-wallets
  • Loading branch information
nplasterer committed Oct 2, 2024
2 parents c51b130 + 4b24023 commit 02dd0b1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 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.9-alpha1'
s.version = '0.5.9-alpha2'
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-72d0797/LibXMTPSwiftFFI.zip", :type => :zip }
s.source = { :http => "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-27030d6/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-72d0797/LibXMTPSwiftFFI.zip",
checksum: "0ea278749de6079a4d8b64246a9c49b93906aa7ebfe53e3960a7dde25a5c1ab2"
url: "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-27030d6/LibXMTPSwiftFFI.zip",
checksum: "d0d250e5e7b58ab85ade680bc6cef4ad20a29c16b9d7f332aa5d988323552c2b"
),
.testTarget(name: "LibXMTPTests", dependencies: ["LibXMTP"]),
]
Expand Down
6 changes: 3 additions & 3 deletions Sources/LibXMTP/libxmtp-version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 72d0797c
Branch: offsite/scw-libxmtp
Date: 2024-09-26 05:55:54 +0000
Version: bb7a38f7
Branch: main
Date: 2024-10-01 18:08:33 +0000
22 changes: 22 additions & 0 deletions Sources/LibXMTP/xmtpv3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,8 @@ private struct FfiConverterData: FfiConverterRustBuffer {
}

public protocol FfiConversationsProtocol: AnyObject {
func createDm(accountAddress: String) async throws -> FfiGroup

func createGroup(accountAddresses: [String], opts: FfiCreateGroupOptions) async throws -> FfiGroup

func list(opts: FfiListConversationsOptions) async throws -> [FfiGroup]
Expand Down Expand Up @@ -563,6 +565,23 @@ open class FfiConversations:
try! rustCall { uniffi_xmtpv3_fn_free_fficonversations(pointer, $0) }
}

open func createDm(accountAddress: String) async throws -> FfiGroup {
return
try await uniffiRustCallAsync(
rustFutureFunc: {
uniffi_xmtpv3_fn_method_fficonversations_create_dm(
self.uniffiClonePointer(),
FfiConverterString.lower(accountAddress)
)
},
pollFunc: ffi_xmtpv3_rust_future_poll_pointer,
completeFunc: ffi_xmtpv3_rust_future_complete_pointer,
freeFunc: ffi_xmtpv3_rust_future_free_pointer,
liftFunc: FfiConverterTypeFfiGroup.lift,
errorHandler: FfiConverterTypeGenericError.lift
)
}

open func createGroup(accountAddresses: [String], opts: FfiCreateGroupOptions) async throws -> FfiGroup {
return
try await uniffiRustCallAsync(
Expand Down Expand Up @@ -5505,6 +5524,9 @@ private var initializationResult: InitializationResult = {
if uniffi_xmtpv3_checksum_func_verify_k256_sha256() != 25521 {
return InitializationResult.apiChecksumMismatch
}
if uniffi_xmtpv3_checksum_method_fficonversations_create_dm() != 61687 {
return InitializationResult.apiChecksumMismatch
}
if uniffi_xmtpv3_checksum_method_fficonversations_create_group() != 62996 {
return InitializationResult.apiChecksumMismatch
}
Expand Down

0 comments on commit 02dd0b1

Please sign in to comment.