Skip to content

Commit

Permalink
update to a working bindings version
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Jun 21, 2024
1 parent 864ef28 commit d0c1007
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion LibXMTP.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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-84ee848/LibXMTPSwiftFFI.zip", :type => :zip }
s.source = { :http => "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-03b1a89/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-84ee848/LibXMTPSwiftFFI.zip",
checksum: "b2d050f25e7585a716fb40bc2859f6fdc19cd70b926a114ddffd9b2570bf597f"
url: "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-03b1a89/LibXMTPSwiftFFI.zip",
checksum: "9a5fa90da30fc461561b5ce8ef48af9eff2d9a5f109c3c21d34eb1d9233ec439"
),
.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: 43e21e0d
Version: 03b1a89e
Branch: main
Date: 2024-06-20 20:35:11 +0000
Date: 2024-06-21 23:35:06 +0000
27 changes: 24 additions & 3 deletions Sources/LibXMTP/xmtpv3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1938,6 +1938,8 @@ public protocol FfiXmtpClientProtocol: AnyObject {

func releaseDbConnection() throws

func requestHistorySync() async throws

func signatureRequest() -> FfiSignatureRequest?
}

Expand Down Expand Up @@ -2054,6 +2056,22 @@ open class FfiXmtpClient:
}
}

open func requestHistorySync() async throws {
return
try await uniffiRustCallAsync(
rustFutureFunc: {
uniffi_xmtpv3_fn_method_ffixmtpclient_request_history_sync(
self.uniffiClonePointer()
)
},
pollFunc: ffi_xmtpv3_rust_future_poll_void,
completeFunc: ffi_xmtpv3_rust_future_complete_void,
freeFunc: ffi_xmtpv3_rust_future_free_void,
liftFunc: { $0 },
errorHandler: FfiConverterTypeGenericError.lift
)
}

open func signatureRequest() -> FfiSignatureRequest? {
return try! FfiConverterOptionTypeFfiSignatureRequest.lift(try! rustCall {
uniffi_xmtpv3_fn_method_ffixmtpclient_signature_request(self.uniffiClonePointer(), $0)
Expand Down Expand Up @@ -4047,11 +4065,11 @@ private func uniffiFutureContinuationCallback(handle: UInt64, pollResult: Int8)
* xmtp.create_client(account_address, nonce, inbox_id, Option<legacy_signed_private_key_proto>)
* ```
*/
public func createClient(logger: FfiLogger, host: String, isSecure: Bool, db: String?, encryptionKey: Data?, inboxId: String, accountAddress: String, nonce: UInt64, legacySignedPrivateKeyProto: Data?) async throws -> FfiXmtpClient {
public func createClient(logger: FfiLogger, host: String, isSecure: Bool, db: String?, encryptionKey: Data?, inboxId: String, accountAddress: String, nonce: UInt64, legacySignedPrivateKeyProto: Data?, historySyncUrl: String?) async throws -> FfiXmtpClient {
return
try await uniffiRustCallAsync(
rustFutureFunc: {
uniffi_xmtpv3_fn_func_create_client(FfiConverterCallbackInterfaceFfiLogger.lower(logger), FfiConverterString.lower(host), FfiConverterBool.lower(isSecure), FfiConverterOptionString.lower(db), FfiConverterOptionData.lower(encryptionKey), FfiConverterString.lower(inboxId), FfiConverterString.lower(accountAddress), FfiConverterUInt64.lower(nonce), FfiConverterOptionData.lower(legacySignedPrivateKeyProto))
uniffi_xmtpv3_fn_func_create_client(FfiConverterCallbackInterfaceFfiLogger.lower(logger), FfiConverterString.lower(host), FfiConverterBool.lower(isSecure), FfiConverterOptionString.lower(db), FfiConverterOptionData.lower(encryptionKey), FfiConverterString.lower(inboxId), FfiConverterString.lower(accountAddress), FfiConverterUInt64.lower(nonce), FfiConverterOptionData.lower(legacySignedPrivateKeyProto), FfiConverterOptionString.lower(historySyncUrl))
},
pollFunc: ffi_xmtpv3_rust_future_poll_pointer,
completeFunc: ffi_xmtpv3_rust_future_complete_pointer,
Expand Down Expand Up @@ -4220,7 +4238,7 @@ private var initializationResult: InitializationResult {
if bindings_contract_version != scaffolding_contract_version {
return InitializationResult.contractVersionMismatch
}
if uniffi_xmtpv3_checksum_func_create_client() != 51078 {
if uniffi_xmtpv3_checksum_func_create_client() != 6255 {
return InitializationResult.apiChecksumMismatch
}
if uniffi_xmtpv3_checksum_func_create_v2_client() != 48060 {
Expand Down Expand Up @@ -4445,6 +4463,9 @@ private var initializationResult: InitializationResult {
if uniffi_xmtpv3_checksum_method_ffixmtpclient_release_db_connection() != 11067 {
return InitializationResult.apiChecksumMismatch
}
if uniffi_xmtpv3_checksum_method_ffixmtpclient_request_history_sync() != 22295 {
return InitializationResult.apiChecksumMismatch
}
if uniffi_xmtpv3_checksum_method_ffixmtpclient_signature_request() != 18270 {
return InitializationResult.apiChecksumMismatch
}
Expand Down

0 comments on commit d0c1007

Please sign in to comment.