Skip to content

Commit

Permalink
Merge pull request #73 from xmtp/np/scw-max-past-epoch
Browse files Browse the repository at this point in the history
Latest version for max past epoch fix and SCW
  • Loading branch information
nplasterer authored Oct 11, 2024
2 parents f07383e + 6a29dbc commit d5d5134
Show file tree
Hide file tree
Showing 4 changed files with 62 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.9-beta1'
s.version = '0.5.9-beta2'
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-137062e/LibXMTPSwiftFFI.zip", :type => :zip }
s.source = { :http => "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-387d033/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-137062e/LibXMTPSwiftFFI.zip",
checksum: "57c6338bb1ec576aaeeaf2d1283f4cf4acb90de8605d01176ebc51f5fa1bd9ff"
url: "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-387d033/LibXMTPSwiftFFI.zip",
checksum: "7cd3d6fc639cf1e68f60fbe56a3ca7d50b32a1c3c43502121619c3f71f4e3777"
),
.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: 137062e8
Version: 387d0333
Branch: main
Date: 2024-10-08 19:58:58 +0000
Date: 2024-10-10 20:54:05 +0000
56 changes: 56 additions & 0 deletions Sources/LibXMTP/xmtpv3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2163,6 +2163,14 @@ public protocol FfiXmtpClientProtocol: AnyObject {
*/
func addWallet(existingWalletAddress: String, newWalletAddress: String) async throws -> FfiSignatureRequest

/**
* * Get the inbox state for each `inbox_id`.
* *
* * If `refresh_from_network` is true, the client will go to the network first to refresh the state.
* * Otherwise, the state will be read from the local database.
*/
func addressesFromInboxId(refreshFromNetwork: Bool, inboxIds: [String]) async throws -> [FfiInboxState]

func applySignatureRequest(signatureRequest: FfiSignatureRequest) async throws

func canMessage(accountAddresses: [String]) async throws -> [String: Bool]
Expand Down Expand Up @@ -2274,6 +2282,29 @@ open class FfiXmtpClient:
)
}

/**
* * Get the inbox state for each `inbox_id`.
* *
* * If `refresh_from_network` is true, the client will go to the network first to refresh the state.
* * Otherwise, the state will be read from the local database.
*/
open func addressesFromInboxId(refreshFromNetwork: Bool, inboxIds: [String]) async throws -> [FfiInboxState] {
return
try await uniffiRustCallAsync(
rustFutureFunc: {
uniffi_xmtpv3_fn_method_ffixmtpclient_addresses_from_inbox_id(
self.uniffiClonePointer(),
FfiConverterBool.lower(refreshFromNetwork), FfiConverterSequenceString.lower(inboxIds)
)
},
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: FfiConverterSequenceTypeFfiInboxState.lift,
errorHandler: FfiConverterTypeGenericError.lift
)
}

open func applySignatureRequest(signatureRequest: FfiSignatureRequest) async throws {
return
try await uniffiRustCallAsync(
Expand Down Expand Up @@ -5132,6 +5163,28 @@ private struct FfiConverterSequenceTypeFfiGroupMember: FfiConverterRustBuffer {
}
}

private struct FfiConverterSequenceTypeFfiInboxState: FfiConverterRustBuffer {
typealias SwiftType = [FfiInboxState]

public static func write(_ value: [FfiInboxState], into buf: inout [UInt8]) {
let len = Int32(value.count)
writeInt(&buf, len)
for item in value {
FfiConverterTypeFfiInboxState.write(item, into: &buf)
}
}

public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [FfiInboxState] {
let len: Int32 = try readInt(&buf)
var seq = [FfiInboxState]()
seq.reserveCapacity(Int(len))
for _ in 0 ..< len {
try seq.append(FfiConverterTypeFfiInboxState.read(from: &buf))
}
return seq
}
}

private struct FfiConverterSequenceTypeFfiInstallation: FfiConverterRustBuffer {
typealias SwiftType = [FfiInstallation]

Expand Down Expand Up @@ -5730,6 +5783,9 @@ private var initializationResult: InitializationResult = {
if uniffi_xmtpv3_checksum_method_ffixmtpclient_add_wallet() != 23786 {
return InitializationResult.apiChecksumMismatch
}
if uniffi_xmtpv3_checksum_method_ffixmtpclient_addresses_from_inbox_id() != 29264 {
return InitializationResult.apiChecksumMismatch
}
if uniffi_xmtpv3_checksum_method_ffixmtpclient_apply_signature_request() != 32172 {
return InitializationResult.apiChecksumMismatch
}
Expand Down

0 comments on commit d5d5134

Please sign in to comment.