diff --git a/Package.swift b/Package.swift index d7bc2cb6..23776046 100644 --- a/Package.swift +++ b/Package.swift @@ -19,6 +19,7 @@ let package = Package( .package(path: "localPackages/Arti"), .package(path: "localPackages/BitFoundation"), .package(path: "localPackages/BitLogger"), + .package(path: "localPackages/NdrFfi"), .package(url: "https://github.com/21-DOT-DEV/swift-secp256k1", exact: "0.21.1") ], targets: [ @@ -28,7 +29,8 @@ let package = Package( .product(name: "P256K", package: "swift-secp256k1"), .product(name: "BitFoundation", package: "BitFoundation"), .product(name: "BitLogger", package: "BitLogger"), - .product(name: "Tor", package: "Arti") + .product(name: "Tor", package: "Arti"), + .product(name: "NdrFfi", package: "NdrFfi") ], path: "bitchat", exclude: [ @@ -48,7 +50,8 @@ let package = Package( name: "bitchatTests", dependencies: [ "bitchat", - .product(name: "BitFoundation", package: "BitFoundation") + .product(name: "BitFoundation", package: "BitFoundation"), + .product(name: "NdrFfi", package: "NdrFfi") ], path: "bitchatTests", exclude: [ diff --git a/bitchat.xcodeproj/project.pbxproj b/bitchat.xcodeproj/project.pbxproj index a648a09f..59baf8ce 100644 --- a/bitchat.xcodeproj/project.pbxproj +++ b/bitchat.xcodeproj/project.pbxproj @@ -228,6 +228,7 @@ A6E3E5712E7703760032EA8A /* BitLogger */, A6E3EA802E7706A80032EA8A /* Tor */, A6BCF9492F809550001CF9B9 /* BitFoundation */, + NDRF0002000000000000000000 /* NdrFfi */, ); productName = bitchat_macOS; productReference = 8F3A7C058C2C8E1A06C8CF8B /* bitchat.app */; @@ -309,6 +310,7 @@ A6E3E56F2E77036A0032EA8A /* BitLogger */, A6E3EA7E2E7706720032EA8A /* Tor */, A6BCF9472F80953E001CF9B9 /* BitFoundation */, + NDRF0003000000000000000000 /* NdrFfi */, ); productName = bitchat_iOS; productReference = 96D0D41CA19EE5A772AA8434 /* bitchat.app */; @@ -351,6 +353,7 @@ A6E3E56E2E77036A0032EA8A /* XCLocalSwiftPackageReference "localPackages/BitLogger" */, A6E3EA7D2E7706720032EA8A /* XCLocalSwiftPackageReference "localPackages/Arti" */, A6BCF9462F80953E001CF9B9 /* XCLocalSwiftPackageReference "localPackages/BitFoundation" */, + NDRF0001000000000000000000 /* XCLocalSwiftPackageReference "localPackages/NdrFfi" */, ); preferredProjectObjectVersion = 90; projectDirPath = ""; @@ -928,6 +931,10 @@ isa = XCLocalSwiftPackageReference; relativePath = localPackages/Arti; }; + NDRF0001000000000000000000 /* XCLocalSwiftPackageReference "localPackages/NdrFfi" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = localPackages/NdrFfi; + }; /* End XCLocalSwiftPackageReference section */ /* Begin XCRemoteSwiftPackageReference section */ @@ -977,6 +984,14 @@ package = B8C407587481BBB190741C93 /* XCRemoteSwiftPackageReference "swift-secp256k1" */; productName = P256K; }; + NDRF0002000000000000000000 /* NdrFfi */ = { + isa = XCSwiftPackageProductDependency; + productName = NdrFfi; + }; + NDRF0003000000000000000000 /* NdrFfi */ = { + isa = XCSwiftPackageProductDependency; + productName = NdrFfi; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 475D96681D0EA0AE57A4E06E /* Project object */; diff --git a/bitchat/Nostr/NostrRelayManager.swift b/bitchat/Nostr/NostrRelayManager.swift index ebfeadaa..402be0e7 100644 --- a/bitchat/Nostr/NostrRelayManager.swift +++ b/bitchat/Nostr/NostrRelayManager.swift @@ -965,7 +965,7 @@ enum NostrRequest: Encodable { } } -struct NostrFilter: Encodable { +struct NostrFilter: Codable { var ids: [String]? var authors: [String]? var kinds: [Int]? @@ -974,7 +974,7 @@ struct NostrFilter: Encodable { var limit: Int? // Tag filters - stored internally but encoded specially - fileprivate var tagFilters: [String: [String]]? + var tagFilters: [String: [String]]? init() { // Default initializer @@ -984,6 +984,29 @@ struct NostrFilter: Encodable { enum CodingKeys: String, CodingKey { case ids, authors, kinds, since, until, limit } + + init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: DynamicCodingKey.self) + + self.ids = try container.decodeIfPresent([String].self, forKey: DynamicCodingKey(stringValue: "ids")) + self.authors = try container.decodeIfPresent([String].self, forKey: DynamicCodingKey(stringValue: "authors")) + self.kinds = try container.decodeIfPresent([Int].self, forKey: DynamicCodingKey(stringValue: "kinds")) + self.since = try container.decodeIfPresent(Int.self, forKey: DynamicCodingKey(stringValue: "since")) + self.until = try container.decodeIfPresent(Int.self, forKey: DynamicCodingKey(stringValue: "until")) + self.limit = try container.decodeIfPresent(Int.self, forKey: DynamicCodingKey(stringValue: "limit")) + + // Decode tag filters (#p, #d, etc) into internal storage without the leading '#'. + var decodedTagFilters: [String: [String]] = [:] + for key in container.allKeys { + let name = key.stringValue + guard name.hasPrefix("#") else { continue } + let tag = String(name.dropFirst()) + if let values = try container.decodeIfPresent([String].self, forKey: key) { + decodedTagFilters[tag] = values + } + } + self.tagFilters = decodedTagFilters.isEmpty ? nil : decodedTagFilters + } func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: DynamicCodingKey.self) diff --git a/bitchat/Protocols/BitchatProtocol.swift b/bitchat/Protocols/BitchatProtocol.swift index 4ebe6509..5d2fa270 100644 --- a/bitchat/Protocols/BitchatProtocol.swift +++ b/bitchat/Protocols/BitchatProtocol.swift @@ -75,6 +75,9 @@ enum NoisePayloadType: UInt8 { // Verification (QR-based OOB binding) case verifyChallenge = 0x10 // Verification challenge case verifyResponse = 0x11 // Verification response + // Double Ratchet (nostr-double-ratchet) out-of-band session bootstrap + // Nostr invite/response events are exchanged over the BLE Noise channel (not published to Nostr). + case ndrEvent = 0x12 // UTF-8 Nostr event JSON (invite/response) var description: String { switch self { @@ -83,6 +86,7 @@ enum NoisePayloadType: UInt8 { case .delivered: return "delivered" case .verifyChallenge: return "verifyChallenge" case .verifyResponse: return "verifyResponse" + case .ndrEvent: return "ndrEvent" } } } diff --git a/bitchat/Services/BLE/BLEService.swift b/bitchat/Services/BLE/BLEService.swift index 055c254f..067533b9 100644 --- a/bitchat/Services/BLE/BLEService.swift +++ b/bitchat/Services/BLE/BLEService.swift @@ -248,12 +248,22 @@ final class BLEService: NSObject { } // MARK: - Initialization + + private static func shouldEnableCoreBluetooth() -> Bool { + // SwiftPM's swift-testing/xctest runner is a command-line tool without an Info.plist. + // On macOS, touching CoreBluetooth there can crash due to missing usage-description keys (TCC). + let processName = ProcessInfo.processInfo.processName.lowercased() + if processName.contains("swiftpm-testing-helper") { return false } + if processName.contains("xctest") { return false } + if ProcessInfo.processInfo.environment["XCTestConfigurationFilePath"] != nil { return false } + return true + } init( keychain: KeychainManagerProtocol, idBridge: NostrIdentityBridge, identityManager: SecureIdentityStateManagerProtocol, - initializeBluetoothManagers: Bool = true + initializeBluetoothManagers: Bool = BLEService.shouldEnableCoreBluetooth() ) { self.keychain = keychain self.idBridge = idBridge @@ -312,6 +322,8 @@ final class BLEService: NSObject { centralManager = CBCentralManager(delegate: self, queue: bleQueue) peripheralManager = CBPeripheralManager(delegate: self, queue: bleQueue) #endif + } else { + SecureLogger.info("CoreBluetooth disabled (test environment)", category: .session) } // Single maintenance timer for all periodic tasks (dispatch-based for determinism) @@ -1578,6 +1590,13 @@ final class BLEService: NSObject { guard let payload = VerificationService.shared.buildVerifyResponse(noiseKeyHex: noiseKeyHex, nonceA: nonceA) else { return } sendNoisePayload(payload, to: peerID) } + + func sendNdrEvent(to peerID: PeerID, eventJson: String) { + guard let data = eventJson.data(using: .utf8), !data.isEmpty else { return } + var payload = Data([NoisePayloadType.ndrEvent.rawValue]) + payload.append(data) + sendNoisePayload(payload, to: peerID) + } } // MARK: - GossipSyncManager Delegate @@ -4205,6 +4224,11 @@ extension BLEService { notifyUI { [weak self] in self?.delegate?.didReceiveNoisePayload(from: peerID, type: .verifyResponse, payload: Data(payloadData), timestamp: ts) } + case .ndrEvent: + let ts = Date(timeIntervalSince1970: Double(packet.timestamp) / 1000) + notifyUI { [weak self] in + self?.delegate?.didReceiveNoisePayload(from: peerID, type: .ndrEvent, payload: Data(payloadData), timestamp: ts) + } case .none: SecureLogger.warning("⚠️ Unknown noise payload type: \(payloadType)") } diff --git a/bitchat/Services/NdrNostrService.swift b/bitchat/Services/NdrNostrService.swift new file mode 100644 index 00000000..3b6c2635 --- /dev/null +++ b/bitchat/Services/NdrNostrService.swift @@ -0,0 +1,370 @@ +import BitLogger +import Foundation +import NdrFfi + +@MainActor +protocol NostrRelayManaging: AnyObject { + func subscribe( + filter: NostrFilter, + id: String, + relayUrls: [String]?, + handler: @escaping (NostrEvent) -> Void, + onEOSE: (() -> Void)? + ) + func unsubscribe(id: String) + func sendEvent(_ event: NostrEvent, to relayUrls: [String]?) +} + +extension NostrRelayManager: NostrRelayManaging {} + +/// Bridges `nostr-double-ratchet` (ndr-ffi) `SessionManagerHandle` with `NostrRelayManager`. +/// +/// The ndr session manager emits a stream of pub/sub actions we must execute externally: +/// - `subscribe` / `unsubscribe`: Nostr filter subscriptions (for invite responses, sessions, etc) +/// - `publish_signed`: signed Nostr events to publish +/// - `decrypted_message`: decrypted inner event JSON (kind 14) to surface to the app +/// +/// BitChat policy: do NOT publish double-ratchet invite/response handshake events to Nostr. +/// Those are exchanged out-of-band over the BLE Noise channel (see `Transport.sendNdrEvent`). +@MainActor +final class NdrNostrService { + static let shared = NdrNostrService() + private static let compactInviteURLRoot = "https://b" + + /// Called when an ndr message is decrypted into an inner Nostr event (kind 14). + var onDecryptedMessage: ((NostrEvent) -> Void)? + + private let relayManager: NostrRelayManaging + private let storageDirectoryProvider: @MainActor () throws -> URL + + private var sessionManager: SessionManagerHandle? + private var activeSubIDs = Set() + private var cachedInviteEventJson: String? + + private var configuredForPubkeyHex: String? + private let deviceId: String + + private init() { + self.relayManager = NostrRelayManager.shared + self.deviceId = Self.loadOrCreateDeviceId() + self.storageDirectoryProvider = Self.ndrStorageDirectory + } + + /// Dependency-injected initializer (primarily for tests). + init( + relayManager: NostrRelayManaging, + deviceId: String, + storageDirectoryProvider: @escaping @MainActor () throws -> URL + ) { + self.relayManager = relayManager + self.deviceId = deviceId + self.storageDirectoryProvider = storageDirectoryProvider + } + + var isConfigured: Bool { sessionManager != nil } + var configuredPubkeyHex: String? { configuredForPubkeyHex } + + /// Returns our current device invite event JSON (kind 30078), if available. + /// + /// This is exchanged out-of-band with mutual favorites over BLE and is never published to Nostr. + func currentInviteEventJson() -> String? { + cachedInviteEventJson + } + + func configureIfNeeded(identity: NostrIdentity) { + let pubkey = identity.publicKeyHex.lowercased() + if configuredForPubkeyHex == pubkey, sessionManager != nil { return } + + // Identity changed: tear down subscriptions we created (best-effort). + for id in activeSubIDs { + relayManager.unsubscribe(id: id) + } + activeSubIDs.removeAll() + sessionManager = nil + cachedInviteEventJson = nil + configuredForPubkeyHex = pubkey + + do { + let storagePath = try storageDirectoryProvider().path + let mgr = try SessionManagerHandle.newWithStoragePath( + ourPubkeyHex: pubkey, + ourIdentityPrivkeyHex: identity.privateKey.hexEncodedString(), + deviceId: deviceId, + storagePath: storagePath, + ownerPubkeyHex: nil + ) + try mgr.`init`() + sessionManager = mgr + _ = drainAndApplyPubSubEvents() + SecureLogger.info("NdrNostrService configured pub=\(pubkey.prefix(8))… device=\(deviceId)", category: .session) + } catch { + SecureLogger.error("NdrNostrService: failed to configure: \(error)", category: .session) + sessionManager = nil + } + } + + func hasActiveSession(with peerPubkeyHex: String) -> Bool { + guard let mgr = sessionManager else { return false } + do { + return try mgr.getActiveSessionState(peerPubkeyHex: peerPubkeyHex.lowercased()) != nil + } catch { + return false + } + } + + func activeSessionStateJson(with peerPubkeyHex: String) -> String? { + guard let mgr = sessionManager else { return nil } + return try? mgr.getActiveSessionState(peerPubkeyHex: peerPubkeyHex.lowercased()) + } + + /// Attempt to send via ndr when a session exists. + /// Returns true when the runtime accepted the message, even if it queued it for a later relay publish. + func sendIfPossible(_ text: String, to peerPubkeyHex: String) -> Bool { + guard let mgr = sessionManager else { return false } + guard hasActiveSession(with: peerPubkeyHex) else { return false } + do { + let outboundEventIDs = try mgr.sendText( + recipientPubkeyHex: peerPubkeyHex.lowercased(), + text: text, + expiresAtSeconds: nil + ) + _ = drainAndApplyPubSubEvents() + if outboundEventIDs.isEmpty { + SecureLogger.debug( + "NdrNostrService: send queued no relay publish for \(peerPubkeyHex.prefix(8))…", + category: .session + ) + } + return true + } catch { + SecureLogger.debug("NdrNostrService: send failed (no session yet?): \(error)", category: .session) + // Still drain in case the error queued any pubsub actions. + _ = drainAndApplyPubSubEvents() + return false + } + } + + /// Process a received invite/response payload (transferred out-of-band over BLE). + /// + /// Returns any outbound handshake payloads (e.g. giftwrap response JSON or compact invite URL) + /// that should be returned to the sender over BLE. + func processOutOfBandEventJson(_ eventJson: String) -> [String] { + guard let mgr = sessionManager else { return [] } + let payload = eventJson.trimmingCharacters(in: .whitespacesAndNewlines) + let inboundInvite = parseOutOfBandInvite(payload) + do { + switch inboundInvite?.transport { + case .eventJSON: + _ = try mgr.acceptInviteFromEventJson(eventJson: payload, ownerPubkeyHintHex: nil) + case .url: + _ = try mgr.acceptInviteFromUrl(inviteUrl: payload, ownerPubkeyHintHex: nil) + case .none: + try mgr.processEvent(eventJson: payload) + } + } catch { + SecureLogger.debug("NdrNostrService: processOutOfBandEventJson ignored/rejected: \(error)", category: .session) + } + let outOfBandPublishes = drainAndApplyPubSubEvents(collectOutOfBandPublishes: true) + if let inboundInvite, + outOfBandPublishes.isEmpty, + hasActiveSession(with: inboundInvite.senderPubkeyHex), + let currentInvite = preferredInviteOobPayload() { + return outOfBandPublishes + [currentInvite] + } + return outOfBandPublishes + } + + /// Process a Nostr event received from relays (kind 1060 messages, app-keys maintenance, etc). + func processInboundRelayEvent(_ event: NostrEvent) { + processInboundNostrEvent(event) + } + + // MARK: - Internals + + private func processInboundNostrEvent(_ event: NostrEvent) { + guard let mgr = sessionManager else { return } + guard let json = try? event.jsonString() else { return } + + do { + try mgr.processEvent(eventJson: json) + } catch { + // ndr will reject most unrelated events; keep log noise low. + SecureLogger.debug("NdrNostrService: processEvent ignored/rejected: \(error)", category: .session) + } + + _ = drainAndApplyPubSubEvents() + } + + @discardableResult + private func drainAndApplyPubSubEvents(collectOutOfBandPublishes: Bool = false) -> [String] { + guard let mgr = sessionManager else { return [] } + var outOfBandPublishes: [String] = [] + do { + let events = try mgr.drainEvents() + for e in events { + apply( + pubsub: e, + collectOutOfBandPublish: collectOutOfBandPublishes ? { outOfBandPublishes.append($0) } : nil + ) + } + } catch { + SecureLogger.error("NdrNostrService: drainEvents failed: \(error)", category: .session) + } + return outOfBandPublishes + } + + private func apply(pubsub e: PubSubEvent, collectOutOfBandPublish: ((String) -> Void)?) { + switch e.kind { + case "subscribe": + guard let subid = e.subid, let filterJson = e.filterJson else { return } + + do { + let filter = try JSONDecoder().decode(NostrFilter.self, from: Data(filterJson.utf8)) + // BitChat policy: don't do Nostr-based DR invite discovery or invite-response listening. + if shouldIgnoreNdrSubscription(filter) { + return + } + guard activeSubIDs.insert(subid).inserted else { return } // already subscribed + relayManager.subscribe( + filter: filter, + id: subid, + relayUrls: nil, + handler: { [weak self] event in + self?.processInboundNostrEvent(event) + }, + onEOSE: nil + ) + } catch { + SecureLogger.error("NdrNostrService: failed to decode subscribe filter: \(error)", category: .session) + } + + case "unsubscribe": + guard let subid = e.subid else { return } + relayManager.unsubscribe(id: subid) + activeSubIDs.remove(subid) + + case "publish_signed": + guard let eventJson = e.eventJson else { return } + do { + let event = try JSONDecoder().decode(NostrEvent.self, from: Data(eventJson.utf8)) + + if isDoubleRatchetInviteEvent(event) { + // Cache the current device invite for out-of-band sharing; never publish to Nostr. + cachedInviteEventJson = eventJson + collectOutOfBandPublish?(eventJson) + return + } + if event.kind == 1059 { + // Giftwrap responses are part of the DR handshake; exchange OOB over BLE. + collectOutOfBandPublish?(eventJson) + return + } + + relayManager.sendEvent(event, to: nil) + } catch { + SecureLogger.error("NdrNostrService: failed to decode outbound event: \(error)", category: .session) + } + + case "decrypted_message": + guard let innerJson = e.content else { return } + do { + let inner = try JSONDecoder().decode(NostrEvent.self, from: Data(innerJson.utf8)) + onDecryptedMessage?(inner) + } catch { + SecureLogger.error("NdrNostrService: failed to decode decrypted inner event: \(error)", category: .session) + } + + default: + // Other events currently ignored (e.g. app-keys maintenance). + break + } + } + + private func isDoubleRatchetInviteEvent(_ event: NostrEvent) -> Bool { + guard event.kind == 30078 else { return false } + for tag in event.tags where tag.count >= 2 { + if tag[0] == "l", tag[1] == "double-ratchet/invites" { + return true + } + if tag[0] == "d", tag[1].hasPrefix("double-ratchet/invites/") { + return true + } + } + return false + } + + private enum OutOfBandInviteTransport { + case eventJSON + case url + } + + private struct ParsedOutOfBandInvite { + let senderPubkeyHex: String + let transport: OutOfBandInviteTransport + } + + private func parseOutOfBandInvite(_ payload: String) -> ParsedOutOfBandInvite? { + guard !payload.isEmpty else { return nil } + if payload.first == "{" { + guard let event = try? JSONDecoder().decode(NostrEvent.self, from: Data(payload.utf8)), + isDoubleRatchetInviteEvent(event) else { + return nil + } + return ParsedOutOfBandInvite( + senderPubkeyHex: event.pubkey.lowercased(), + transport: .eventJSON + ) + } + + guard let invite = try? InviteHandle.fromUrl(url: payload) else { + return nil + } + return ParsedOutOfBandInvite( + senderPubkeyHex: invite.getInviterPubkeyHex().lowercased(), + transport: .url + ) + } + + private func preferredInviteOobPayload() -> String? { + guard let eventJson = cachedInviteEventJson else { return nil } + return compactInviteURL(from: eventJson) ?? eventJson + } + + private func compactInviteURL(from eventJson: String) -> String? { + guard let invite = try? InviteHandle.fromEventJson(eventJson: eventJson) else { + return nil + } + return try? invite.toUrl(root: Self.compactInviteURLRoot) + } + + private func shouldIgnoreNdrSubscription(_ filter: NostrFilter) -> Bool { + // Never use Nostr for invite/response exchange in BitChat. + if filter.kinds?.contains(1059) == true { + return true + } + if filter.kinds?.contains(30078) == true, + filter.tagFilters?["l"]?.contains("double-ratchet/invites") == true { + return true + } + return false + } + + private static func loadOrCreateDeviceId() -> String { + let defaults = UserDefaults.standard + let key = "ndr.device_id" + if let existing = defaults.string(forKey: key), !existing.isEmpty { + return existing + } + let id = UUID().uuidString + defaults.set(id, forKey: key) + return id + } + + private static func ndrStorageDirectory() throws -> URL { + let root = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first + ?? FileManager.default.temporaryDirectory + let dir = root.appendingPathComponent("ndr", isDirectory: true) + try FileManager.default.createDirectory(at: dir, withIntermediateDirectories: true, attributes: nil) + return dir + } +} diff --git a/bitchat/Services/NetworkActivationService.swift b/bitchat/Services/NetworkActivationService.swift index a9795024..04ad565f 100644 --- a/bitchat/Services/NetworkActivationService.swift +++ b/bitchat/Services/NetworkActivationService.swift @@ -44,10 +44,14 @@ final class NetworkActivationService: ObservableObject { private let permissionProvider: () -> LocationChannelManager.PermissionState private let mutualFavoritesProvider: () -> Set private let torController: NetworkActivationTorControlling - private let relayController: NetworkActivationRelayControlling + private let relayControllerProvider: @MainActor () -> NetworkActivationRelayControlling private let proxyController: NetworkActivationProxyControlling private let notificationCenter: NotificationCenter + private var relayController: NetworkActivationRelayControlling { + relayControllerProvider() + } + private init() { storage = .standard locationPermissionPublisher = LocationChannelManager.shared.$permissionState.eraseToAnyPublisher() @@ -55,7 +59,7 @@ final class NetworkActivationService: ObservableObject { permissionProvider = { LocationChannelManager.shared.permissionState } mutualFavoritesProvider = { FavoritesPersistenceService.shared.mutualFavorites } torController = TorManager.shared - relayController = NostrRelayManager.shared + relayControllerProvider = { NostrRelayManager.shared } proxyController = TorURLSession.shared notificationCenter = .default } @@ -77,7 +81,7 @@ final class NetworkActivationService: ObservableObject { self.permissionProvider = permissionProvider self.mutualFavoritesProvider = mutualFavoritesProvider self.torController = torController - self.relayController = relayController + self.relayControllerProvider = { relayController } self.proxyController = proxyController self.notificationCenter = notificationCenter } diff --git a/bitchat/Services/NostrTransport.swift b/bitchat/Services/NostrTransport.swift index b822a48b..429e2129 100644 --- a/bitchat/Services/NostrTransport.swift +++ b/bitchat/Services/NostrTransport.swift @@ -5,6 +5,34 @@ import Combine // Minimal Nostr transport conforming to Transport for offline sending final class NostrTransport: Transport, @unchecked Sendable { + enum OutboundPrivateMessageTransport: String, Codable { + case ndr + case nip17 + } + + enum OutboundPrivateMessageError: LocalizedError { + case missingRecipientNpub(String) + case invalidRecipientNpub(String) + case missingSenderIdentity + case failedToEncodePacket + case failedToBuildNip17Event + + var errorDescription: String? { + switch self { + case .missingRecipientNpub(let peerID): + return "Missing recipient Nostr public key for peer \(peerID)" + case .invalidRecipientNpub(let npub): + return "Recipient Nostr public key is invalid: \(npub)" + case .missingSenderIdentity: + return "Local Nostr identity is unavailable" + case .failedToEncodePacket: + return "Failed to encode embedded private-message packet" + case .failedToBuildNip17Event: + return "Failed to build fallback NIP-17 event" + } + } + } + struct Dependencies { let notificationCenter: NotificationCenter let loadFavorites: @MainActor () -> [Data: FavoritesPersistenceService.FavoriteRelationship] @@ -45,6 +73,7 @@ final class NostrTransport: Transport, @unchecked Sendable { private let keychain: KeychainManagerProtocol private let idBridge: NostrIdentityBridge private let dependencies: Dependencies + private let ndrService: NdrNostrService private var favoriteStatusObserver: NSObjectProtocol? // Reachability Cache (thread-safe) @@ -55,11 +84,13 @@ final class NostrTransport: Transport, @unchecked Sendable { init( keychain: KeychainManagerProtocol, idBridge: NostrIdentityBridge, + ndrService: NdrNostrService? = nil, dependencies: Dependencies? = nil ) { self.keychain = keychain self.idBridge = idBridge self.dependencies = dependencies ?? .live(idBridge: idBridge) + self.ndrService = ndrService ?? NdrNostrService.shared setupObservers() @@ -158,18 +189,46 @@ final class NostrTransport: Transport, @unchecked Sendable { func sendPrivateMessage(_ content: String, to peerID: PeerID, recipientNickname: String, messageID: String) { Task { @MainActor in - guard let recipientNpub = resolveRecipientNpub(for: peerID), - let recipientHex = npubToHex(recipientNpub), - let senderIdentity = try? dependencies.currentIdentity() else { return } - SecureLogger.debug("NostrTransport: preparing PM to \(recipientNpub.prefix(16))… id=\(messageID.prefix(8))…", category: .session) - guard let embedded = NostrEmbeddedBitChat.encodePMForNostr(content: content, messageID: messageID, recipientPeerID: peerID, senderPeerID: senderPeerID) else { - SecureLogger.error("NostrTransport: failed to embed PM packet", category: .session) - return + do { + _ = try sendPrivateMessageAndReturnTransport( + content, + to: peerID, + recipientNickname: recipientNickname, + messageID: messageID + ) + } catch { + SecureLogger.error("NostrTransport: failed to send PM: \(error)", category: .session) } - sendWrappedMessage(content: embedded, recipientHex: recipientHex, senderIdentity: senderIdentity) } } + @MainActor + func sendPrivateMessageAndReturnTransport( + _ content: String, + to peerID: PeerID, + recipientNickname: String, + messageID: String + ) throws -> OutboundPrivateMessageTransport { + guard let recipientNpub = resolveRecipientNpub(for: peerID) else { + throw OutboundPrivateMessageError.missingRecipientNpub(peerID.id) + } + guard let recipientHex = npubToHex(recipientNpub) else { + throw OutboundPrivateMessageError.invalidRecipientNpub(recipientNpub) + } + guard let senderIdentity = try dependencies.currentIdentity() else { + throw OutboundPrivateMessageError.missingSenderIdentity + } + SecureLogger.debug("NostrTransport: preparing PM to \(recipientNpub.prefix(16))… id=\(messageID.prefix(8))…", category: .session) + guard let embedded = NostrEmbeddedBitChat.encodePMForNostr(content: content, messageID: messageID, recipientPeerID: peerID, senderPeerID: senderPeerID) else { + SecureLogger.error("NostrTransport: failed to embed PM packet", category: .session) + throw OutboundPrivateMessageError.failedToEncodePacket + } + guard let transport = sendWrappedMessage(content: embedded, recipientHex: recipientHex, senderIdentity: senderIdentity) else { + throw OutboundPrivateMessageError.failedToBuildNip17Event + } + return transport + } + func sendReadReceipt(_ receipt: ReadReceipt, to peerID: PeerID) { // Enqueue and process with throttling to avoid relay rate limits // Use barrier to synchronize access to readQueue @@ -190,7 +249,7 @@ final class NostrTransport: Transport, @unchecked Sendable { SecureLogger.error("NostrTransport: failed to embed favorite notification", category: .session) return } - sendWrappedMessage(content: embedded, recipientHex: recipientHex, senderIdentity: senderIdentity) + _ = sendWrappedMessage(content: embedded, recipientHex: recipientHex, senderIdentity: senderIdentity) } } @@ -205,7 +264,7 @@ final class NostrTransport: Transport, @unchecked Sendable { SecureLogger.error("NostrTransport: failed to embed DELIVERED ack", category: .session) return } - sendWrappedMessage(content: ack, recipientHex: recipientHex, senderIdentity: senderIdentity) + _ = sendWrappedMessage(content: ack, recipientHex: recipientHex, senderIdentity: senderIdentity) } } } @@ -219,7 +278,7 @@ extension NostrTransport { Task { @MainActor in SecureLogger.debug("GeoDM: send DELIVERED mid=\(messageID.prefix(8))…", category: .session) guard let embedded = NostrEmbeddedBitChat.encodeAckForNostrNoRecipient(type: .delivered, messageID: messageID, senderPeerID: senderPeerID) else { return } - sendWrappedMessage(content: embedded, recipientHex: recipientHex, senderIdentity: identity, registerPending: true) + _ = sendWrappedMessage(content: embedded, recipientHex: recipientHex, senderIdentity: identity, registerPending: true) } } @@ -227,7 +286,7 @@ extension NostrTransport { Task { @MainActor in SecureLogger.debug("GeoDM: send READ mid=\(messageID.prefix(8))…", category: .session) guard let embedded = NostrEmbeddedBitChat.encodeAckForNostrNoRecipient(type: .readReceipt, messageID: messageID, senderPeerID: senderPeerID) else { return } - sendWrappedMessage(content: embedded, recipientHex: recipientHex, senderIdentity: identity, registerPending: true) + _ = sendWrappedMessage(content: embedded, recipientHex: recipientHex, senderIdentity: identity, registerPending: true) } } @@ -240,7 +299,7 @@ extension NostrTransport { SecureLogger.error("NostrTransport: failed to embed geohash PM packet", category: .session) return } - sendWrappedMessage(content: embedded, recipientHex: recipientHex, senderIdentity: identity, registerPending: true) + _ = sendWrappedMessage(content: embedded, recipientHex: recipientHex, senderIdentity: identity, registerPending: true) } } } @@ -263,15 +322,24 @@ extension NostrTransport { /// Creates and sends a gift-wrapped private message event @MainActor - private func sendWrappedMessage(content: String, recipientHex: String, senderIdentity: NostrIdentity, registerPending: Bool = false) { + private func sendWrappedMessage(content: String, recipientHex: String, senderIdentity: NostrIdentity, registerPending: Bool = false) -> OutboundPrivateMessageTransport? { + // Prefer nostr-double-ratchet when a session exists. + // BitChat policy: double-ratchet invite/response handshake is exchanged out-of-band over BLE (mutual favorites), + // so we do not attempt Nostr-based invite discovery here. + ndrService.configureIfNeeded(identity: senderIdentity) + if ndrService.sendIfPossible(content, to: recipientHex) { + return .ndr + } + guard let event = try? NostrProtocol.createPrivateMessage(content: content, recipientPubkey: recipientHex, senderIdentity: senderIdentity) else { SecureLogger.error("NostrTransport: failed to build Nostr event", category: .session) - return + return nil } if registerPending { dependencies.registerPendingGiftWrap(event.id) } dependencies.sendEvent(event) + return .nip17 } /// Must be called within a barrier on `queue` @@ -295,7 +363,7 @@ extension NostrTransport { SecureLogger.error("NostrTransport: failed to embed READ ack", category: .session) return } - sendWrappedMessage(content: ack, recipientHex: recipientHex, senderIdentity: senderIdentity) + _ = sendWrappedMessage(content: ack, recipientHex: recipientHex, senderIdentity: senderIdentity) } } diff --git a/bitchat/Services/Transport.swift b/bitchat/Services/Transport.swift index 8f7fd03d..d6dcc21d 100644 --- a/bitchat/Services/Transport.swift +++ b/bitchat/Services/Transport.swift @@ -59,6 +59,9 @@ protocol Transport: AnyObject { // QR verification (optional for transports) func sendVerifyChallenge(to peerID: PeerID, noiseKeyHex: String, nonceA: Data) func sendVerifyResponse(to peerID: PeerID, noiseKeyHex: String, nonceA: Data) + + // Double Ratchet out-of-band bootstrap (optional for transports) + func sendNdrEvent(to peerID: PeerID, eventJson: String) // Pending file management (BCH-01-002: files held in memory until user accepts) func acceptPendingFile(id: String) -> URL? @@ -68,6 +71,7 @@ protocol Transport: AnyObject { extension Transport { func sendVerifyChallenge(to peerID: PeerID, noiseKeyHex: String, nonceA: Data) {} func sendVerifyResponse(to peerID: PeerID, noiseKeyHex: String, nonceA: Data) {} + func sendNdrEvent(to peerID: PeerID, eventJson: String) {} func sendFileBroadcast(_ packet: BitchatFilePacket, transferId: String) {} func sendFilePrivate(_ packet: BitchatFilePacket, to peerID: PeerID, transferId: String) {} func cancelTransfer(_ transferId: String) {} diff --git a/bitchat/ViewModels/ChatViewModel.swift b/bitchat/ViewModels/ChatViewModel.swift index a6f5b23c..b0c923a8 100644 --- a/bitchat/ViewModels/ChatViewModel.swift +++ b/bitchat/ViewModels/ChatViewModel.swift @@ -267,6 +267,7 @@ final class ChatViewModel: ObservableObject, BitchatDelegate, CommandContextProv let meshService: Transport let idBridge: NostrIdentityBridge let identityManager: SecureIdentityStateManagerProtocol + let ndrService: NdrNostrService var nostrRelayManager: NostrRelayManager? private let userDefaults = UserDefaults.standard @@ -395,13 +396,15 @@ final class ChatViewModel: ObservableObject, BitchatDelegate, CommandContextProv convenience init( keychain: KeychainManagerProtocol, idBridge: NostrIdentityBridge, - identityManager: SecureIdentityStateManagerProtocol + identityManager: SecureIdentityStateManagerProtocol, + ndrService: NdrNostrService? = nil ) { self.init( keychain: keychain, idBridge: idBridge, identityManager: identityManager, - transport: BLEService(keychain: keychain, idBridge: idBridge, identityManager: identityManager) + transport: BLEService(keychain: keychain, idBridge: idBridge, identityManager: identityManager), + ndrService: ndrService ) } @@ -412,11 +415,14 @@ final class ChatViewModel: ObservableObject, BitchatDelegate, CommandContextProv keychain: KeychainManagerProtocol, idBridge: NostrIdentityBridge, identityManager: SecureIdentityStateManagerProtocol, - transport: Transport + transport: Transport, + ndrService: NdrNostrService? = nil ) { + let resolvedNdrService = ndrService ?? NdrNostrService.shared self.keychain = keychain self.idBridge = idBridge self.identityManager = identityManager + self.ndrService = resolvedNdrService self.meshService = transport self.publicMessagePipeline = PublicMessagePipeline() @@ -433,7 +439,7 @@ final class ChatViewModel: ObservableObject, BitchatDelegate, CommandContextProv self.commandProcessor = CommandProcessor(identityManager: identityManager) self.privateChatManager = PrivateChatManager(meshService: meshService) self.unifiedPeerService = UnifiedPeerService(meshService: meshService, idBridge: idBridge, identityManager: identityManager) - let nostrTransport = NostrTransport(keychain: keychain, idBridge: idBridge) + let nostrTransport = NostrTransport(keychain: keychain, idBridge: idBridge, ndrService: resolvedNdrService) nostrTransport.senderPeerID = meshService.myPeerID self.messageRouter = MessageRouter(transports: [meshService, nostrTransport]) // Route receipts from PrivateChatManager through MessageRouter @@ -1559,8 +1565,60 @@ final class ChatViewModel: ObservableObject, BitchatDelegate, CommandContextProv // Update peer manager to refresh UI // UnifiedPeerService updates automatically via subscriptions } + + // If this update produced a mutual favorite relationship with a currently-connected peer, + // bootstrap nostr-double-ratchet over the BLE Noise channel (no Nostr invite publishing). + if let connected = unifiedPeerService.peers.first(where: { $0.isConnected && $0.noisePublicKey == peerPublicKey }) { + maybeBootstrapDoubleRatchetIfNeeded(for: connected.peerID) + } } } + + @MainActor + private func maybeBootstrapDoubleRatchetIfNeeded(for peerID: PeerID) { + guard let peer = unifiedPeerService.getPeer(by: peerID) else { return } + guard let relationship = FavoritesPersistenceService.shared.getFavoriteStatus(for: peer.noisePublicKey), + relationship.isMutual, + let peerNostrKey = relationship.peerNostrPublicKey, + let peerPubkeyHex = nostrPubkeyHex(from: peerNostrKey), + let currentIdentity = try? idBridge.getCurrentNostrIdentity() + else { + return + } + + ndrService.configureIfNeeded(identity: currentIdentity) + if ndrService.hasActiveSession(with: peerPubkeyHex) { + return + } + guard let inviteJson = ndrService.currentInviteEventJson() else { + return + } + + SecureLogger.debug( + "NDR: OOB invite -> \(peerID.id.prefix(8))… peer=\(peerPubkeyHex.prefix(8))…", + category: .session + ) + meshService.sendNdrEvent(to: peerID, eventJson: inviteJson) + } + + private func nostrPubkeyHex(from npubOrHex: String) -> String? { + if npubOrHex.hasPrefix("npub") { + do { + let (hrp, data) = try Bech32.decode(npubOrHex) + guard hrp == "npub" else { return nil } + return data.hexEncodedString() + } catch { + return nil + } + } + + // Accept raw hex pubkeys too. + let lowered = npubOrHex.lowercased() + if lowered.count == 64, lowered.allSatisfy({ $0.isHexDigit }) { + return lowered + } + return nil + } // MARK: - App Lifecycle @@ -1748,7 +1806,7 @@ final class ChatViewModel: ObservableObject, BitchatDelegate, CommandContextProv for message in messages where message.senderPeerID == peerID && !message.isRelay { if !sentReadReceipts.contains(message.id) { SecureLogger.debug("GeoDM: sending READ for mid=\(message.id.prefix(8))… to=\(recipientHex.prefix(8))…", category: .session) - let nostrTransport = NostrTransport(keychain: keychain, idBridge: idBridge) + let nostrTransport = NostrTransport(keychain: keychain, idBridge: idBridge, ndrService: ndrService) nostrTransport.senderPeerID = meshService.myPeerID nostrTransport.sendReadReceiptGeohash(message.id, toRecipientHex: recipientHex, from: id) sentReadReceipts.insert(message.id) @@ -3167,6 +3225,18 @@ final class ChatViewModel: ObservableObject, BitchatDelegate, CommandContextProv updateEncryptionStatus(for: peerID) } } + case .ndrEvent: + // Double Ratchet out-of-band event exchange (invite/response) is allowed only for mutual favorites. + guard let eventJson = String(data: payload, encoding: .utf8), !eventJson.isEmpty else { return } + guard let peer = unifiedPeerService.getPeer(by: peerID) else { return } + guard FavoritesPersistenceService.shared.isMutualFavorite(peer.noisePublicKey) else { return } + guard let currentIdentity = try? idBridge.getCurrentNostrIdentity() else { return } + + ndrService.configureIfNeeded(identity: currentIdentity) + let outbound = ndrService.processOutOfBandEventJson(eventJson) + for json in outbound { + meshService.sendNdrEvent(to: peerID, eventJson: json) + } } } } @@ -3258,6 +3328,9 @@ final class ChatViewModel: ObservableObject, BitchatDelegate, CommandContextProv // Flush any queued messages for this peer via router messageRouter.flushOutbox(for: peerID) + + // If this is a mutual favorite, bootstrap nostr-double-ratchet out-of-band over BLE. + maybeBootstrapDoubleRatchetIfNeeded(for: peerID) } } diff --git a/bitchat/ViewModels/Extensions/ChatViewModel+Nostr.swift b/bitchat/ViewModels/Extensions/ChatViewModel+Nostr.swift index b36aa49c..3ce81844 100644 --- a/bitchat/ViewModels/Extensions/ChatViewModel+Nostr.swift +++ b/bitchat/ViewModels/Extensions/ChatViewModel+Nostr.swift @@ -171,7 +171,7 @@ extension ChatViewModel { handleDelivered(noisePayload, senderPubkey: senderPubkey, convKey: convKey) case .readReceipt: handleReadReceipt(noisePayload, senderPubkey: senderPubkey, convKey: convKey) - case .verifyChallenge, .verifyResponse: + case .verifyChallenge, .verifyResponse, .ndrEvent: // QR verification payloads over Nostr are not supported; ignore in geohash DMs break } @@ -404,7 +404,7 @@ extension ChatViewModel { handleReadReceipt(payload, senderPubkey: senderPubkey, convKey: convKey) // Explicitly list other cases so we get compile-time check if a new case is added in the future - case .verifyChallenge, .verifyResponse: + case .verifyChallenge, .verifyResponse, .ndrEvent: break } } @@ -572,7 +572,8 @@ extension ChatViewModel { } // MARK: - Nostr DM Handling - + + @MainActor func setupNostrMessageHandling() { guard let currentIdentity = try? idBridge.getCurrentNostrIdentity() else { SecureLogger.warning("⚠️ No Nostr identity available for message handling", category: .session) @@ -580,6 +581,14 @@ extension ChatViewModel { } SecureLogger.debug("🔑 Setting up Nostr subscription for pubkey: \(currentIdentity.publicKeyHex.prefix(16))...", category: .session) + + // Configure nostr-double-ratchet (ndr-ffi) integration. + // BitChat policy: invite/response handshake is exchanged out-of-band over BLE (mutual favorites), + // so we only use Nostr here for kind 1060 message exchange and decryption. + ndrService.configureIfNeeded(identity: currentIdentity) + ndrService.onDecryptedMessage = { [weak self] innerEvent in + self?.handleNdrDecryptedMessage(innerEvent) + } // Subscribe to Nostr messages let filter = NostrFilter.giftWrapsFor( @@ -612,55 +621,89 @@ extension ChatViewModel { giftWrap: giftWrap, recipientIdentity: currentIdentity ) - - // Handle verification payloads first - if content.hasPrefix("verify:") { - // Ignore verification payloads arriving via Nostr path for now - // Verification should ideally happen over mesh for security binding - return - } - - // Check if it's a BitChat packet embedded in the content (bitchat1:...) - if content.hasPrefix("bitchat1:") { - guard let packet = Self.decodeEmbeddedBitChatPacket(from: content) else { - SecureLogger.error("Failed to decode embedded BitChat packet from Nostr DM", category: .session) - return - } - - // Map sender by Nostr pubkey to Noise key when possible - let actualSenderNoiseKey = findNoiseKey(for: senderPubkey) - - // Stable target ID if we know Noise key; otherwise temporary Nostr-based peer - let targetPeerID = PeerID(str: actualSenderNoiseKey?.hexEncodedString()) ?? PeerID(nostr_: senderPubkey) - - if packet.type == MessageType.noiseEncrypted.rawValue, - let payload = NoisePayload.decode(packet.payload) { - let messageTimestamp = Date(timeIntervalSince1970: TimeInterval(rumorTimestamp)) - // Store Nostr mapping - await MainActor.run { - nostrKeyMapping[targetPeerID] = senderPubkey - - // Handle packet types - switch payload.type { - case .privateMessage: - handlePrivateMessage(payload, senderPubkey: senderPubkey, convKey: targetPeerID, id: currentIdentity, messageTimestamp: messageTimestamp) - case .delivered: - handleDelivered(payload, senderPubkey: senderPubkey, convKey: targetPeerID) - case .readReceipt: - handleReadReceipt(payload, senderPubkey: senderPubkey, convKey: targetPeerID) - case .verifyChallenge, .verifyResponse: - break - } - } - } - } else { - SecureLogger.debug("Ignoring non-embedded Nostr DM content", category: .session) - } + await processDecryptedNostrDMContent( + content, + senderPubkey: senderPubkey, + rumorTimestamp: rumorTimestamp, + currentIdentity: currentIdentity + ) } catch { SecureLogger.error("Failed to decrypt Nostr message: \(error)", category: .session) } } + func handleNdrDecryptedMessage(_ innerEvent: NostrEvent) { + // Deduplicate using the stable inner event id. + if deduplicationService.hasProcessedNostrEvent(innerEvent.id) { return } + deduplicationService.recordNostrEvent(innerEvent.id) + + let content = innerEvent.content + let senderPubkey = innerEvent.pubkey + let rumorTimestamp = innerEvent.created_at + + Task(priority: .userInitiated) { [weak self] in + guard let self else { return } + guard let currentIdentity = try? self.idBridge.getCurrentNostrIdentity() else { return } + await self.processDecryptedNostrDMContent( + content, + senderPubkey: senderPubkey, + rumorTimestamp: rumorTimestamp, + currentIdentity: currentIdentity + ) + } + } + + private func processDecryptedNostrDMContent( + _ content: String, + senderPubkey: String, + rumorTimestamp: Int, + currentIdentity: NostrIdentity + ) async { + // Handle verification payloads first + if content.hasPrefix("verify:") { + // Ignore verification payloads arriving via Nostr path for now + // Verification should ideally happen over mesh for security binding + return + } + + // Check if it's a BitChat packet embedded in the content (bitchat1:...) + if content.hasPrefix("bitchat1:") { + guard let packet = Self.decodeEmbeddedBitChatPacket(from: content) else { + SecureLogger.error("Failed to decode embedded BitChat packet from Nostr DM", category: .session) + return + } + + // Map sender by Nostr pubkey to Noise key when possible + let actualSenderNoiseKey = findNoiseKey(for: senderPubkey) + + // Stable target ID if we know Noise key; otherwise temporary Nostr-based peer + let targetPeerID = PeerID(str: actualSenderNoiseKey?.hexEncodedString()) ?? PeerID(nostr_: senderPubkey) + + if packet.type == MessageType.noiseEncrypted.rawValue, + let payload = NoisePayload.decode(packet.payload) { + let messageTimestamp = Date(timeIntervalSince1970: TimeInterval(rumorTimestamp)) + // Store Nostr mapping + await MainActor.run { + nostrKeyMapping[targetPeerID] = senderPubkey + + // Handle packet types + switch payload.type { + case .privateMessage: + handlePrivateMessage(payload, senderPubkey: senderPubkey, convKey: targetPeerID, id: currentIdentity, messageTimestamp: messageTimestamp) + case .delivered: + handleDelivered(payload, senderPubkey: senderPubkey, convKey: targetPeerID) + case .readReceipt: + handleReadReceipt(payload, senderPubkey: senderPubkey, convKey: targetPeerID) + case .verifyChallenge, .verifyResponse, .ndrEvent: + break + } + } + } + } else { + SecureLogger.debug("Ignoring non-embedded Nostr DM content", category: .session) + } + } + func findNoiseKey(for nostrPubkey: String) -> Data? { // Check favorites for this Nostr key let favorites = FavoritesPersistenceService.shared.favorites.values @@ -703,13 +746,13 @@ extension ChatViewModel { // Ideally we would use MessageRouter here, but for simplicity in this direct callback: // check if we have an identity if let id = try? idBridge.getCurrentNostrIdentity() { - let nt = NostrTransport(keychain: keychain, idBridge: idBridge) + let nt = NostrTransport(keychain: keychain, idBridge: idBridge, ndrService: ndrService) nt.senderPeerID = meshService.myPeerID nt.sendDeliveryAckGeohash(for: message.id, toRecipientHex: senderPubkey, from: id) } } else if let id = try? idBridge.getCurrentNostrIdentity() { // Fallback: no Noise mapping yet — send directly to sender's Nostr pubkey - let nt = NostrTransport(keychain: keychain, idBridge: idBridge) + let nt = NostrTransport(keychain: keychain, idBridge: idBridge, ndrService: ndrService) nt.senderPeerID = meshService.myPeerID nt.sendDeliveryAckGeohash(for: message.id, toRecipientHex: senderPubkey, from: id) SecureLogger.debug("Sent DELIVERED ack directly to Nostr pub=\(senderPubkey.prefix(8))… for mid=\(message.id.prefix(8))…", category: .session) @@ -719,12 +762,12 @@ extension ChatViewModel { if !wasReadBefore && selectedPrivateChatPeer == message.senderPeerID { if let _ = key { if let id = try? idBridge.getCurrentNostrIdentity() { - let nt = NostrTransport(keychain: keychain, idBridge: idBridge) + let nt = NostrTransport(keychain: keychain, idBridge: idBridge, ndrService: ndrService) nt.senderPeerID = meshService.myPeerID nt.sendReadReceiptGeohash(message.id, toRecipientHex: senderPubkey, from: id) } } else if let id = try? idBridge.getCurrentNostrIdentity() { - let nt = NostrTransport(keychain: keychain, idBridge: idBridge) + let nt = NostrTransport(keychain: keychain, idBridge: idBridge, ndrService: ndrService) nt.senderPeerID = meshService.myPeerID nt.sendReadReceiptGeohash(message.id, toRecipientHex: senderPubkey, from: id) SecureLogger.debug("Viewing chat; sent READ ack directly to Nostr pub=\(senderPubkey.prefix(8))… for mid=\(message.id.prefix(8))…", category: .session) diff --git a/bitchat/ViewModels/Extensions/ChatViewModel+PrivateChat.swift b/bitchat/ViewModels/Extensions/ChatViewModel+PrivateChat.swift index 146c3959..2732efb1 100644 --- a/bitchat/ViewModels/Extensions/ChatViewModel+PrivateChat.swift +++ b/bitchat/ViewModels/Extensions/ChatViewModel+PrivateChat.swift @@ -175,7 +175,7 @@ extension ChatViewModel { return } SecureLogger.debug("GeoDM: local send mid=\(messageID.prefix(8))… to=\(recipientHex.prefix(8))… conv=\(peerID)", category: .session) - let nostrTransport = NostrTransport(keychain: keychain, idBridge: idBridge) + let nostrTransport = NostrTransport(keychain: keychain, idBridge: idBridge, ndrService: ndrService) nostrTransport.senderPeerID = meshService.myPeerID nostrTransport.sendPrivateMessageGeohash(content: content, toRecipientHex: recipientHex, from: id, messageID: messageID) if let msgIdx = privateChats[peerID]?.firstIndex(where: { $0.id == messageID }) { @@ -288,7 +288,7 @@ extension ChatViewModel { func sendDeliveryAckIfNeeded(to messageId: String, senderPubKey: String, from id: NostrIdentity) { guard !sentGeoDeliveryAcks.contains(messageId) else { return } - let nt = NostrTransport(keychain: keychain, idBridge: idBridge) + let nt = NostrTransport(keychain: keychain, idBridge: idBridge, ndrService: ndrService) nt.senderPeerID = meshService.myPeerID nt.sendDeliveryAckGeohash(for: messageId, toRecipientHex: senderPubKey, from: id) sentGeoDeliveryAcks.insert(messageId) @@ -296,7 +296,7 @@ extension ChatViewModel { func sendReadReceiptIfNeeded(to messageId: String, senderPubKey: String, from id: NostrIdentity) { guard !sentReadReceipts.contains(messageId) else { return } - let nt = NostrTransport(keychain: keychain, idBridge: idBridge) + let nt = NostrTransport(keychain: keychain, idBridge: idBridge, ndrService: ndrService) nt.senderPeerID = meshService.myPeerID nt.sendReadReceiptGeohash(messageId, toRecipientHex: senderPubKey, from: id) sentReadReceipts.insert(messageId) @@ -846,7 +846,7 @@ extension ChatViewModel { messageRouter.sendReadReceipt(receipt, to: PeerID(hexData: key)) sentReadReceipts.insert(message.id) } else if let id = try? idBridge.getCurrentNostrIdentity() { - let nt = NostrTransport(keychain: keychain, idBridge: idBridge) + let nt = NostrTransport(keychain: keychain, idBridge: idBridge, ndrService: ndrService) nt.senderPeerID = meshService.myPeerID nt.sendReadReceiptGeohash(message.id, toRecipientHex: senderPubkey, from: id) sentReadReceipts.insert(message.id) diff --git a/bitchatTests/DoubleRatchet/NdrOutOfBandTransportTests.swift b/bitchatTests/DoubleRatchet/NdrOutOfBandTransportTests.swift new file mode 100644 index 00000000..8ebfec51 --- /dev/null +++ b/bitchatTests/DoubleRatchet/NdrOutOfBandTransportTests.swift @@ -0,0 +1,169 @@ +// +// NdrOutOfBandTransportTests.swift +// bitchatTests +// + +import Foundation +import NdrFfi +import Testing +@testable import bitchat + +@MainActor +final class FakeRelayManager: NostrRelayManaging { + struct Subscription { + let id: String + let filter: NostrFilter + } + + private(set) var subscriptions: [Subscription] = [] + private(set) var unsubscribedIDs: [String] = [] + private(set) var sentEvents: [NostrEvent] = [] + + func resetSentEvents() { + sentEvents.removeAll() + } + + func subscribe( + filter: NostrFilter, + id: String, + relayUrls: [String]?, + handler: @escaping (NostrEvent) -> Void, + onEOSE: (() -> Void)? + ) { + subscriptions.append(Subscription(id: id, filter: filter)) + } + + func unsubscribe(id: String) { + unsubscribedIDs.append(id) + } + + func sendEvent(_ event: NostrEvent, to relayUrls: [String]?) { + sentEvents.append(event) + } +} + +struct NdrOutOfBandTransportTests { + + @Test("NdrNostrService does not publish invite/response events to Nostr relays") + @MainActor + func ndrNostrService_doesNotPublishHandshakeEvents() throws { + let relay = FakeRelayManager() + let storage = try makeTempDir(label: "ndr-no-publish") + let identity = try NostrIdentity.generate() + let svc = NdrNostrService( + relayManager: relay, + deviceId: "test-device", + storageDirectoryProvider: { storage } + ) + + svc.configureIfNeeded(identity: identity) + + let inviteJson = try #require(svc.currentInviteEventJson(), "Expected device invite to be cached") + #expect(try extractNostrKind(json: inviteJson) == 30078) + + // Service may publish other maintenance events, but not invites or giftwrap responses. + #expect(!relay.sentEvents.contains(where: { isDoubleRatchetInviteEvent($0) })) + #expect(!relay.sentEvents.contains(where: { $0.kind == 1059 })) + + // Service should not ask relays to subscribe to giftwrap responses (kind 1059) or invite discovery. + #expect(!relay.subscriptions.contains(where: { $0.filter.kinds?.contains(1059) == true })) + #expect(!relay.subscriptions.contains(where: { sub in + (sub.filter.kinds?.contains(30078) == true) && + (sub.filter.tagFilters?["l"]?.contains("double-ratchet/invites") == true) + })) + } + + @Test("Out-of-band invite/response over BLE can establish a session and decrypt kind 1060 messages") + @MainActor + func oobHandshake_establishesSession_andDecrypts() throws { + let aliceRelay = FakeRelayManager() + let bobRelay = FakeRelayManager() + let aliceStorage = try makeTempDir(label: "ndr-alice") + let bobStorage = try makeTempDir(label: "ndr-bob") + + let aliceKeys = generateKeypair() + let bobKeys = generateKeypair() + let aliceIdentity = try NostrIdentity(privateKeyData: try #require(Data(hexString: aliceKeys.privateKeyHex))) + let bobIdentity = try NostrIdentity(privateKeyData: try #require(Data(hexString: bobKeys.privateKeyHex))) + + let aliceSvc = NdrNostrService( + relayManager: aliceRelay, + deviceId: "alice-device", + storageDirectoryProvider: { aliceStorage } + ) + let bobSvc = NdrNostrService( + relayManager: bobRelay, + deviceId: "bob-device", + storageDirectoryProvider: { bobStorage } + ) + + aliceSvc.configureIfNeeded(identity: aliceIdentity) + bobSvc.configureIfNeeded(identity: bobIdentity) + + // Exchange BOTH device invites out-of-band (mutual favorites) and bounce any resulting + // handshake events until both sides are quiescent. + let aliceInvite = try #require(aliceSvc.currentInviteEventJson()) + let bobInvite = try #require(bobSvc.currentInviteEventJson()) + var aToB: [String] = [aliceInvite] + var bToA: [String] = [bobInvite] + var sawResponse1059 = false + for _ in 0..<10 { + let nextBToA = aToB.flatMap { bobSvc.processOutOfBandEventJson($0) } // Bob -> Alice + let nextAToB = bToA.flatMap { aliceSvc.processOutOfBandEventJson($0) } // Alice -> Bob + if nextBToA.contains(where: { (try? extractNostrKind(json: $0)) == 1059 }) { sawResponse1059 = true } + if nextAToB.contains(where: { (try? extractNostrKind(json: $0)) == 1059 }) { sawResponse1059 = true } + aToB = nextAToB + bToA = nextBToA + if aToB.isEmpty && bToA.isEmpty { break } + } + #expect(sawResponse1059) + + #expect(aliceSvc.hasActiveSession(with: bobIdentity.publicKeyHex)) + #expect(bobSvc.hasActiveSession(with: aliceIdentity.publicKeyHex)) + + // Now Alice can send via DR (kind 1060), which is published to Nostr relays. + aliceRelay.resetSentEvents() + #expect(aliceSvc.sendIfPossible("bitchat1:hello", to: bobIdentity.publicKeyHex)) + let outbound = aliceRelay.sentEvents.filter { $0.kind == 1060 } + #expect(!outbound.isEmpty) + + var decryptedInner: NostrEvent? + bobSvc.onDecryptedMessage = { inner in + decryptedInner = inner + } + + for event in outbound { + bobSvc.processInboundRelayEvent(event) + } + + let inner = try #require(decryptedInner, "Expected decrypted inner event to surface from SessionManagerHandle") + #expect(inner.pubkey.lowercased() == aliceIdentity.publicKeyHex.lowercased()) + #expect(inner.content == "bitchat1:hello") + } + + private func makeTempDir(label: String) throws -> URL { + let dir = FileManager.default.temporaryDirectory.appendingPathComponent( + "bitchat-tests-\(label)-\(UUID().uuidString)", + isDirectory: true + ) + try FileManager.default.createDirectory(at: dir, withIntermediateDirectories: true, attributes: nil) + return dir + } + + private func isDoubleRatchetInviteEvent(_ event: NostrEvent) -> Bool { + guard event.kind == 30078 else { return false } + for tag in event.tags where tag.count >= 2 { + if tag[0] == "l", tag[1] == "double-ratchet/invites" { return true } + if tag[0] == "d", tag[1].hasPrefix("double-ratchet/invites/") { return true } + } + return false + } + + private func extractNostrKind(json: String) throws -> Int { + let data = Data(json.utf8) + let obj = try JSONSerialization.jsonObject(with: data, options: []) + let dict = try #require(obj as? [String: Any], "Event should be a JSON object") + return try #require(dict["kind"] as? Int, "Event should have integer kind") + } + +} diff --git a/bitchatTests/Services/NostrTransportTests.swift b/bitchatTests/Services/NostrTransportTests.swift index cb10d7fc..7e85c5f9 100644 --- a/bitchatTests/Services/NostrTransportTests.swift +++ b/bitchatTests/Services/NostrTransportTests.swift @@ -20,6 +20,7 @@ struct NostrTransportTests { func reachabilityCacheWarmsFromFavorites() async throws { let keychain = MockKeychain() let idBridge = NostrIdentityBridge(keychain: keychain) + let ndrService = try makeNdrService(label: "reachability-cache") let recipient = try NostrIdentity.generate() let noiseKey = Data((0..<32).map(UInt8.init)) let fullPeerID = PeerID(hexData: noiseKey) @@ -34,6 +35,7 @@ struct NostrTransportTests { let transport = NostrTransport( keychain: keychain, idBridge: idBridge, + ndrService: ndrService, dependencies: makeDependencies( loadFavorites: { favorites }, favoriteStatusForNoiseKey: { favorites[$0] }, @@ -52,6 +54,7 @@ struct NostrTransportTests { func favoriteStatusNotificationRefreshesReachability() async throws { let keychain = MockKeychain() let idBridge = NostrIdentityBridge(keychain: keychain) + let ndrService = try makeNdrService(label: "favorite-refresh") let recipient = try NostrIdentity.generate() let noiseKey = Data((32..<64).map(UInt8.init)) let peerID = PeerID(hexData: noiseKey).toShort() @@ -61,6 +64,7 @@ struct NostrTransportTests { let transport = NostrTransport( keychain: keychain, idBridge: idBridge, + ndrService: ndrService, dependencies: makeDependencies( notificationCenter: notificationCenter, loadFavorites: { favorites }, @@ -88,6 +92,7 @@ struct NostrTransportTests { func sendPrivateMessageResolvesShortPeerID() async throws { let keychain = MockKeychain() let idBridge = NostrIdentityBridge(keychain: keychain) + let ndrService = try makeNdrService(label: "private-message") let sender = try NostrIdentity.generate() let recipient = try NostrIdentity.generate() let noiseKey = Data((64..<96).map(UInt8.init)) @@ -101,6 +106,7 @@ struct NostrTransportTests { let transport = NostrTransport( keychain: keychain, idBridge: idBridge, + ndrService: ndrService, dependencies: makeDependencies( favoriteStatusForNoiseKey: { _ in nil }, favoriteStatusForPeerID: { $0 == shortPeerID ? relationship : nil }, @@ -128,11 +134,141 @@ struct NostrTransportTests { #expect(probe.pendingGiftWrapIDs.isEmpty) } + @Test("Private message prefers NDR when a session already exists") + @MainActor + func sendPrivateMessagePrefersNdrWhenSessionExists() throws { + let keychain = MockKeychain() + let idBridge = NostrIdentityBridge(keychain: keychain) + let sender = try NostrIdentity.generate() + let recipient = try NostrIdentity.generate() + let senderRelay = FakeRelayManager() + let recipientRelay = FakeRelayManager() + let senderStorage = try makeTempDir(label: "transport-ndr-sender") + let recipientStorage = try makeTempDir(label: "transport-ndr-recipient") + let senderNdr = NdrNostrService( + relayManager: senderRelay, + deviceId: "transport-ndr-sender", + storageDirectoryProvider: { senderStorage } + ) + let recipientNdr = NdrNostrService( + relayManager: recipientRelay, + deviceId: "transport-ndr-recipient", + storageDirectoryProvider: { recipientStorage } + ) + senderNdr.configureIfNeeded(identity: sender) + recipientNdr.configureIfNeeded(identity: recipient) + try establishMutualSession(senderNdr, recipientNdr, senderIdentity: sender, recipientIdentity: recipient) + + let noiseKey = Data((64..<96).map(UInt8.init)) + let fullPeerID = PeerID(hexData: noiseKey) + let relationship = makeRelationship( + peerNoisePublicKey: noiseKey, + peerNostrPublicKey: recipient.npub, + peerNickname: "Carol" + ) + let transport = NostrTransport( + keychain: keychain, + idBridge: idBridge, + ndrService: senderNdr, + dependencies: makeDependencies( + favoriteStatusForNoiseKey: { $0 == noiseKey ? relationship : nil }, + favoriteStatusForPeerID: { _ in nil }, + currentIdentity: { sender } + ) + ) + transport.senderPeerID = PeerID(str: "0123456789abcdef") + + let transportUsed = try transport.sendPrivateMessageAndReturnTransport( + "hello via ndr", + to: fullPeerID, + recipientNickname: "Carol", + messageID: "pm-ndr" + ) + + #expect(transportUsed == .ndr) + #expect(senderRelay.sentEvents.contains(where: { $0.kind == 1060 })) + } + + @Test("Private message stays on NDR when an active session queues before relay publish") + @MainActor + func sendPrivateMessageDoesNotFallBackWhenNdrQueues() throws { + let keychain = MockKeychain() + let idBridge = NostrIdentityBridge(keychain: keychain) + let sender = try NostrIdentity.generate() + let recipient = try NostrIdentity.generate() + let senderRelay = FakeRelayManager() + let recipientRelay = FakeRelayManager() + let senderStorage = try makeTempDir(label: "transport-ndr-queued-sender") + let recipientStorage = try makeTempDir(label: "transport-ndr-queued-recipient") + let senderNdr = NdrNostrService( + relayManager: senderRelay, + deviceId: "transport-ndr-queued-sender", + storageDirectoryProvider: { senderStorage } + ) + let recipientNdr = NdrNostrService( + relayManager: recipientRelay, + deviceId: "transport-ndr-queued-recipient", + storageDirectoryProvider: { recipientStorage } + ) + senderNdr.configureIfNeeded(identity: sender) + recipientNdr.configureIfNeeded(identity: recipient) + + let senderInvite = try #require(senderNdr.currentInviteEventJson()) + let recipientPublishes = recipientNdr.processOutOfBandEventJson(senderInvite) + let recipientResponse = try #require( + recipientPublishes.first(where: { (try? extractNostrKind(json: $0)) == 1059 }), + "Recipient should return a response after processing sender invite" + ) + let recipientBootstrap = try #require( + recipientRelay.sentEvents.first(where: { $0.kind == 1060 }), + "Recipient should publish a bootstrap message event after accepting sender invite" + ) + _ = senderNdr.processOutOfBandEventJson(recipientResponse) + #expect(senderNdr.hasActiveSession(with: recipient.publicKeyHex)) + + senderRelay.resetSentEvents() + let probe = NostrTransportProbe() + let noiseKey = Data((80..<112).map(UInt8.init)) + let fullPeerID = PeerID(hexData: noiseKey) + let relationship = makeRelationship( + peerNoisePublicKey: noiseKey, + peerNostrPublicKey: recipient.npub, + peerNickname: "Queued" + ) + let transport = NostrTransport( + keychain: keychain, + idBridge: idBridge, + ndrService: senderNdr, + dependencies: makeDependencies( + favoriteStatusForNoiseKey: { $0 == noiseKey ? relationship : nil }, + favoriteStatusForPeerID: { _ in nil }, + currentIdentity: { sender }, + sendEvent: probe.record(event:) + ) + ) + transport.senderPeerID = PeerID(str: "0123456789abcdef") + + let transportUsed = try transport.sendPrivateMessageAndReturnTransport( + "queued via ndr", + to: fullPeerID, + recipientNickname: "Queued", + messageID: "pm-ndr-queued" + ) + + #expect(transportUsed == .ndr) + #expect(probe.sentEvents.isEmpty) + #expect(senderRelay.sentEvents.filter { $0.kind == 1060 }.isEmpty) + + senderNdr.processInboundRelayEvent(recipientBootstrap) + #expect(senderRelay.sentEvents.contains(where: { $0.kind == 1060 })) + } + @Test("Favorite notification embeds current npub") @MainActor func sendFavoriteNotificationEmbedsCurrentIdentity() async throws { let keychain = MockKeychain() let idBridge = NostrIdentityBridge(keychain: keychain) + let ndrService = try makeNdrService(label: "favorite-notification") let sender = try NostrIdentity.generate() let recipient = try NostrIdentity.generate() let noiseKey = Data((96..<128).map(UInt8.init)) @@ -146,6 +282,7 @@ struct NostrTransportTests { let transport = NostrTransport( keychain: keychain, idBridge: idBridge, + ndrService: ndrService, dependencies: makeDependencies( favoriteStatusForNoiseKey: { $0 == noiseKey ? relationship : nil }, favoriteStatusForPeerID: { _ in nil }, @@ -174,6 +311,7 @@ struct NostrTransportTests { func sendDeliveryAckEmitsDeliveredAck() async throws { let keychain = MockKeychain() let idBridge = NostrIdentityBridge(keychain: keychain) + let ndrService = try makeNdrService(label: "delivery-ack") let sender = try NostrIdentity.generate() let recipient = try NostrIdentity.generate() let noiseKey = Data((128..<160).map(UInt8.init)) @@ -187,6 +325,7 @@ struct NostrTransportTests { let transport = NostrTransport( keychain: keychain, idBridge: idBridge, + ndrService: ndrService, dependencies: makeDependencies( favoriteStatusForNoiseKey: { $0 == noiseKey ? relationship : nil }, favoriteStatusForPeerID: { _ in nil }, @@ -216,12 +355,14 @@ struct NostrTransportTests { func sendPrivateMessageGeohashRegistersPendingGiftWrap() async throws { let keychain = MockKeychain() let idBridge = NostrIdentityBridge(keychain: keychain) + let ndrService = try makeNdrService(label: "geohash-pm") let sender = try NostrIdentity.generate() let recipient = try NostrIdentity.generate() let probe = NostrTransportProbe() let transport = NostrTransport( keychain: keychain, idBridge: idBridge, + ndrService: ndrService, dependencies: makeDependencies( currentIdentity: { sender }, registerPendingGiftWrap: probe.recordPendingGiftWrap(id:), @@ -257,6 +398,7 @@ struct NostrTransportTests { func readReceiptQueueThrottlesSequentially() async throws { let keychain = MockKeychain() let idBridge = NostrIdentityBridge(keychain: keychain) + let ndrService = try makeNdrService(label: "read-queue") let sender = try NostrIdentity.generate() let recipient = try NostrIdentity.generate() let noiseKey = Data((160..<192).map(UInt8.init)) @@ -270,6 +412,7 @@ struct NostrTransportTests { let transport = NostrTransport( keychain: keychain, idBridge: idBridge, + ndrService: ndrService, dependencies: makeDependencies( favoriteStatusForNoiseKey: { $0 == noiseKey ? relationship : nil }, favoriteStatusForPeerID: { _ in nil }, @@ -313,7 +456,8 @@ struct NostrTransportTests { func concurrentReadReceiptEnqueue() async throws { let keychain = MockKeychain() let idBridge = NostrIdentityBridge(keychain: keychain) - let transport = NostrTransport(keychain: keychain, idBridge: idBridge) + let ndrService = try makeNdrService(label: "concurrent-read") + let transport = NostrTransport(keychain: keychain, idBridge: idBridge, ndrService: ndrService) let iterations = 100 await withTaskGroup(of: Void.self) { group in @@ -336,7 +480,8 @@ struct NostrTransportTests { func isPeerReachableThreadSafety() async throws { let keychain = MockKeychain() let idBridge = NostrIdentityBridge(keychain: keychain) - let transport = NostrTransport(keychain: keychain, idBridge: idBridge) + let ndrService = try makeNdrService(label: "reachable-thread-safety") + let transport = NostrTransport(keychain: keychain, idBridge: idBridge, ndrService: ndrService) let iterations = 100 await withTaskGroup(of: Bool.self) { group in @@ -376,6 +521,16 @@ struct NostrTransportTests { ) } + @MainActor + private func makeNdrService(label: String) throws -> NdrNostrService { + let storage = try makeTempDir(label: label) + return NdrNostrService( + relayManager: FakeRelayManager(), + deviceId: "nostr-transport-\(label)", + storageDirectoryProvider: { storage } + ) + } + private func makeRelationship( peerNoisePublicKey: Data, peerNostrPublicKey: String?, @@ -392,6 +547,42 @@ struct NostrTransportTests { ) } + private func makeTempDir(label: String) throws -> URL { + let dir = FileManager.default.temporaryDirectory.appendingPathComponent( + "bitchat-tests-\(label)-\(UUID().uuidString)", + isDirectory: true + ) + try FileManager.default.createDirectory(at: dir, withIntermediateDirectories: true, attributes: nil) + return dir + } + + @MainActor + private func establishMutualSession( + _ senderService: NdrNostrService, + _ recipientService: NdrNostrService, + senderIdentity: NostrIdentity, + recipientIdentity: NostrIdentity + ) throws { + var toRecipient: [String] = [try #require(senderService.currentInviteEventJson())] + var toSender: [String] = [try #require(recipientService.currentInviteEventJson())] + + for _ in 0..<10 { + let nextToSender = toRecipient.flatMap { recipientService.processOutOfBandEventJson($0) } + let nextToRecipient = toSender.flatMap { senderService.processOutOfBandEventJson($0) } + toRecipient = nextToRecipient + toSender = nextToSender + if senderService.hasActiveSession(with: recipientIdentity.publicKeyHex), + recipientService.hasActiveSession(with: senderIdentity.publicKeyHex) { + return + } + if toRecipient.isEmpty && toSender.isEmpty { + break + } + } + + throw NostrTransportTestError.failedToEstablishNdrSession + } + private func decodeEmbeddedPayload( from event: NostrEvent, recipient: NostrIdentity @@ -419,12 +610,20 @@ struct NostrTransportTests { } return message } + + private func extractNostrKind(json: String) throws -> Int { + let data = Data(json.utf8) + let obj = try JSONSerialization.jsonObject(with: data, options: []) + let dict = try #require(obj as? [String: Any], "Nostr event should be a JSON object") + return try #require(dict["kind"] as? Int, "Nostr event should include kind") + } } private enum NostrTransportTestError: Error { case invalidEmbeddedContent case invalidPacket case invalidPrivateMessage + case failedToEstablishNdrSession } private func base64URLDecode(_ string: String) -> Data? { diff --git a/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/Info.plist b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/Info.plist new file mode 100644 index 00000000..4de80ab3 --- /dev/null +++ b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/Info.plist @@ -0,0 +1,65 @@ + + + + + AvailableLibraries + + + BinaryPath + libndr_ffi.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libndr_ffi.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libndr_ffi_sim.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libndr_ffi_sim.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libndr_ffi_macos.a + HeadersPath + Headers + LibraryIdentifier + macos-arm64_x86_64 + LibraryPath + libndr_ffi_macos.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + macos + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/ios-arm64/Headers/module.modulemap b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/ios-arm64/Headers/module.modulemap new file mode 100644 index 00000000..94108e3e --- /dev/null +++ b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/ios-arm64/Headers/module.modulemap @@ -0,0 +1,4 @@ +module ndr_ffiFFI { + header "ndr_ffiFFI.h" + export * +} diff --git a/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/ios-arm64/Headers/ndr_ffiFFI.h b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/ios-arm64/Headers/ndr_ffiFFI.h new file mode 100644 index 00000000..4bc334b4 --- /dev/null +++ b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/ios-arm64/Headers/ndr_ffiFFI.h @@ -0,0 +1,1243 @@ +// This file was autogenerated by some hot garbage in the `uniffi` crate. +// Trust me, you don't want to mess with it! + +#pragma once + +#include +#include +#include + +// The following structs are used to implement the lowest level +// of the FFI, and thus useful to multiple uniffied crates. +// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H. +#ifdef UNIFFI_SHARED_H + // We also try to prevent mixing versions of shared uniffi header structs. + // If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V4 + #ifndef UNIFFI_SHARED_HEADER_V4 + #error Combining helper code from multiple versions of uniffi is not supported + #endif // ndef UNIFFI_SHARED_HEADER_V4 +#else +#define UNIFFI_SHARED_H +#define UNIFFI_SHARED_HEADER_V4 +// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ +// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ + +typedef struct RustBuffer +{ + uint64_t capacity; + uint64_t len; + uint8_t *_Nullable data; +} RustBuffer; + +typedef struct ForeignBytes +{ + int32_t len; + const uint8_t *_Nullable data; +} ForeignBytes; + +// Error definitions +typedef struct RustCallStatus { + int8_t code; + RustBuffer errorBuf; +} RustCallStatus; + +// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ +// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ +#endif // def UNIFFI_SHARED_H +#ifndef UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK +#define UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK +typedef void (*UniffiRustFutureContinuationCallback)(uint64_t, int8_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_FREE +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_FREE +typedef void (*UniffiForeignFutureFree)(uint64_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE +typedef void (*UniffiCallbackInterfaceFree)(uint64_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE +#define UNIFFI_FFIDEF_FOREIGN_FUTURE +typedef struct UniffiForeignFuture { + uint64_t handle; + UniffiForeignFutureFree _Nonnull free; +} UniffiForeignFuture; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U8 +typedef struct UniffiForeignFutureStructU8 { + uint8_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructU8; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8 +typedef void (*UniffiForeignFutureCompleteU8)(uint64_t, UniffiForeignFutureStructU8 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I8 +typedef struct UniffiForeignFutureStructI8 { + int8_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructI8; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8 +typedef void (*UniffiForeignFutureCompleteI8)(uint64_t, UniffiForeignFutureStructI8 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U16 +typedef struct UniffiForeignFutureStructU16 { + uint16_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructU16; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16 +typedef void (*UniffiForeignFutureCompleteU16)(uint64_t, UniffiForeignFutureStructU16 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I16 +typedef struct UniffiForeignFutureStructI16 { + int16_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructI16; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16 +typedef void (*UniffiForeignFutureCompleteI16)(uint64_t, UniffiForeignFutureStructI16 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U32 +typedef struct UniffiForeignFutureStructU32 { + uint32_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructU32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32 +typedef void (*UniffiForeignFutureCompleteU32)(uint64_t, UniffiForeignFutureStructU32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I32 +typedef struct UniffiForeignFutureStructI32 { + int32_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructI32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32 +typedef void (*UniffiForeignFutureCompleteI32)(uint64_t, UniffiForeignFutureStructI32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U64 +typedef struct UniffiForeignFutureStructU64 { + uint64_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructU64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64 +typedef void (*UniffiForeignFutureCompleteU64)(uint64_t, UniffiForeignFutureStructU64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I64 +typedef struct UniffiForeignFutureStructI64 { + int64_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructI64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64 +typedef void (*UniffiForeignFutureCompleteI64)(uint64_t, UniffiForeignFutureStructI64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F32 +typedef struct UniffiForeignFutureStructF32 { + float returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructF32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32 +typedef void (*UniffiForeignFutureCompleteF32)(uint64_t, UniffiForeignFutureStructF32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F64 +typedef struct UniffiForeignFutureStructF64 { + double returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructF64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64 +typedef void (*UniffiForeignFutureCompleteF64)(uint64_t, UniffiForeignFutureStructF64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_POINTER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_POINTER +typedef struct UniffiForeignFutureStructPointer { + void*_Nonnull returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructPointer; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_POINTER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_POINTER +typedef void (*UniffiForeignFutureCompletePointer)(uint64_t, UniffiForeignFutureStructPointer + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_RUST_BUFFER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_RUST_BUFFER +typedef struct UniffiForeignFutureStructRustBuffer { + RustBuffer returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructRustBuffer; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER +typedef void (*UniffiForeignFutureCompleteRustBuffer)(uint64_t, UniffiForeignFutureStructRustBuffer + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_VOID +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_VOID +typedef struct UniffiForeignFutureStructVoid { + RustCallStatus callStatus; +} UniffiForeignFutureStructVoid; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID +typedef void (*UniffiForeignFutureCompleteVoid)(uint64_t, UniffiForeignFutureStructVoid + ); + +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CLONE_INVITEHANDLE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CLONE_INVITEHANDLE +void*_Nonnull uniffi_ndr_ffi_fn_clone_invitehandle(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FREE_INVITEHANDLE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FREE_INVITEHANDLE +void uniffi_ndr_ffi_fn_free_invitehandle(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_CREATE_NEW +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_CREATE_NEW +void*_Nonnull uniffi_ndr_ffi_fn_constructor_invitehandle_create_new(RustBuffer inviter_pubkey_hex, RustBuffer device_id, RustBuffer max_uses, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_DESERIALIZE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_DESERIALIZE +void*_Nonnull uniffi_ndr_ffi_fn_constructor_invitehandle_deserialize(RustBuffer json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_FROM_EVENT_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_FROM_EVENT_JSON +void*_Nonnull uniffi_ndr_ffi_fn_constructor_invitehandle_from_event_json(RustBuffer event_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_FROM_URL +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_FROM_URL +void*_Nonnull uniffi_ndr_ffi_fn_constructor_invitehandle_from_url(RustBuffer url, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_ACCEPT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_ACCEPT +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_accept(void*_Nonnull ptr, RustBuffer invitee_pubkey_hex, RustBuffer invitee_privkey_hex, RustBuffer device_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_ACCEPT_WITH_OWNER +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_ACCEPT_WITH_OWNER +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_accept_with_owner(void*_Nonnull ptr, RustBuffer invitee_pubkey_hex, RustBuffer invitee_privkey_hex, RustBuffer device_id, RustBuffer owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_GET_INVITER_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_GET_INVITER_PUBKEY_HEX +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_get_inviter_pubkey_hex(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_GET_SHARED_SECRET_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_GET_SHARED_SECRET_HEX +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_get_shared_secret_hex(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_PROCESS_RESPONSE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_PROCESS_RESPONSE +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_process_response(void*_Nonnull ptr, RustBuffer event_json, RustBuffer inviter_privkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_SERIALIZE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_SERIALIZE +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_serialize(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_SET_OWNER_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_SET_OWNER_PUBKEY_HEX +void uniffi_ndr_ffi_fn_method_invitehandle_set_owner_pubkey_hex(void*_Nonnull ptr, RustBuffer owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_SET_PURPOSE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_SET_PURPOSE +void uniffi_ndr_ffi_fn_method_invitehandle_set_purpose(void*_Nonnull ptr, RustBuffer purpose, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_TO_EVENT_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_TO_EVENT_JSON +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_to_event_json(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_TO_URL +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_TO_URL +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_to_url(void*_Nonnull ptr, RustBuffer root, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CLONE_SESSIONHANDLE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CLONE_SESSIONHANDLE +void*_Nonnull uniffi_ndr_ffi_fn_clone_sessionhandle(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FREE_SESSIONHANDLE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FREE_SESSIONHANDLE +void uniffi_ndr_ffi_fn_free_sessionhandle(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONHANDLE_FROM_STATE_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONHANDLE_FROM_STATE_JSON +void*_Nonnull uniffi_ndr_ffi_fn_constructor_sessionhandle_from_state_json(RustBuffer state_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONHANDLE_INIT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONHANDLE_INIT +void*_Nonnull uniffi_ndr_ffi_fn_constructor_sessionhandle_init(RustBuffer their_ephemeral_pubkey_hex, RustBuffer our_ephemeral_privkey_hex, int8_t is_initiator, RustBuffer shared_secret_hex, RustBuffer name, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_CAN_SEND +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_CAN_SEND +int8_t uniffi_ndr_ffi_fn_method_sessionhandle_can_send(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_DECRYPT_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_DECRYPT_EVENT +RustBuffer uniffi_ndr_ffi_fn_method_sessionhandle_decrypt_event(void*_Nonnull ptr, RustBuffer outer_event_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_IS_DR_MESSAGE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_IS_DR_MESSAGE +int8_t uniffi_ndr_ffi_fn_method_sessionhandle_is_dr_message(void*_Nonnull ptr, RustBuffer event_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_SEND_TEXT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_SEND_TEXT +RustBuffer uniffi_ndr_ffi_fn_method_sessionhandle_send_text(void*_Nonnull ptr, RustBuffer text, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_STATE_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_STATE_JSON +RustBuffer uniffi_ndr_ffi_fn_method_sessionhandle_state_json(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CLONE_SESSIONMANAGERHANDLE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CLONE_SESSIONMANAGERHANDLE +void*_Nonnull uniffi_ndr_ffi_fn_clone_sessionmanagerhandle(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FREE_SESSIONMANAGERHANDLE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FREE_SESSIONMANAGERHANDLE +void uniffi_ndr_ffi_fn_free_sessionmanagerhandle(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW +void*_Nonnull uniffi_ndr_ffi_fn_constructor_sessionmanagerhandle_new(RustBuffer our_pubkey_hex, RustBuffer our_identity_privkey_hex, RustBuffer device_id, RustBuffer owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW_WITH_STORAGE_PATH +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW_WITH_STORAGE_PATH +void*_Nonnull uniffi_ndr_ffi_fn_constructor_sessionmanagerhandle_new_with_storage_path(RustBuffer our_pubkey_hex, RustBuffer our_identity_privkey_hex, RustBuffer device_id, RustBuffer storage_path, RustBuffer owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_EVENT_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_EVENT_JSON +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_accept_invite_from_event_json(void*_Nonnull ptr, RustBuffer event_json, RustBuffer owner_pubkey_hint_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_URL +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_URL +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_accept_invite_from_url(void*_Nonnull ptr, RustBuffer invite_url, RustBuffer owner_pubkey_hint_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_DRAIN_EVENTS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_DRAIN_EVENTS +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_drain_events(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_ACTIVE_SESSION_STATE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_ACTIVE_SESSION_STATE +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_active_session_state(void*_Nonnull ptr, RustBuffer peer_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_DEVICE_ID +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_DEVICE_ID +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_device_id(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_AUTHOR_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_AUTHOR_PUBKEYS +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_message_push_author_pubkeys(void*_Nonnull ptr, RustBuffer peer_owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_SESSION_STATES +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_SESSION_STATES +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_message_push_session_states(void*_Nonnull ptr, RustBuffer peer_owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_OUR_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_OUR_PUBKEY_HEX +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_our_pubkey_hex(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_OWNER_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_OWNER_PUBKEY_HEX +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_owner_pubkey_hex(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_STORED_USER_RECORD_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_STORED_USER_RECORD_JSON +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_stored_user_record_json(void*_Nonnull ptr, RustBuffer peer_owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_TOTAL_SESSIONS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_TOTAL_SESSIONS +uint64_t uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_total_sessions(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_CREATE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_CREATE +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_create(void*_Nonnull ptr, RustBuffer name, RustBuffer member_owner_pubkeys, RustBuffer fanout_metadata, RustBuffer now_ms, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_INCOMING_SESSION_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_INCOMING_SESSION_EVENT +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_handle_incoming_session_event(void*_Nonnull ptr, RustBuffer event_json, RustBuffer from_owner_pubkey_hex, RustBuffer from_sender_device_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_OUTER_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_OUTER_EVENT +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_handle_outer_event(void*_Nonnull ptr, RustBuffer event_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_KNOWN_SENDER_EVENT_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_KNOWN_SENDER_EVENT_PUBKEYS +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_known_sender_event_pubkeys(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_OUTER_SUBSCRIPTION_PLAN +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_OUTER_SUBSCRIPTION_PLAN +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_outer_subscription_plan(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_REMOVE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_REMOVE +void uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_remove(void*_Nonnull ptr, RustBuffer group_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_SEND_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_SEND_EVENT +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_send_event(void*_Nonnull ptr, RustBuffer group_id, uint32_t kind, RustBuffer content, RustBuffer tags_json, RustBuffer now_ms, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_UPSERT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_UPSERT +void uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_upsert(void*_Nonnull ptr, RustBuffer group, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_IMPORT_SESSION_STATE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_IMPORT_SESSION_STATE +void uniffi_ndr_ffi_fn_method_sessionmanagerhandle_import_session_state(void*_Nonnull ptr, RustBuffer peer_pubkey_hex, RustBuffer state_json, RustBuffer device_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_INIT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_INIT +void uniffi_ndr_ffi_fn_method_sessionmanagerhandle_init(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_KNOWN_PEER_OWNER_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_KNOWN_PEER_OWNER_PUBKEYS +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_known_peer_owner_pubkeys(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_PROCESS_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_PROCESS_EVENT +void uniffi_ndr_ffi_fn_method_sessionmanagerhandle_process_event(void*_Nonnull ptr, RustBuffer event_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_EVENT_WITH_INNER_ID +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_EVENT_WITH_INNER_ID +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_event_with_inner_id(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, uint32_t kind, RustBuffer content, RustBuffer tags_json, RustBuffer created_at_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_REACTION +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_REACTION +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_reaction(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, RustBuffer message_id, RustBuffer emoji, RustBuffer expires_at_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_RECEIPT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_RECEIPT +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_receipt(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, RustBuffer receipt_type, RustBuffer message_ids, RustBuffer expires_at_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_RUMOR_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_RUMOR_JSON +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_rumor_json(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, RustBuffer rumor_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_text(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, RustBuffer text, RustBuffer expires_at_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT_WITH_INNER_ID +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT_WITH_INNER_ID +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_text_with_inner_id(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, RustBuffer text, RustBuffer expires_at_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_TYPING +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_TYPING +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_typing(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, RustBuffer expires_at_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SETUP_USER +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SETUP_USER +void uniffi_ndr_ffi_fn_method_sessionmanagerhandle_setup_user(void*_Nonnull ptr, RustBuffer user_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_CREATE_SIGNED_APP_KEYS_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_CREATE_SIGNED_APP_KEYS_EVENT +RustBuffer uniffi_ndr_ffi_fn_func_create_signed_app_keys_event(RustBuffer owner_pubkey_hex, RustBuffer owner_privkey_hex, RustBuffer devices, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_DERIVE_PUBLIC_KEY +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_DERIVE_PUBLIC_KEY +RustBuffer uniffi_ndr_ffi_fn_func_derive_public_key(RustBuffer privkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_GENERATE_KEYPAIR +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_GENERATE_KEYPAIR +RustBuffer uniffi_ndr_ffi_fn_func_generate_keypair(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_PARSE_APP_KEYS_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_PARSE_APP_KEYS_EVENT +RustBuffer uniffi_ndr_ffi_fn_func_parse_app_keys_event(RustBuffer event_json, RustBuffer owner_privkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_RESOLVE_CONVERSATION_CANDIDATE_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_RESOLVE_CONVERSATION_CANDIDATE_PUBKEYS +RustBuffer uniffi_ndr_ffi_fn_func_resolve_conversation_candidate_pubkeys(RustBuffer owner_pubkey_hex, RustBuffer rumor_pubkey_hex, RustBuffer rumor_tags, RustBuffer sender_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_RESOLVE_LATEST_APP_KEYS_DEVICES +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_RESOLVE_LATEST_APP_KEYS_DEVICES +RustBuffer uniffi_ndr_ffi_fn_func_resolve_latest_app_keys_devices(RustBuffer event_jsons, RustBuffer owner_privkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_VERSION +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_VERSION +RustBuffer uniffi_ndr_ffi_fn_func_version(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_ALLOC +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_ALLOC +RustBuffer ffi_ndr_ffi_rustbuffer_alloc(uint64_t size, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_FROM_BYTES +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_FROM_BYTES +RustBuffer ffi_ndr_ffi_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_FREE +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_FREE +void ffi_ndr_ffi_rustbuffer_free(RustBuffer buf, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_RESERVE +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_RESERVE +RustBuffer ffi_ndr_ffi_rustbuffer_reserve(RustBuffer buf, uint64_t additional, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U8 +void ffi_ndr_ffi_rust_future_poll_u8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U8 +void ffi_ndr_ffi_rust_future_cancel_u8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U8 +void ffi_ndr_ffi_rust_future_free_u8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U8 +uint8_t ffi_ndr_ffi_rust_future_complete_u8(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I8 +void ffi_ndr_ffi_rust_future_poll_i8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I8 +void ffi_ndr_ffi_rust_future_cancel_i8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I8 +void ffi_ndr_ffi_rust_future_free_i8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I8 +int8_t ffi_ndr_ffi_rust_future_complete_i8(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U16 +void ffi_ndr_ffi_rust_future_poll_u16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U16 +void ffi_ndr_ffi_rust_future_cancel_u16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U16 +void ffi_ndr_ffi_rust_future_free_u16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U16 +uint16_t ffi_ndr_ffi_rust_future_complete_u16(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I16 +void ffi_ndr_ffi_rust_future_poll_i16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I16 +void ffi_ndr_ffi_rust_future_cancel_i16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I16 +void ffi_ndr_ffi_rust_future_free_i16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I16 +int16_t ffi_ndr_ffi_rust_future_complete_i16(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U32 +void ffi_ndr_ffi_rust_future_poll_u32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U32 +void ffi_ndr_ffi_rust_future_cancel_u32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U32 +void ffi_ndr_ffi_rust_future_free_u32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U32 +uint32_t ffi_ndr_ffi_rust_future_complete_u32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I32 +void ffi_ndr_ffi_rust_future_poll_i32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I32 +void ffi_ndr_ffi_rust_future_cancel_i32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I32 +void ffi_ndr_ffi_rust_future_free_i32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I32 +int32_t ffi_ndr_ffi_rust_future_complete_i32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U64 +void ffi_ndr_ffi_rust_future_poll_u64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U64 +void ffi_ndr_ffi_rust_future_cancel_u64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U64 +void ffi_ndr_ffi_rust_future_free_u64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U64 +uint64_t ffi_ndr_ffi_rust_future_complete_u64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I64 +void ffi_ndr_ffi_rust_future_poll_i64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I64 +void ffi_ndr_ffi_rust_future_cancel_i64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I64 +void ffi_ndr_ffi_rust_future_free_i64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I64 +int64_t ffi_ndr_ffi_rust_future_complete_i64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_F32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_F32 +void ffi_ndr_ffi_rust_future_poll_f32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_F32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_F32 +void ffi_ndr_ffi_rust_future_cancel_f32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_F32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_F32 +void ffi_ndr_ffi_rust_future_free_f32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_F32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_F32 +float ffi_ndr_ffi_rust_future_complete_f32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_F64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_F64 +void ffi_ndr_ffi_rust_future_poll_f64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_F64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_F64 +void ffi_ndr_ffi_rust_future_cancel_f64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_F64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_F64 +void ffi_ndr_ffi_rust_future_free_f64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_F64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_F64 +double ffi_ndr_ffi_rust_future_complete_f64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_POINTER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_POINTER +void ffi_ndr_ffi_rust_future_poll_pointer(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_POINTER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_POINTER +void ffi_ndr_ffi_rust_future_cancel_pointer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_POINTER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_POINTER +void ffi_ndr_ffi_rust_future_free_pointer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_POINTER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_POINTER +void*_Nonnull ffi_ndr_ffi_rust_future_complete_pointer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_RUST_BUFFER +void ffi_ndr_ffi_rust_future_poll_rust_buffer(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_RUST_BUFFER +void ffi_ndr_ffi_rust_future_cancel_rust_buffer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_RUST_BUFFER +void ffi_ndr_ffi_rust_future_free_rust_buffer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_RUST_BUFFER +RustBuffer ffi_ndr_ffi_rust_future_complete_rust_buffer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_VOID +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_VOID +void ffi_ndr_ffi_rust_future_poll_void(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_VOID +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_VOID +void ffi_ndr_ffi_rust_future_cancel_void(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_VOID +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_VOID +void ffi_ndr_ffi_rust_future_free_void(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_VOID +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_VOID +void ffi_ndr_ffi_rust_future_complete_void(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_CREATE_SIGNED_APP_KEYS_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_CREATE_SIGNED_APP_KEYS_EVENT +uint16_t uniffi_ndr_ffi_checksum_func_create_signed_app_keys_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_DERIVE_PUBLIC_KEY +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_DERIVE_PUBLIC_KEY +uint16_t uniffi_ndr_ffi_checksum_func_derive_public_key(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_GENERATE_KEYPAIR +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_GENERATE_KEYPAIR +uint16_t uniffi_ndr_ffi_checksum_func_generate_keypair(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_PARSE_APP_KEYS_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_PARSE_APP_KEYS_EVENT +uint16_t uniffi_ndr_ffi_checksum_func_parse_app_keys_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_RESOLVE_CONVERSATION_CANDIDATE_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_RESOLVE_CONVERSATION_CANDIDATE_PUBKEYS +uint16_t uniffi_ndr_ffi_checksum_func_resolve_conversation_candidate_pubkeys(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_RESOLVE_LATEST_APP_KEYS_DEVICES +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_RESOLVE_LATEST_APP_KEYS_DEVICES +uint16_t uniffi_ndr_ffi_checksum_func_resolve_latest_app_keys_devices(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_VERSION +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_VERSION +uint16_t uniffi_ndr_ffi_checksum_func_version(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_ACCEPT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_ACCEPT +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_accept(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_ACCEPT_WITH_OWNER +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_ACCEPT_WITH_OWNER +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_accept_with_owner(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_GET_INVITER_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_GET_INVITER_PUBKEY_HEX +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_get_inviter_pubkey_hex(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_GET_SHARED_SECRET_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_GET_SHARED_SECRET_HEX +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_get_shared_secret_hex(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_PROCESS_RESPONSE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_PROCESS_RESPONSE +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_process_response(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_SERIALIZE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_SERIALIZE +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_serialize(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_SET_OWNER_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_SET_OWNER_PUBKEY_HEX +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_set_owner_pubkey_hex(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_SET_PURPOSE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_SET_PURPOSE +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_set_purpose(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_TO_EVENT_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_TO_EVENT_JSON +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_to_event_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_TO_URL +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_TO_URL +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_to_url(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_CAN_SEND +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_CAN_SEND +uint16_t uniffi_ndr_ffi_checksum_method_sessionhandle_can_send(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_DECRYPT_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_DECRYPT_EVENT +uint16_t uniffi_ndr_ffi_checksum_method_sessionhandle_decrypt_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_IS_DR_MESSAGE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_IS_DR_MESSAGE +uint16_t uniffi_ndr_ffi_checksum_method_sessionhandle_is_dr_message(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_SEND_TEXT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_SEND_TEXT +uint16_t uniffi_ndr_ffi_checksum_method_sessionhandle_send_text(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_STATE_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_STATE_JSON +uint16_t uniffi_ndr_ffi_checksum_method_sessionhandle_state_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_EVENT_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_EVENT_JSON +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_accept_invite_from_event_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_URL +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_URL +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_accept_invite_from_url(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_DRAIN_EVENTS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_DRAIN_EVENTS +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_drain_events(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_ACTIVE_SESSION_STATE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_ACTIVE_SESSION_STATE +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_active_session_state(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_DEVICE_ID +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_DEVICE_ID +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_device_id(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_AUTHOR_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_AUTHOR_PUBKEYS +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_message_push_author_pubkeys(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_SESSION_STATES +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_SESSION_STATES +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_message_push_session_states(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_OUR_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_OUR_PUBKEY_HEX +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_our_pubkey_hex(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_OWNER_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_OWNER_PUBKEY_HEX +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_owner_pubkey_hex(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_STORED_USER_RECORD_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_STORED_USER_RECORD_JSON +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_stored_user_record_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_TOTAL_SESSIONS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_TOTAL_SESSIONS +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_total_sessions(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_CREATE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_CREATE +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_create(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_INCOMING_SESSION_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_INCOMING_SESSION_EVENT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_handle_incoming_session_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_OUTER_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_OUTER_EVENT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_handle_outer_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_KNOWN_SENDER_EVENT_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_KNOWN_SENDER_EVENT_PUBKEYS +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_known_sender_event_pubkeys(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_OUTER_SUBSCRIPTION_PLAN +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_OUTER_SUBSCRIPTION_PLAN +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_outer_subscription_plan(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_REMOVE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_REMOVE +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_remove(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_SEND_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_SEND_EVENT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_send_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_UPSERT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_UPSERT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_upsert(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_IMPORT_SESSION_STATE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_IMPORT_SESSION_STATE +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_import_session_state(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_INIT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_INIT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_init(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_KNOWN_PEER_OWNER_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_KNOWN_PEER_OWNER_PUBKEYS +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_known_peer_owner_pubkeys(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_PROCESS_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_PROCESS_EVENT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_process_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_EVENT_WITH_INNER_ID +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_EVENT_WITH_INNER_ID +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_event_with_inner_id(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_REACTION +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_REACTION +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_reaction(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_RECEIPT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_RECEIPT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_receipt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_RUMOR_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_RUMOR_JSON +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_rumor_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_text(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT_WITH_INNER_ID +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT_WITH_INNER_ID +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_text_with_inner_id(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_TYPING +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_TYPING +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_typing(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SETUP_USER +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SETUP_USER +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_setup_user(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_CREATE_NEW +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_CREATE_NEW +uint16_t uniffi_ndr_ffi_checksum_constructor_invitehandle_create_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_DESERIALIZE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_DESERIALIZE +uint16_t uniffi_ndr_ffi_checksum_constructor_invitehandle_deserialize(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_FROM_EVENT_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_FROM_EVENT_JSON +uint16_t uniffi_ndr_ffi_checksum_constructor_invitehandle_from_event_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_FROM_URL +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_FROM_URL +uint16_t uniffi_ndr_ffi_checksum_constructor_invitehandle_from_url(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONHANDLE_FROM_STATE_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONHANDLE_FROM_STATE_JSON +uint16_t uniffi_ndr_ffi_checksum_constructor_sessionhandle_from_state_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONHANDLE_INIT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONHANDLE_INIT +uint16_t uniffi_ndr_ffi_checksum_constructor_sessionhandle_init(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW +uint16_t uniffi_ndr_ffi_checksum_constructor_sessionmanagerhandle_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW_WITH_STORAGE_PATH +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW_WITH_STORAGE_PATH +uint16_t uniffi_ndr_ffi_checksum_constructor_sessionmanagerhandle_new_with_storage_path(void + +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_UNIFFI_CONTRACT_VERSION +#define UNIFFI_FFIDEF_FFI_NDR_FFI_UNIFFI_CONTRACT_VERSION +uint32_t ffi_ndr_ffi_uniffi_contract_version(void + +); +#endif + diff --git a/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/ios-arm64/libndr_ffi.a b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/ios-arm64/libndr_ffi.a new file mode 100644 index 00000000..07ed8a03 Binary files /dev/null and b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/ios-arm64/libndr_ffi.a differ diff --git a/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/ios-arm64_x86_64-simulator/Headers/module.modulemap b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/ios-arm64_x86_64-simulator/Headers/module.modulemap new file mode 100644 index 00000000..94108e3e --- /dev/null +++ b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/ios-arm64_x86_64-simulator/Headers/module.modulemap @@ -0,0 +1,4 @@ +module ndr_ffiFFI { + header "ndr_ffiFFI.h" + export * +} diff --git a/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/ios-arm64_x86_64-simulator/Headers/ndr_ffiFFI.h b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/ios-arm64_x86_64-simulator/Headers/ndr_ffiFFI.h new file mode 100644 index 00000000..4bc334b4 --- /dev/null +++ b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/ios-arm64_x86_64-simulator/Headers/ndr_ffiFFI.h @@ -0,0 +1,1243 @@ +// This file was autogenerated by some hot garbage in the `uniffi` crate. +// Trust me, you don't want to mess with it! + +#pragma once + +#include +#include +#include + +// The following structs are used to implement the lowest level +// of the FFI, and thus useful to multiple uniffied crates. +// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H. +#ifdef UNIFFI_SHARED_H + // We also try to prevent mixing versions of shared uniffi header structs. + // If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V4 + #ifndef UNIFFI_SHARED_HEADER_V4 + #error Combining helper code from multiple versions of uniffi is not supported + #endif // ndef UNIFFI_SHARED_HEADER_V4 +#else +#define UNIFFI_SHARED_H +#define UNIFFI_SHARED_HEADER_V4 +// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ +// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ + +typedef struct RustBuffer +{ + uint64_t capacity; + uint64_t len; + uint8_t *_Nullable data; +} RustBuffer; + +typedef struct ForeignBytes +{ + int32_t len; + const uint8_t *_Nullable data; +} ForeignBytes; + +// Error definitions +typedef struct RustCallStatus { + int8_t code; + RustBuffer errorBuf; +} RustCallStatus; + +// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ +// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ +#endif // def UNIFFI_SHARED_H +#ifndef UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK +#define UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK +typedef void (*UniffiRustFutureContinuationCallback)(uint64_t, int8_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_FREE +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_FREE +typedef void (*UniffiForeignFutureFree)(uint64_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE +typedef void (*UniffiCallbackInterfaceFree)(uint64_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE +#define UNIFFI_FFIDEF_FOREIGN_FUTURE +typedef struct UniffiForeignFuture { + uint64_t handle; + UniffiForeignFutureFree _Nonnull free; +} UniffiForeignFuture; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U8 +typedef struct UniffiForeignFutureStructU8 { + uint8_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructU8; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8 +typedef void (*UniffiForeignFutureCompleteU8)(uint64_t, UniffiForeignFutureStructU8 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I8 +typedef struct UniffiForeignFutureStructI8 { + int8_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructI8; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8 +typedef void (*UniffiForeignFutureCompleteI8)(uint64_t, UniffiForeignFutureStructI8 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U16 +typedef struct UniffiForeignFutureStructU16 { + uint16_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructU16; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16 +typedef void (*UniffiForeignFutureCompleteU16)(uint64_t, UniffiForeignFutureStructU16 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I16 +typedef struct UniffiForeignFutureStructI16 { + int16_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructI16; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16 +typedef void (*UniffiForeignFutureCompleteI16)(uint64_t, UniffiForeignFutureStructI16 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U32 +typedef struct UniffiForeignFutureStructU32 { + uint32_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructU32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32 +typedef void (*UniffiForeignFutureCompleteU32)(uint64_t, UniffiForeignFutureStructU32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I32 +typedef struct UniffiForeignFutureStructI32 { + int32_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructI32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32 +typedef void (*UniffiForeignFutureCompleteI32)(uint64_t, UniffiForeignFutureStructI32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U64 +typedef struct UniffiForeignFutureStructU64 { + uint64_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructU64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64 +typedef void (*UniffiForeignFutureCompleteU64)(uint64_t, UniffiForeignFutureStructU64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I64 +typedef struct UniffiForeignFutureStructI64 { + int64_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructI64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64 +typedef void (*UniffiForeignFutureCompleteI64)(uint64_t, UniffiForeignFutureStructI64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F32 +typedef struct UniffiForeignFutureStructF32 { + float returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructF32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32 +typedef void (*UniffiForeignFutureCompleteF32)(uint64_t, UniffiForeignFutureStructF32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F64 +typedef struct UniffiForeignFutureStructF64 { + double returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructF64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64 +typedef void (*UniffiForeignFutureCompleteF64)(uint64_t, UniffiForeignFutureStructF64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_POINTER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_POINTER +typedef struct UniffiForeignFutureStructPointer { + void*_Nonnull returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructPointer; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_POINTER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_POINTER +typedef void (*UniffiForeignFutureCompletePointer)(uint64_t, UniffiForeignFutureStructPointer + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_RUST_BUFFER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_RUST_BUFFER +typedef struct UniffiForeignFutureStructRustBuffer { + RustBuffer returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructRustBuffer; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER +typedef void (*UniffiForeignFutureCompleteRustBuffer)(uint64_t, UniffiForeignFutureStructRustBuffer + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_VOID +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_VOID +typedef struct UniffiForeignFutureStructVoid { + RustCallStatus callStatus; +} UniffiForeignFutureStructVoid; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID +typedef void (*UniffiForeignFutureCompleteVoid)(uint64_t, UniffiForeignFutureStructVoid + ); + +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CLONE_INVITEHANDLE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CLONE_INVITEHANDLE +void*_Nonnull uniffi_ndr_ffi_fn_clone_invitehandle(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FREE_INVITEHANDLE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FREE_INVITEHANDLE +void uniffi_ndr_ffi_fn_free_invitehandle(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_CREATE_NEW +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_CREATE_NEW +void*_Nonnull uniffi_ndr_ffi_fn_constructor_invitehandle_create_new(RustBuffer inviter_pubkey_hex, RustBuffer device_id, RustBuffer max_uses, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_DESERIALIZE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_DESERIALIZE +void*_Nonnull uniffi_ndr_ffi_fn_constructor_invitehandle_deserialize(RustBuffer json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_FROM_EVENT_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_FROM_EVENT_JSON +void*_Nonnull uniffi_ndr_ffi_fn_constructor_invitehandle_from_event_json(RustBuffer event_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_FROM_URL +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_FROM_URL +void*_Nonnull uniffi_ndr_ffi_fn_constructor_invitehandle_from_url(RustBuffer url, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_ACCEPT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_ACCEPT +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_accept(void*_Nonnull ptr, RustBuffer invitee_pubkey_hex, RustBuffer invitee_privkey_hex, RustBuffer device_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_ACCEPT_WITH_OWNER +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_ACCEPT_WITH_OWNER +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_accept_with_owner(void*_Nonnull ptr, RustBuffer invitee_pubkey_hex, RustBuffer invitee_privkey_hex, RustBuffer device_id, RustBuffer owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_GET_INVITER_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_GET_INVITER_PUBKEY_HEX +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_get_inviter_pubkey_hex(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_GET_SHARED_SECRET_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_GET_SHARED_SECRET_HEX +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_get_shared_secret_hex(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_PROCESS_RESPONSE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_PROCESS_RESPONSE +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_process_response(void*_Nonnull ptr, RustBuffer event_json, RustBuffer inviter_privkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_SERIALIZE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_SERIALIZE +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_serialize(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_SET_OWNER_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_SET_OWNER_PUBKEY_HEX +void uniffi_ndr_ffi_fn_method_invitehandle_set_owner_pubkey_hex(void*_Nonnull ptr, RustBuffer owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_SET_PURPOSE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_SET_PURPOSE +void uniffi_ndr_ffi_fn_method_invitehandle_set_purpose(void*_Nonnull ptr, RustBuffer purpose, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_TO_EVENT_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_TO_EVENT_JSON +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_to_event_json(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_TO_URL +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_TO_URL +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_to_url(void*_Nonnull ptr, RustBuffer root, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CLONE_SESSIONHANDLE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CLONE_SESSIONHANDLE +void*_Nonnull uniffi_ndr_ffi_fn_clone_sessionhandle(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FREE_SESSIONHANDLE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FREE_SESSIONHANDLE +void uniffi_ndr_ffi_fn_free_sessionhandle(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONHANDLE_FROM_STATE_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONHANDLE_FROM_STATE_JSON +void*_Nonnull uniffi_ndr_ffi_fn_constructor_sessionhandle_from_state_json(RustBuffer state_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONHANDLE_INIT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONHANDLE_INIT +void*_Nonnull uniffi_ndr_ffi_fn_constructor_sessionhandle_init(RustBuffer their_ephemeral_pubkey_hex, RustBuffer our_ephemeral_privkey_hex, int8_t is_initiator, RustBuffer shared_secret_hex, RustBuffer name, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_CAN_SEND +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_CAN_SEND +int8_t uniffi_ndr_ffi_fn_method_sessionhandle_can_send(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_DECRYPT_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_DECRYPT_EVENT +RustBuffer uniffi_ndr_ffi_fn_method_sessionhandle_decrypt_event(void*_Nonnull ptr, RustBuffer outer_event_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_IS_DR_MESSAGE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_IS_DR_MESSAGE +int8_t uniffi_ndr_ffi_fn_method_sessionhandle_is_dr_message(void*_Nonnull ptr, RustBuffer event_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_SEND_TEXT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_SEND_TEXT +RustBuffer uniffi_ndr_ffi_fn_method_sessionhandle_send_text(void*_Nonnull ptr, RustBuffer text, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_STATE_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_STATE_JSON +RustBuffer uniffi_ndr_ffi_fn_method_sessionhandle_state_json(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CLONE_SESSIONMANAGERHANDLE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CLONE_SESSIONMANAGERHANDLE +void*_Nonnull uniffi_ndr_ffi_fn_clone_sessionmanagerhandle(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FREE_SESSIONMANAGERHANDLE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FREE_SESSIONMANAGERHANDLE +void uniffi_ndr_ffi_fn_free_sessionmanagerhandle(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW +void*_Nonnull uniffi_ndr_ffi_fn_constructor_sessionmanagerhandle_new(RustBuffer our_pubkey_hex, RustBuffer our_identity_privkey_hex, RustBuffer device_id, RustBuffer owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW_WITH_STORAGE_PATH +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW_WITH_STORAGE_PATH +void*_Nonnull uniffi_ndr_ffi_fn_constructor_sessionmanagerhandle_new_with_storage_path(RustBuffer our_pubkey_hex, RustBuffer our_identity_privkey_hex, RustBuffer device_id, RustBuffer storage_path, RustBuffer owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_EVENT_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_EVENT_JSON +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_accept_invite_from_event_json(void*_Nonnull ptr, RustBuffer event_json, RustBuffer owner_pubkey_hint_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_URL +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_URL +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_accept_invite_from_url(void*_Nonnull ptr, RustBuffer invite_url, RustBuffer owner_pubkey_hint_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_DRAIN_EVENTS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_DRAIN_EVENTS +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_drain_events(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_ACTIVE_SESSION_STATE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_ACTIVE_SESSION_STATE +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_active_session_state(void*_Nonnull ptr, RustBuffer peer_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_DEVICE_ID +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_DEVICE_ID +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_device_id(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_AUTHOR_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_AUTHOR_PUBKEYS +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_message_push_author_pubkeys(void*_Nonnull ptr, RustBuffer peer_owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_SESSION_STATES +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_SESSION_STATES +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_message_push_session_states(void*_Nonnull ptr, RustBuffer peer_owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_OUR_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_OUR_PUBKEY_HEX +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_our_pubkey_hex(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_OWNER_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_OWNER_PUBKEY_HEX +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_owner_pubkey_hex(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_STORED_USER_RECORD_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_STORED_USER_RECORD_JSON +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_stored_user_record_json(void*_Nonnull ptr, RustBuffer peer_owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_TOTAL_SESSIONS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_TOTAL_SESSIONS +uint64_t uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_total_sessions(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_CREATE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_CREATE +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_create(void*_Nonnull ptr, RustBuffer name, RustBuffer member_owner_pubkeys, RustBuffer fanout_metadata, RustBuffer now_ms, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_INCOMING_SESSION_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_INCOMING_SESSION_EVENT +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_handle_incoming_session_event(void*_Nonnull ptr, RustBuffer event_json, RustBuffer from_owner_pubkey_hex, RustBuffer from_sender_device_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_OUTER_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_OUTER_EVENT +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_handle_outer_event(void*_Nonnull ptr, RustBuffer event_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_KNOWN_SENDER_EVENT_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_KNOWN_SENDER_EVENT_PUBKEYS +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_known_sender_event_pubkeys(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_OUTER_SUBSCRIPTION_PLAN +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_OUTER_SUBSCRIPTION_PLAN +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_outer_subscription_plan(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_REMOVE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_REMOVE +void uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_remove(void*_Nonnull ptr, RustBuffer group_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_SEND_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_SEND_EVENT +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_send_event(void*_Nonnull ptr, RustBuffer group_id, uint32_t kind, RustBuffer content, RustBuffer tags_json, RustBuffer now_ms, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_UPSERT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_UPSERT +void uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_upsert(void*_Nonnull ptr, RustBuffer group, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_IMPORT_SESSION_STATE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_IMPORT_SESSION_STATE +void uniffi_ndr_ffi_fn_method_sessionmanagerhandle_import_session_state(void*_Nonnull ptr, RustBuffer peer_pubkey_hex, RustBuffer state_json, RustBuffer device_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_INIT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_INIT +void uniffi_ndr_ffi_fn_method_sessionmanagerhandle_init(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_KNOWN_PEER_OWNER_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_KNOWN_PEER_OWNER_PUBKEYS +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_known_peer_owner_pubkeys(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_PROCESS_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_PROCESS_EVENT +void uniffi_ndr_ffi_fn_method_sessionmanagerhandle_process_event(void*_Nonnull ptr, RustBuffer event_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_EVENT_WITH_INNER_ID +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_EVENT_WITH_INNER_ID +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_event_with_inner_id(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, uint32_t kind, RustBuffer content, RustBuffer tags_json, RustBuffer created_at_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_REACTION +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_REACTION +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_reaction(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, RustBuffer message_id, RustBuffer emoji, RustBuffer expires_at_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_RECEIPT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_RECEIPT +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_receipt(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, RustBuffer receipt_type, RustBuffer message_ids, RustBuffer expires_at_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_RUMOR_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_RUMOR_JSON +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_rumor_json(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, RustBuffer rumor_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_text(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, RustBuffer text, RustBuffer expires_at_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT_WITH_INNER_ID +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT_WITH_INNER_ID +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_text_with_inner_id(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, RustBuffer text, RustBuffer expires_at_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_TYPING +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_TYPING +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_typing(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, RustBuffer expires_at_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SETUP_USER +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SETUP_USER +void uniffi_ndr_ffi_fn_method_sessionmanagerhandle_setup_user(void*_Nonnull ptr, RustBuffer user_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_CREATE_SIGNED_APP_KEYS_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_CREATE_SIGNED_APP_KEYS_EVENT +RustBuffer uniffi_ndr_ffi_fn_func_create_signed_app_keys_event(RustBuffer owner_pubkey_hex, RustBuffer owner_privkey_hex, RustBuffer devices, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_DERIVE_PUBLIC_KEY +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_DERIVE_PUBLIC_KEY +RustBuffer uniffi_ndr_ffi_fn_func_derive_public_key(RustBuffer privkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_GENERATE_KEYPAIR +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_GENERATE_KEYPAIR +RustBuffer uniffi_ndr_ffi_fn_func_generate_keypair(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_PARSE_APP_KEYS_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_PARSE_APP_KEYS_EVENT +RustBuffer uniffi_ndr_ffi_fn_func_parse_app_keys_event(RustBuffer event_json, RustBuffer owner_privkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_RESOLVE_CONVERSATION_CANDIDATE_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_RESOLVE_CONVERSATION_CANDIDATE_PUBKEYS +RustBuffer uniffi_ndr_ffi_fn_func_resolve_conversation_candidate_pubkeys(RustBuffer owner_pubkey_hex, RustBuffer rumor_pubkey_hex, RustBuffer rumor_tags, RustBuffer sender_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_RESOLVE_LATEST_APP_KEYS_DEVICES +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_RESOLVE_LATEST_APP_KEYS_DEVICES +RustBuffer uniffi_ndr_ffi_fn_func_resolve_latest_app_keys_devices(RustBuffer event_jsons, RustBuffer owner_privkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_VERSION +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_VERSION +RustBuffer uniffi_ndr_ffi_fn_func_version(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_ALLOC +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_ALLOC +RustBuffer ffi_ndr_ffi_rustbuffer_alloc(uint64_t size, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_FROM_BYTES +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_FROM_BYTES +RustBuffer ffi_ndr_ffi_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_FREE +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_FREE +void ffi_ndr_ffi_rustbuffer_free(RustBuffer buf, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_RESERVE +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_RESERVE +RustBuffer ffi_ndr_ffi_rustbuffer_reserve(RustBuffer buf, uint64_t additional, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U8 +void ffi_ndr_ffi_rust_future_poll_u8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U8 +void ffi_ndr_ffi_rust_future_cancel_u8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U8 +void ffi_ndr_ffi_rust_future_free_u8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U8 +uint8_t ffi_ndr_ffi_rust_future_complete_u8(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I8 +void ffi_ndr_ffi_rust_future_poll_i8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I8 +void ffi_ndr_ffi_rust_future_cancel_i8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I8 +void ffi_ndr_ffi_rust_future_free_i8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I8 +int8_t ffi_ndr_ffi_rust_future_complete_i8(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U16 +void ffi_ndr_ffi_rust_future_poll_u16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U16 +void ffi_ndr_ffi_rust_future_cancel_u16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U16 +void ffi_ndr_ffi_rust_future_free_u16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U16 +uint16_t ffi_ndr_ffi_rust_future_complete_u16(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I16 +void ffi_ndr_ffi_rust_future_poll_i16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I16 +void ffi_ndr_ffi_rust_future_cancel_i16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I16 +void ffi_ndr_ffi_rust_future_free_i16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I16 +int16_t ffi_ndr_ffi_rust_future_complete_i16(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U32 +void ffi_ndr_ffi_rust_future_poll_u32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U32 +void ffi_ndr_ffi_rust_future_cancel_u32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U32 +void ffi_ndr_ffi_rust_future_free_u32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U32 +uint32_t ffi_ndr_ffi_rust_future_complete_u32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I32 +void ffi_ndr_ffi_rust_future_poll_i32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I32 +void ffi_ndr_ffi_rust_future_cancel_i32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I32 +void ffi_ndr_ffi_rust_future_free_i32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I32 +int32_t ffi_ndr_ffi_rust_future_complete_i32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U64 +void ffi_ndr_ffi_rust_future_poll_u64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U64 +void ffi_ndr_ffi_rust_future_cancel_u64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U64 +void ffi_ndr_ffi_rust_future_free_u64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U64 +uint64_t ffi_ndr_ffi_rust_future_complete_u64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I64 +void ffi_ndr_ffi_rust_future_poll_i64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I64 +void ffi_ndr_ffi_rust_future_cancel_i64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I64 +void ffi_ndr_ffi_rust_future_free_i64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I64 +int64_t ffi_ndr_ffi_rust_future_complete_i64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_F32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_F32 +void ffi_ndr_ffi_rust_future_poll_f32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_F32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_F32 +void ffi_ndr_ffi_rust_future_cancel_f32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_F32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_F32 +void ffi_ndr_ffi_rust_future_free_f32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_F32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_F32 +float ffi_ndr_ffi_rust_future_complete_f32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_F64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_F64 +void ffi_ndr_ffi_rust_future_poll_f64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_F64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_F64 +void ffi_ndr_ffi_rust_future_cancel_f64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_F64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_F64 +void ffi_ndr_ffi_rust_future_free_f64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_F64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_F64 +double ffi_ndr_ffi_rust_future_complete_f64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_POINTER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_POINTER +void ffi_ndr_ffi_rust_future_poll_pointer(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_POINTER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_POINTER +void ffi_ndr_ffi_rust_future_cancel_pointer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_POINTER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_POINTER +void ffi_ndr_ffi_rust_future_free_pointer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_POINTER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_POINTER +void*_Nonnull ffi_ndr_ffi_rust_future_complete_pointer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_RUST_BUFFER +void ffi_ndr_ffi_rust_future_poll_rust_buffer(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_RUST_BUFFER +void ffi_ndr_ffi_rust_future_cancel_rust_buffer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_RUST_BUFFER +void ffi_ndr_ffi_rust_future_free_rust_buffer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_RUST_BUFFER +RustBuffer ffi_ndr_ffi_rust_future_complete_rust_buffer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_VOID +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_VOID +void ffi_ndr_ffi_rust_future_poll_void(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_VOID +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_VOID +void ffi_ndr_ffi_rust_future_cancel_void(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_VOID +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_VOID +void ffi_ndr_ffi_rust_future_free_void(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_VOID +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_VOID +void ffi_ndr_ffi_rust_future_complete_void(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_CREATE_SIGNED_APP_KEYS_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_CREATE_SIGNED_APP_KEYS_EVENT +uint16_t uniffi_ndr_ffi_checksum_func_create_signed_app_keys_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_DERIVE_PUBLIC_KEY +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_DERIVE_PUBLIC_KEY +uint16_t uniffi_ndr_ffi_checksum_func_derive_public_key(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_GENERATE_KEYPAIR +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_GENERATE_KEYPAIR +uint16_t uniffi_ndr_ffi_checksum_func_generate_keypair(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_PARSE_APP_KEYS_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_PARSE_APP_KEYS_EVENT +uint16_t uniffi_ndr_ffi_checksum_func_parse_app_keys_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_RESOLVE_CONVERSATION_CANDIDATE_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_RESOLVE_CONVERSATION_CANDIDATE_PUBKEYS +uint16_t uniffi_ndr_ffi_checksum_func_resolve_conversation_candidate_pubkeys(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_RESOLVE_LATEST_APP_KEYS_DEVICES +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_RESOLVE_LATEST_APP_KEYS_DEVICES +uint16_t uniffi_ndr_ffi_checksum_func_resolve_latest_app_keys_devices(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_VERSION +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_VERSION +uint16_t uniffi_ndr_ffi_checksum_func_version(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_ACCEPT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_ACCEPT +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_accept(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_ACCEPT_WITH_OWNER +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_ACCEPT_WITH_OWNER +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_accept_with_owner(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_GET_INVITER_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_GET_INVITER_PUBKEY_HEX +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_get_inviter_pubkey_hex(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_GET_SHARED_SECRET_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_GET_SHARED_SECRET_HEX +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_get_shared_secret_hex(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_PROCESS_RESPONSE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_PROCESS_RESPONSE +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_process_response(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_SERIALIZE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_SERIALIZE +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_serialize(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_SET_OWNER_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_SET_OWNER_PUBKEY_HEX +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_set_owner_pubkey_hex(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_SET_PURPOSE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_SET_PURPOSE +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_set_purpose(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_TO_EVENT_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_TO_EVENT_JSON +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_to_event_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_TO_URL +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_TO_URL +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_to_url(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_CAN_SEND +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_CAN_SEND +uint16_t uniffi_ndr_ffi_checksum_method_sessionhandle_can_send(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_DECRYPT_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_DECRYPT_EVENT +uint16_t uniffi_ndr_ffi_checksum_method_sessionhandle_decrypt_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_IS_DR_MESSAGE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_IS_DR_MESSAGE +uint16_t uniffi_ndr_ffi_checksum_method_sessionhandle_is_dr_message(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_SEND_TEXT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_SEND_TEXT +uint16_t uniffi_ndr_ffi_checksum_method_sessionhandle_send_text(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_STATE_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_STATE_JSON +uint16_t uniffi_ndr_ffi_checksum_method_sessionhandle_state_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_EVENT_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_EVENT_JSON +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_accept_invite_from_event_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_URL +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_URL +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_accept_invite_from_url(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_DRAIN_EVENTS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_DRAIN_EVENTS +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_drain_events(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_ACTIVE_SESSION_STATE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_ACTIVE_SESSION_STATE +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_active_session_state(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_DEVICE_ID +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_DEVICE_ID +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_device_id(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_AUTHOR_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_AUTHOR_PUBKEYS +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_message_push_author_pubkeys(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_SESSION_STATES +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_SESSION_STATES +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_message_push_session_states(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_OUR_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_OUR_PUBKEY_HEX +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_our_pubkey_hex(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_OWNER_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_OWNER_PUBKEY_HEX +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_owner_pubkey_hex(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_STORED_USER_RECORD_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_STORED_USER_RECORD_JSON +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_stored_user_record_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_TOTAL_SESSIONS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_TOTAL_SESSIONS +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_total_sessions(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_CREATE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_CREATE +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_create(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_INCOMING_SESSION_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_INCOMING_SESSION_EVENT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_handle_incoming_session_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_OUTER_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_OUTER_EVENT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_handle_outer_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_KNOWN_SENDER_EVENT_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_KNOWN_SENDER_EVENT_PUBKEYS +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_known_sender_event_pubkeys(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_OUTER_SUBSCRIPTION_PLAN +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_OUTER_SUBSCRIPTION_PLAN +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_outer_subscription_plan(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_REMOVE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_REMOVE +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_remove(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_SEND_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_SEND_EVENT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_send_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_UPSERT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_UPSERT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_upsert(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_IMPORT_SESSION_STATE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_IMPORT_SESSION_STATE +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_import_session_state(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_INIT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_INIT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_init(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_KNOWN_PEER_OWNER_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_KNOWN_PEER_OWNER_PUBKEYS +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_known_peer_owner_pubkeys(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_PROCESS_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_PROCESS_EVENT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_process_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_EVENT_WITH_INNER_ID +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_EVENT_WITH_INNER_ID +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_event_with_inner_id(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_REACTION +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_REACTION +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_reaction(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_RECEIPT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_RECEIPT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_receipt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_RUMOR_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_RUMOR_JSON +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_rumor_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_text(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT_WITH_INNER_ID +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT_WITH_INNER_ID +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_text_with_inner_id(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_TYPING +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_TYPING +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_typing(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SETUP_USER +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SETUP_USER +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_setup_user(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_CREATE_NEW +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_CREATE_NEW +uint16_t uniffi_ndr_ffi_checksum_constructor_invitehandle_create_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_DESERIALIZE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_DESERIALIZE +uint16_t uniffi_ndr_ffi_checksum_constructor_invitehandle_deserialize(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_FROM_EVENT_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_FROM_EVENT_JSON +uint16_t uniffi_ndr_ffi_checksum_constructor_invitehandle_from_event_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_FROM_URL +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_FROM_URL +uint16_t uniffi_ndr_ffi_checksum_constructor_invitehandle_from_url(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONHANDLE_FROM_STATE_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONHANDLE_FROM_STATE_JSON +uint16_t uniffi_ndr_ffi_checksum_constructor_sessionhandle_from_state_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONHANDLE_INIT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONHANDLE_INIT +uint16_t uniffi_ndr_ffi_checksum_constructor_sessionhandle_init(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW +uint16_t uniffi_ndr_ffi_checksum_constructor_sessionmanagerhandle_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW_WITH_STORAGE_PATH +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW_WITH_STORAGE_PATH +uint16_t uniffi_ndr_ffi_checksum_constructor_sessionmanagerhandle_new_with_storage_path(void + +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_UNIFFI_CONTRACT_VERSION +#define UNIFFI_FFIDEF_FFI_NDR_FFI_UNIFFI_CONTRACT_VERSION +uint32_t ffi_ndr_ffi_uniffi_contract_version(void + +); +#endif + diff --git a/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/ios-arm64_x86_64-simulator/libndr_ffi_sim.a b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/ios-arm64_x86_64-simulator/libndr_ffi_sim.a new file mode 100644 index 00000000..3e03523e Binary files /dev/null and b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/ios-arm64_x86_64-simulator/libndr_ffi_sim.a differ diff --git a/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/macos-arm64_x86_64/Headers/module.modulemap b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/macos-arm64_x86_64/Headers/module.modulemap new file mode 100644 index 00000000..94108e3e --- /dev/null +++ b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/macos-arm64_x86_64/Headers/module.modulemap @@ -0,0 +1,4 @@ +module ndr_ffiFFI { + header "ndr_ffiFFI.h" + export * +} diff --git a/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/macos-arm64_x86_64/Headers/ndr_ffiFFI.h b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/macos-arm64_x86_64/Headers/ndr_ffiFFI.h new file mode 100644 index 00000000..4bc334b4 --- /dev/null +++ b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/macos-arm64_x86_64/Headers/ndr_ffiFFI.h @@ -0,0 +1,1243 @@ +// This file was autogenerated by some hot garbage in the `uniffi` crate. +// Trust me, you don't want to mess with it! + +#pragma once + +#include +#include +#include + +// The following structs are used to implement the lowest level +// of the FFI, and thus useful to multiple uniffied crates. +// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H. +#ifdef UNIFFI_SHARED_H + // We also try to prevent mixing versions of shared uniffi header structs. + // If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V4 + #ifndef UNIFFI_SHARED_HEADER_V4 + #error Combining helper code from multiple versions of uniffi is not supported + #endif // ndef UNIFFI_SHARED_HEADER_V4 +#else +#define UNIFFI_SHARED_H +#define UNIFFI_SHARED_HEADER_V4 +// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ +// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ + +typedef struct RustBuffer +{ + uint64_t capacity; + uint64_t len; + uint8_t *_Nullable data; +} RustBuffer; + +typedef struct ForeignBytes +{ + int32_t len; + const uint8_t *_Nullable data; +} ForeignBytes; + +// Error definitions +typedef struct RustCallStatus { + int8_t code; + RustBuffer errorBuf; +} RustCallStatus; + +// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ +// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ +#endif // def UNIFFI_SHARED_H +#ifndef UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK +#define UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK +typedef void (*UniffiRustFutureContinuationCallback)(uint64_t, int8_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_FREE +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_FREE +typedef void (*UniffiForeignFutureFree)(uint64_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE +typedef void (*UniffiCallbackInterfaceFree)(uint64_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE +#define UNIFFI_FFIDEF_FOREIGN_FUTURE +typedef struct UniffiForeignFuture { + uint64_t handle; + UniffiForeignFutureFree _Nonnull free; +} UniffiForeignFuture; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U8 +typedef struct UniffiForeignFutureStructU8 { + uint8_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructU8; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8 +typedef void (*UniffiForeignFutureCompleteU8)(uint64_t, UniffiForeignFutureStructU8 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I8 +typedef struct UniffiForeignFutureStructI8 { + int8_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructI8; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8 +typedef void (*UniffiForeignFutureCompleteI8)(uint64_t, UniffiForeignFutureStructI8 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U16 +typedef struct UniffiForeignFutureStructU16 { + uint16_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructU16; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16 +typedef void (*UniffiForeignFutureCompleteU16)(uint64_t, UniffiForeignFutureStructU16 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I16 +typedef struct UniffiForeignFutureStructI16 { + int16_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructI16; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16 +typedef void (*UniffiForeignFutureCompleteI16)(uint64_t, UniffiForeignFutureStructI16 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U32 +typedef struct UniffiForeignFutureStructU32 { + uint32_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructU32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32 +typedef void (*UniffiForeignFutureCompleteU32)(uint64_t, UniffiForeignFutureStructU32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I32 +typedef struct UniffiForeignFutureStructI32 { + int32_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructI32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32 +typedef void (*UniffiForeignFutureCompleteI32)(uint64_t, UniffiForeignFutureStructI32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U64 +typedef struct UniffiForeignFutureStructU64 { + uint64_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructU64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64 +typedef void (*UniffiForeignFutureCompleteU64)(uint64_t, UniffiForeignFutureStructU64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I64 +typedef struct UniffiForeignFutureStructI64 { + int64_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructI64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64 +typedef void (*UniffiForeignFutureCompleteI64)(uint64_t, UniffiForeignFutureStructI64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F32 +typedef struct UniffiForeignFutureStructF32 { + float returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructF32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32 +typedef void (*UniffiForeignFutureCompleteF32)(uint64_t, UniffiForeignFutureStructF32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F64 +typedef struct UniffiForeignFutureStructF64 { + double returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructF64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64 +typedef void (*UniffiForeignFutureCompleteF64)(uint64_t, UniffiForeignFutureStructF64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_POINTER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_POINTER +typedef struct UniffiForeignFutureStructPointer { + void*_Nonnull returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructPointer; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_POINTER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_POINTER +typedef void (*UniffiForeignFutureCompletePointer)(uint64_t, UniffiForeignFutureStructPointer + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_RUST_BUFFER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_RUST_BUFFER +typedef struct UniffiForeignFutureStructRustBuffer { + RustBuffer returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureStructRustBuffer; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER +typedef void (*UniffiForeignFutureCompleteRustBuffer)(uint64_t, UniffiForeignFutureStructRustBuffer + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_VOID +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_VOID +typedef struct UniffiForeignFutureStructVoid { + RustCallStatus callStatus; +} UniffiForeignFutureStructVoid; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID +typedef void (*UniffiForeignFutureCompleteVoid)(uint64_t, UniffiForeignFutureStructVoid + ); + +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CLONE_INVITEHANDLE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CLONE_INVITEHANDLE +void*_Nonnull uniffi_ndr_ffi_fn_clone_invitehandle(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FREE_INVITEHANDLE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FREE_INVITEHANDLE +void uniffi_ndr_ffi_fn_free_invitehandle(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_CREATE_NEW +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_CREATE_NEW +void*_Nonnull uniffi_ndr_ffi_fn_constructor_invitehandle_create_new(RustBuffer inviter_pubkey_hex, RustBuffer device_id, RustBuffer max_uses, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_DESERIALIZE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_DESERIALIZE +void*_Nonnull uniffi_ndr_ffi_fn_constructor_invitehandle_deserialize(RustBuffer json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_FROM_EVENT_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_FROM_EVENT_JSON +void*_Nonnull uniffi_ndr_ffi_fn_constructor_invitehandle_from_event_json(RustBuffer event_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_FROM_URL +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_INVITEHANDLE_FROM_URL +void*_Nonnull uniffi_ndr_ffi_fn_constructor_invitehandle_from_url(RustBuffer url, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_ACCEPT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_ACCEPT +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_accept(void*_Nonnull ptr, RustBuffer invitee_pubkey_hex, RustBuffer invitee_privkey_hex, RustBuffer device_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_ACCEPT_WITH_OWNER +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_ACCEPT_WITH_OWNER +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_accept_with_owner(void*_Nonnull ptr, RustBuffer invitee_pubkey_hex, RustBuffer invitee_privkey_hex, RustBuffer device_id, RustBuffer owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_GET_INVITER_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_GET_INVITER_PUBKEY_HEX +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_get_inviter_pubkey_hex(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_GET_SHARED_SECRET_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_GET_SHARED_SECRET_HEX +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_get_shared_secret_hex(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_PROCESS_RESPONSE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_PROCESS_RESPONSE +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_process_response(void*_Nonnull ptr, RustBuffer event_json, RustBuffer inviter_privkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_SERIALIZE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_SERIALIZE +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_serialize(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_SET_OWNER_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_SET_OWNER_PUBKEY_HEX +void uniffi_ndr_ffi_fn_method_invitehandle_set_owner_pubkey_hex(void*_Nonnull ptr, RustBuffer owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_SET_PURPOSE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_SET_PURPOSE +void uniffi_ndr_ffi_fn_method_invitehandle_set_purpose(void*_Nonnull ptr, RustBuffer purpose, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_TO_EVENT_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_TO_EVENT_JSON +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_to_event_json(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_TO_URL +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_INVITEHANDLE_TO_URL +RustBuffer uniffi_ndr_ffi_fn_method_invitehandle_to_url(void*_Nonnull ptr, RustBuffer root, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CLONE_SESSIONHANDLE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CLONE_SESSIONHANDLE +void*_Nonnull uniffi_ndr_ffi_fn_clone_sessionhandle(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FREE_SESSIONHANDLE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FREE_SESSIONHANDLE +void uniffi_ndr_ffi_fn_free_sessionhandle(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONHANDLE_FROM_STATE_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONHANDLE_FROM_STATE_JSON +void*_Nonnull uniffi_ndr_ffi_fn_constructor_sessionhandle_from_state_json(RustBuffer state_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONHANDLE_INIT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONHANDLE_INIT +void*_Nonnull uniffi_ndr_ffi_fn_constructor_sessionhandle_init(RustBuffer their_ephemeral_pubkey_hex, RustBuffer our_ephemeral_privkey_hex, int8_t is_initiator, RustBuffer shared_secret_hex, RustBuffer name, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_CAN_SEND +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_CAN_SEND +int8_t uniffi_ndr_ffi_fn_method_sessionhandle_can_send(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_DECRYPT_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_DECRYPT_EVENT +RustBuffer uniffi_ndr_ffi_fn_method_sessionhandle_decrypt_event(void*_Nonnull ptr, RustBuffer outer_event_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_IS_DR_MESSAGE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_IS_DR_MESSAGE +int8_t uniffi_ndr_ffi_fn_method_sessionhandle_is_dr_message(void*_Nonnull ptr, RustBuffer event_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_SEND_TEXT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_SEND_TEXT +RustBuffer uniffi_ndr_ffi_fn_method_sessionhandle_send_text(void*_Nonnull ptr, RustBuffer text, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_STATE_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONHANDLE_STATE_JSON +RustBuffer uniffi_ndr_ffi_fn_method_sessionhandle_state_json(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CLONE_SESSIONMANAGERHANDLE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CLONE_SESSIONMANAGERHANDLE +void*_Nonnull uniffi_ndr_ffi_fn_clone_sessionmanagerhandle(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FREE_SESSIONMANAGERHANDLE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FREE_SESSIONMANAGERHANDLE +void uniffi_ndr_ffi_fn_free_sessionmanagerhandle(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW +void*_Nonnull uniffi_ndr_ffi_fn_constructor_sessionmanagerhandle_new(RustBuffer our_pubkey_hex, RustBuffer our_identity_privkey_hex, RustBuffer device_id, RustBuffer owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW_WITH_STORAGE_PATH +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW_WITH_STORAGE_PATH +void*_Nonnull uniffi_ndr_ffi_fn_constructor_sessionmanagerhandle_new_with_storage_path(RustBuffer our_pubkey_hex, RustBuffer our_identity_privkey_hex, RustBuffer device_id, RustBuffer storage_path, RustBuffer owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_EVENT_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_EVENT_JSON +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_accept_invite_from_event_json(void*_Nonnull ptr, RustBuffer event_json, RustBuffer owner_pubkey_hint_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_URL +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_URL +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_accept_invite_from_url(void*_Nonnull ptr, RustBuffer invite_url, RustBuffer owner_pubkey_hint_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_DRAIN_EVENTS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_DRAIN_EVENTS +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_drain_events(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_ACTIVE_SESSION_STATE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_ACTIVE_SESSION_STATE +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_active_session_state(void*_Nonnull ptr, RustBuffer peer_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_DEVICE_ID +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_DEVICE_ID +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_device_id(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_AUTHOR_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_AUTHOR_PUBKEYS +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_message_push_author_pubkeys(void*_Nonnull ptr, RustBuffer peer_owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_SESSION_STATES +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_SESSION_STATES +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_message_push_session_states(void*_Nonnull ptr, RustBuffer peer_owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_OUR_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_OUR_PUBKEY_HEX +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_our_pubkey_hex(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_OWNER_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_OWNER_PUBKEY_HEX +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_owner_pubkey_hex(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_STORED_USER_RECORD_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_STORED_USER_RECORD_JSON +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_stored_user_record_json(void*_Nonnull ptr, RustBuffer peer_owner_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_TOTAL_SESSIONS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GET_TOTAL_SESSIONS +uint64_t uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_total_sessions(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_CREATE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_CREATE +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_create(void*_Nonnull ptr, RustBuffer name, RustBuffer member_owner_pubkeys, RustBuffer fanout_metadata, RustBuffer now_ms, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_INCOMING_SESSION_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_INCOMING_SESSION_EVENT +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_handle_incoming_session_event(void*_Nonnull ptr, RustBuffer event_json, RustBuffer from_owner_pubkey_hex, RustBuffer from_sender_device_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_OUTER_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_OUTER_EVENT +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_handle_outer_event(void*_Nonnull ptr, RustBuffer event_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_KNOWN_SENDER_EVENT_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_KNOWN_SENDER_EVENT_PUBKEYS +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_known_sender_event_pubkeys(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_OUTER_SUBSCRIPTION_PLAN +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_OUTER_SUBSCRIPTION_PLAN +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_outer_subscription_plan(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_REMOVE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_REMOVE +void uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_remove(void*_Nonnull ptr, RustBuffer group_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_SEND_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_SEND_EVENT +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_send_event(void*_Nonnull ptr, RustBuffer group_id, uint32_t kind, RustBuffer content, RustBuffer tags_json, RustBuffer now_ms, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_UPSERT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_GROUP_UPSERT +void uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_upsert(void*_Nonnull ptr, RustBuffer group, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_IMPORT_SESSION_STATE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_IMPORT_SESSION_STATE +void uniffi_ndr_ffi_fn_method_sessionmanagerhandle_import_session_state(void*_Nonnull ptr, RustBuffer peer_pubkey_hex, RustBuffer state_json, RustBuffer device_id, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_INIT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_INIT +void uniffi_ndr_ffi_fn_method_sessionmanagerhandle_init(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_KNOWN_PEER_OWNER_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_KNOWN_PEER_OWNER_PUBKEYS +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_known_peer_owner_pubkeys(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_PROCESS_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_PROCESS_EVENT +void uniffi_ndr_ffi_fn_method_sessionmanagerhandle_process_event(void*_Nonnull ptr, RustBuffer event_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_EVENT_WITH_INNER_ID +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_EVENT_WITH_INNER_ID +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_event_with_inner_id(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, uint32_t kind, RustBuffer content, RustBuffer tags_json, RustBuffer created_at_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_REACTION +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_REACTION +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_reaction(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, RustBuffer message_id, RustBuffer emoji, RustBuffer expires_at_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_RECEIPT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_RECEIPT +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_receipt(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, RustBuffer receipt_type, RustBuffer message_ids, RustBuffer expires_at_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_RUMOR_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_RUMOR_JSON +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_rumor_json(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, RustBuffer rumor_json, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_text(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, RustBuffer text, RustBuffer expires_at_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT_WITH_INNER_ID +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT_WITH_INNER_ID +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_text_with_inner_id(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, RustBuffer text, RustBuffer expires_at_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_TYPING +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SEND_TYPING +RustBuffer uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_typing(void*_Nonnull ptr, RustBuffer recipient_pubkey_hex, RustBuffer expires_at_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SETUP_USER +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_METHOD_SESSIONMANAGERHANDLE_SETUP_USER +void uniffi_ndr_ffi_fn_method_sessionmanagerhandle_setup_user(void*_Nonnull ptr, RustBuffer user_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_CREATE_SIGNED_APP_KEYS_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_CREATE_SIGNED_APP_KEYS_EVENT +RustBuffer uniffi_ndr_ffi_fn_func_create_signed_app_keys_event(RustBuffer owner_pubkey_hex, RustBuffer owner_privkey_hex, RustBuffer devices, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_DERIVE_PUBLIC_KEY +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_DERIVE_PUBLIC_KEY +RustBuffer uniffi_ndr_ffi_fn_func_derive_public_key(RustBuffer privkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_GENERATE_KEYPAIR +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_GENERATE_KEYPAIR +RustBuffer uniffi_ndr_ffi_fn_func_generate_keypair(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_PARSE_APP_KEYS_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_PARSE_APP_KEYS_EVENT +RustBuffer uniffi_ndr_ffi_fn_func_parse_app_keys_event(RustBuffer event_json, RustBuffer owner_privkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_RESOLVE_CONVERSATION_CANDIDATE_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_RESOLVE_CONVERSATION_CANDIDATE_PUBKEYS +RustBuffer uniffi_ndr_ffi_fn_func_resolve_conversation_candidate_pubkeys(RustBuffer owner_pubkey_hex, RustBuffer rumor_pubkey_hex, RustBuffer rumor_tags, RustBuffer sender_pubkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_RESOLVE_LATEST_APP_KEYS_DEVICES +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_RESOLVE_LATEST_APP_KEYS_DEVICES +RustBuffer uniffi_ndr_ffi_fn_func_resolve_latest_app_keys_devices(RustBuffer event_jsons, RustBuffer owner_privkey_hex, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_VERSION +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_FN_FUNC_VERSION +RustBuffer uniffi_ndr_ffi_fn_func_version(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_ALLOC +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_ALLOC +RustBuffer ffi_ndr_ffi_rustbuffer_alloc(uint64_t size, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_FROM_BYTES +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_FROM_BYTES +RustBuffer ffi_ndr_ffi_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_FREE +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_FREE +void ffi_ndr_ffi_rustbuffer_free(RustBuffer buf, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_RESERVE +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUSTBUFFER_RESERVE +RustBuffer ffi_ndr_ffi_rustbuffer_reserve(RustBuffer buf, uint64_t additional, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U8 +void ffi_ndr_ffi_rust_future_poll_u8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U8 +void ffi_ndr_ffi_rust_future_cancel_u8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U8 +void ffi_ndr_ffi_rust_future_free_u8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U8 +uint8_t ffi_ndr_ffi_rust_future_complete_u8(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I8 +void ffi_ndr_ffi_rust_future_poll_i8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I8 +void ffi_ndr_ffi_rust_future_cancel_i8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I8 +void ffi_ndr_ffi_rust_future_free_i8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I8 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I8 +int8_t ffi_ndr_ffi_rust_future_complete_i8(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U16 +void ffi_ndr_ffi_rust_future_poll_u16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U16 +void ffi_ndr_ffi_rust_future_cancel_u16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U16 +void ffi_ndr_ffi_rust_future_free_u16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U16 +uint16_t ffi_ndr_ffi_rust_future_complete_u16(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I16 +void ffi_ndr_ffi_rust_future_poll_i16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I16 +void ffi_ndr_ffi_rust_future_cancel_i16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I16 +void ffi_ndr_ffi_rust_future_free_i16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I16 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I16 +int16_t ffi_ndr_ffi_rust_future_complete_i16(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U32 +void ffi_ndr_ffi_rust_future_poll_u32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U32 +void ffi_ndr_ffi_rust_future_cancel_u32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U32 +void ffi_ndr_ffi_rust_future_free_u32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U32 +uint32_t ffi_ndr_ffi_rust_future_complete_u32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I32 +void ffi_ndr_ffi_rust_future_poll_i32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I32 +void ffi_ndr_ffi_rust_future_cancel_i32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I32 +void ffi_ndr_ffi_rust_future_free_i32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I32 +int32_t ffi_ndr_ffi_rust_future_complete_i32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_U64 +void ffi_ndr_ffi_rust_future_poll_u64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_U64 +void ffi_ndr_ffi_rust_future_cancel_u64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_U64 +void ffi_ndr_ffi_rust_future_free_u64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_U64 +uint64_t ffi_ndr_ffi_rust_future_complete_u64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_I64 +void ffi_ndr_ffi_rust_future_poll_i64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_I64 +void ffi_ndr_ffi_rust_future_cancel_i64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_I64 +void ffi_ndr_ffi_rust_future_free_i64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_I64 +int64_t ffi_ndr_ffi_rust_future_complete_i64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_F32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_F32 +void ffi_ndr_ffi_rust_future_poll_f32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_F32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_F32 +void ffi_ndr_ffi_rust_future_cancel_f32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_F32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_F32 +void ffi_ndr_ffi_rust_future_free_f32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_F32 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_F32 +float ffi_ndr_ffi_rust_future_complete_f32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_F64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_F64 +void ffi_ndr_ffi_rust_future_poll_f64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_F64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_F64 +void ffi_ndr_ffi_rust_future_cancel_f64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_F64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_F64 +void ffi_ndr_ffi_rust_future_free_f64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_F64 +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_F64 +double ffi_ndr_ffi_rust_future_complete_f64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_POINTER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_POINTER +void ffi_ndr_ffi_rust_future_poll_pointer(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_POINTER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_POINTER +void ffi_ndr_ffi_rust_future_cancel_pointer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_POINTER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_POINTER +void ffi_ndr_ffi_rust_future_free_pointer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_POINTER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_POINTER +void*_Nonnull ffi_ndr_ffi_rust_future_complete_pointer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_RUST_BUFFER +void ffi_ndr_ffi_rust_future_poll_rust_buffer(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_RUST_BUFFER +void ffi_ndr_ffi_rust_future_cancel_rust_buffer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_RUST_BUFFER +void ffi_ndr_ffi_rust_future_free_rust_buffer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_RUST_BUFFER +RustBuffer ffi_ndr_ffi_rust_future_complete_rust_buffer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_VOID +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_POLL_VOID +void ffi_ndr_ffi_rust_future_poll_void(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_VOID +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_CANCEL_VOID +void ffi_ndr_ffi_rust_future_cancel_void(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_VOID +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_FREE_VOID +void ffi_ndr_ffi_rust_future_free_void(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_VOID +#define UNIFFI_FFIDEF_FFI_NDR_FFI_RUST_FUTURE_COMPLETE_VOID +void ffi_ndr_ffi_rust_future_complete_void(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_CREATE_SIGNED_APP_KEYS_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_CREATE_SIGNED_APP_KEYS_EVENT +uint16_t uniffi_ndr_ffi_checksum_func_create_signed_app_keys_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_DERIVE_PUBLIC_KEY +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_DERIVE_PUBLIC_KEY +uint16_t uniffi_ndr_ffi_checksum_func_derive_public_key(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_GENERATE_KEYPAIR +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_GENERATE_KEYPAIR +uint16_t uniffi_ndr_ffi_checksum_func_generate_keypair(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_PARSE_APP_KEYS_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_PARSE_APP_KEYS_EVENT +uint16_t uniffi_ndr_ffi_checksum_func_parse_app_keys_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_RESOLVE_CONVERSATION_CANDIDATE_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_RESOLVE_CONVERSATION_CANDIDATE_PUBKEYS +uint16_t uniffi_ndr_ffi_checksum_func_resolve_conversation_candidate_pubkeys(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_RESOLVE_LATEST_APP_KEYS_DEVICES +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_RESOLVE_LATEST_APP_KEYS_DEVICES +uint16_t uniffi_ndr_ffi_checksum_func_resolve_latest_app_keys_devices(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_VERSION +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_FUNC_VERSION +uint16_t uniffi_ndr_ffi_checksum_func_version(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_ACCEPT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_ACCEPT +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_accept(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_ACCEPT_WITH_OWNER +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_ACCEPT_WITH_OWNER +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_accept_with_owner(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_GET_INVITER_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_GET_INVITER_PUBKEY_HEX +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_get_inviter_pubkey_hex(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_GET_SHARED_SECRET_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_GET_SHARED_SECRET_HEX +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_get_shared_secret_hex(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_PROCESS_RESPONSE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_PROCESS_RESPONSE +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_process_response(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_SERIALIZE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_SERIALIZE +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_serialize(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_SET_OWNER_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_SET_OWNER_PUBKEY_HEX +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_set_owner_pubkey_hex(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_SET_PURPOSE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_SET_PURPOSE +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_set_purpose(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_TO_EVENT_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_TO_EVENT_JSON +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_to_event_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_TO_URL +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_INVITEHANDLE_TO_URL +uint16_t uniffi_ndr_ffi_checksum_method_invitehandle_to_url(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_CAN_SEND +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_CAN_SEND +uint16_t uniffi_ndr_ffi_checksum_method_sessionhandle_can_send(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_DECRYPT_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_DECRYPT_EVENT +uint16_t uniffi_ndr_ffi_checksum_method_sessionhandle_decrypt_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_IS_DR_MESSAGE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_IS_DR_MESSAGE +uint16_t uniffi_ndr_ffi_checksum_method_sessionhandle_is_dr_message(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_SEND_TEXT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_SEND_TEXT +uint16_t uniffi_ndr_ffi_checksum_method_sessionhandle_send_text(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_STATE_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONHANDLE_STATE_JSON +uint16_t uniffi_ndr_ffi_checksum_method_sessionhandle_state_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_EVENT_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_EVENT_JSON +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_accept_invite_from_event_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_URL +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_ACCEPT_INVITE_FROM_URL +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_accept_invite_from_url(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_DRAIN_EVENTS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_DRAIN_EVENTS +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_drain_events(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_ACTIVE_SESSION_STATE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_ACTIVE_SESSION_STATE +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_active_session_state(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_DEVICE_ID +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_DEVICE_ID +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_device_id(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_AUTHOR_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_AUTHOR_PUBKEYS +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_message_push_author_pubkeys(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_SESSION_STATES +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_MESSAGE_PUSH_SESSION_STATES +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_message_push_session_states(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_OUR_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_OUR_PUBKEY_HEX +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_our_pubkey_hex(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_OWNER_PUBKEY_HEX +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_OWNER_PUBKEY_HEX +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_owner_pubkey_hex(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_STORED_USER_RECORD_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_STORED_USER_RECORD_JSON +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_stored_user_record_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_TOTAL_SESSIONS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GET_TOTAL_SESSIONS +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_total_sessions(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_CREATE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_CREATE +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_create(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_INCOMING_SESSION_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_INCOMING_SESSION_EVENT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_handle_incoming_session_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_OUTER_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_HANDLE_OUTER_EVENT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_handle_outer_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_KNOWN_SENDER_EVENT_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_KNOWN_SENDER_EVENT_PUBKEYS +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_known_sender_event_pubkeys(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_OUTER_SUBSCRIPTION_PLAN +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_OUTER_SUBSCRIPTION_PLAN +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_outer_subscription_plan(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_REMOVE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_REMOVE +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_remove(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_SEND_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_SEND_EVENT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_send_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_UPSERT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_GROUP_UPSERT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_upsert(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_IMPORT_SESSION_STATE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_IMPORT_SESSION_STATE +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_import_session_state(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_INIT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_INIT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_init(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_KNOWN_PEER_OWNER_PUBKEYS +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_KNOWN_PEER_OWNER_PUBKEYS +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_known_peer_owner_pubkeys(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_PROCESS_EVENT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_PROCESS_EVENT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_process_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_EVENT_WITH_INNER_ID +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_EVENT_WITH_INNER_ID +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_event_with_inner_id(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_REACTION +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_REACTION +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_reaction(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_RECEIPT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_RECEIPT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_receipt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_RUMOR_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_RUMOR_JSON +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_rumor_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_text(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT_WITH_INNER_ID +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_TEXT_WITH_INNER_ID +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_text_with_inner_id(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_TYPING +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SEND_TYPING +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_typing(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SETUP_USER +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_METHOD_SESSIONMANAGERHANDLE_SETUP_USER +uint16_t uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_setup_user(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_CREATE_NEW +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_CREATE_NEW +uint16_t uniffi_ndr_ffi_checksum_constructor_invitehandle_create_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_DESERIALIZE +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_DESERIALIZE +uint16_t uniffi_ndr_ffi_checksum_constructor_invitehandle_deserialize(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_FROM_EVENT_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_FROM_EVENT_JSON +uint16_t uniffi_ndr_ffi_checksum_constructor_invitehandle_from_event_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_FROM_URL +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_INVITEHANDLE_FROM_URL +uint16_t uniffi_ndr_ffi_checksum_constructor_invitehandle_from_url(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONHANDLE_FROM_STATE_JSON +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONHANDLE_FROM_STATE_JSON +uint16_t uniffi_ndr_ffi_checksum_constructor_sessionhandle_from_state_json(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONHANDLE_INIT +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONHANDLE_INIT +uint16_t uniffi_ndr_ffi_checksum_constructor_sessionhandle_init(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW +uint16_t uniffi_ndr_ffi_checksum_constructor_sessionmanagerhandle_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW_WITH_STORAGE_PATH +#define UNIFFI_FFIDEF_UNIFFI_NDR_FFI_CHECKSUM_CONSTRUCTOR_SESSIONMANAGERHANDLE_NEW_WITH_STORAGE_PATH +uint16_t uniffi_ndr_ffi_checksum_constructor_sessionmanagerhandle_new_with_storage_path(void + +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_NDR_FFI_UNIFFI_CONTRACT_VERSION +#define UNIFFI_FFIDEF_FFI_NDR_FFI_UNIFFI_CONTRACT_VERSION +uint32_t ffi_ndr_ffi_uniffi_contract_version(void + +); +#endif + diff --git a/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/macos-arm64_x86_64/libndr_ffi_macos.a b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/macos-arm64_x86_64/libndr_ffi_macos.a new file mode 100644 index 00000000..a0151fcb Binary files /dev/null and b/localPackages/NdrFfi/Frameworks/NdrFfi.xcframework/macos-arm64_x86_64/libndr_ffi_macos.a differ diff --git a/localPackages/NdrFfi/Package.swift b/localPackages/NdrFfi/Package.swift new file mode 100644 index 00000000..2eac5ed1 --- /dev/null +++ b/localPackages/NdrFfi/Package.swift @@ -0,0 +1,36 @@ +// swift-tools-version: 5.9 + +import PackageDescription + +let package = Package( + name: "NdrFfi", + platforms: [ + .iOS(.v16), + .macOS(.v13) + ], + products: [ + .library( + name: "NdrFfi", + targets: ["NdrFfi"] + ) + ], + targets: [ + // Swift bindings generated by uniffi-bindgen + .target( + name: "NdrFfi", + dependencies: ["ndr_ffiFFI"], + path: "Sources/NdrFfi" + ), + // Binary xcframework built from the ndr-ffi Rust crate + .binaryTarget( + name: "ndr_ffiFFI", + path: "Frameworks/NdrFfi.xcframework" + ), + // Tests + .testTarget( + name: "NdrFfiTests", + dependencies: ["NdrFfi"], + path: "Tests" + ) + ] +) diff --git a/localPackages/NdrFfi/README.md b/localPackages/NdrFfi/README.md new file mode 100644 index 00000000..b8925e5f --- /dev/null +++ b/localPackages/NdrFfi/README.md @@ -0,0 +1,68 @@ +# NdrFfi + +Vendored Swift bindings and Apple XCFramework for the upstream +`nostr-double-ratchet` `ndr-ffi` crate. + +## Source Of Truth + +The generated files in this package come from the upstream +`nostr-double-ratchet` checkout, specifically the Rust `ndr-ffi` crate and its +UniFFI-generated Swift bindings. + +The exact upstream revision used for the currently vendored artifacts is +recorded in `VENDORED_FROM.md`. + +Default expected upstream checkout: + +```bash +$HOME/src/nostr-double-ratchet +``` + +You can also point the build at a different checkout by passing a path or by +setting `NDR_SOURCE_DIR`. + +## Rebuild From Source + +Prerequisites: + +- Xcode and command line tools +- Rust toolchain with cargo +- Rust targets: + - `aarch64-apple-darwin` + - `aarch64-apple-ios` + - `aarch64-apple-ios-sim` + +Example: + +```bash +rustup target add aarch64-apple-darwin aarch64-apple-ios aarch64-apple-ios-sim +cd localPackages/NdrFfi +./build-apple.sh ~/src/nostr-double-ratchet +``` + +Or: + +```bash +cd localPackages/NdrFfi +NDR_SOURCE_DIR=/path/to/nostr-double-ratchet ./build-apple.sh +``` + +The script: + +- builds the upstream `ndr-ffi` crate +- regenerates `Sources/NdrFfi/NdrFfi.swift` via UniFFI +- rebuilds the Apple XCFramework at `Frameworks/NdrFfi.xcframework` +- bakes in the current Apple deployment targets used by `bitchat` + +## Outputs Updated By The Script + +- `Sources/NdrFfi/NdrFfi.swift` +- `Frameworks/NdrFfi.xcframework` + +## Recommended Verification + +```bash +swift test --package-path localPackages/NdrFfi +swift test --filter NdrOutOfBandTransportTests +swift test --filter NostrTransportTests +``` diff --git a/localPackages/NdrFfi/Sources/NdrFfi/NdrFfi.swift b/localPackages/NdrFfi/Sources/NdrFfi/NdrFfi.swift new file mode 100644 index 00000000..69b39ec5 --- /dev/null +++ b/localPackages/NdrFfi/Sources/NdrFfi/NdrFfi.swift @@ -0,0 +1,3750 @@ +// This file was autogenerated by some hot garbage in the `uniffi` crate. +// Trust me, you don't want to mess with it! + +// swiftlint:disable all +import Foundation + +// Depending on the consumer's build setup, the low-level FFI code +// might be in a separate module, or it might be compiled inline into +// this module. This is a bit of light hackery to work with both. +#if canImport(ndr_ffiFFI) +import ndr_ffiFFI +#endif + +fileprivate extension RustBuffer { + // Allocate a new buffer, copying the contents of a `UInt8` array. + init(bytes: [UInt8]) { + let rbuf = bytes.withUnsafeBufferPointer { ptr in + RustBuffer.from(ptr) + } + self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data) + } + + static func empty() -> RustBuffer { + RustBuffer(capacity: 0, len:0, data: nil) + } + + static func from(_ ptr: UnsafeBufferPointer) -> RustBuffer { + try! rustCall { ffi_ndr_ffi_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) } + } + + // Frees the buffer in place. + // The buffer must not be used after this is called. + func deallocate() { + try! rustCall { ffi_ndr_ffi_rustbuffer_free(self, $0) } + } +} + +fileprivate extension ForeignBytes { + init(bufferPointer: UnsafeBufferPointer) { + self.init(len: Int32(bufferPointer.count), data: bufferPointer.baseAddress) + } +} + +// For every type used in the interface, we provide helper methods for conveniently +// lifting and lowering that type from C-compatible data, and for reading and writing +// values of that type in a buffer. + +// Helper classes/extensions that don't change. +// Someday, this will be in a library of its own. + +fileprivate extension Data { + init(rustBuffer: RustBuffer) { + self.init( + bytesNoCopy: rustBuffer.data!, + count: Int(rustBuffer.len), + deallocator: .none + ) + } +} + +// Define reader functionality. Normally this would be defined in a class or +// struct, but we use standalone functions instead in order to make external +// types work. +// +// With external types, one swift source file needs to be able to call the read +// method on another source file's FfiConverter, but then what visibility +// should Reader have? +// - If Reader is fileprivate, then this means the read() must also +// be fileprivate, which doesn't work with external types. +// - If Reader is internal/public, we'll get compile errors since both source +// files will try define the same type. +// +// Instead, the read() method and these helper functions input a tuple of data + +fileprivate func createReader(data: Data) -> (data: Data, offset: Data.Index) { + (data: data, offset: 0) +} + +// Reads an integer at the current offset, in big-endian order, and advances +// the offset on success. Throws if reading the integer would move the +// offset past the end of the buffer. +fileprivate func readInt(_ reader: inout (data: Data, offset: Data.Index)) throws -> T { + let range = reader.offset...size + guard reader.data.count >= range.upperBound else { + throw UniffiInternalError.bufferOverflow + } + if T.self == UInt8.self { + let value = reader.data[reader.offset] + reader.offset += 1 + return value as! T + } + var value: T = 0 + let _ = withUnsafeMutableBytes(of: &value, { reader.data.copyBytes(to: $0, from: range)}) + reader.offset = range.upperBound + return value.bigEndian +} + +// Reads an arbitrary number of bytes, to be used to read +// raw bytes, this is useful when lifting strings +fileprivate func readBytes(_ reader: inout (data: Data, offset: Data.Index), count: Int) throws -> Array { + let range = reader.offset..<(reader.offset+count) + guard reader.data.count >= range.upperBound else { + throw UniffiInternalError.bufferOverflow + } + var value = [UInt8](repeating: 0, count: count) + value.withUnsafeMutableBufferPointer({ buffer in + reader.data.copyBytes(to: buffer, from: range) + }) + reader.offset = range.upperBound + return value +} + +// Reads a float at the current offset. +fileprivate func readFloat(_ reader: inout (data: Data, offset: Data.Index)) throws -> Float { + return Float(bitPattern: try readInt(&reader)) +} + +// Reads a float at the current offset. +fileprivate func readDouble(_ reader: inout (data: Data, offset: Data.Index)) throws -> Double { + return Double(bitPattern: try readInt(&reader)) +} + +// Indicates if the offset has reached the end of the buffer. +fileprivate func hasRemaining(_ reader: (data: Data, offset: Data.Index)) -> Bool { + return reader.offset < reader.data.count +} + +// Define writer functionality. Normally this would be defined in a class or +// struct, but we use standalone functions instead in order to make external +// types work. See the above discussion on Readers for details. + +fileprivate func createWriter() -> [UInt8] { + return [] +} + +fileprivate func writeBytes(_ writer: inout [UInt8], _ byteArr: S) where S: Sequence, S.Element == UInt8 { + writer.append(contentsOf: byteArr) +} + +// Writes an integer in big-endian order. +// +// Warning: make sure what you are trying to write +// is in the correct type! +fileprivate func writeInt(_ writer: inout [UInt8], _ value: T) { + var value = value.bigEndian + withUnsafeBytes(of: &value) { writer.append(contentsOf: $0) } +} + +fileprivate func writeFloat(_ writer: inout [UInt8], _ value: Float) { + writeInt(&writer, value.bitPattern) +} + +fileprivate func writeDouble(_ writer: inout [UInt8], _ value: Double) { + writeInt(&writer, value.bitPattern) +} + +// Protocol for types that transfer other types across the FFI. This is +// analogous to the Rust trait of the same name. +fileprivate protocol FfiConverter { + associatedtype FfiType + associatedtype SwiftType + + static func lift(_ value: FfiType) throws -> SwiftType + static func lower(_ value: SwiftType) -> FfiType + static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType + static func write(_ value: SwiftType, into buf: inout [UInt8]) +} + +// Types conforming to `Primitive` pass themselves directly over the FFI. +fileprivate protocol FfiConverterPrimitive: FfiConverter where FfiType == SwiftType { } + +extension FfiConverterPrimitive { +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public static func lift(_ value: FfiType) throws -> SwiftType { + return value + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public static func lower(_ value: SwiftType) -> FfiType { + return value + } +} + +// Types conforming to `FfiConverterRustBuffer` lift and lower into a `RustBuffer`. +// Used for complex types where it's hard to write a custom lift/lower. +fileprivate protocol FfiConverterRustBuffer: FfiConverter where FfiType == RustBuffer {} + +extension FfiConverterRustBuffer { +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public static func lift(_ buf: RustBuffer) throws -> SwiftType { + var reader = createReader(data: Data(rustBuffer: buf)) + let value = try read(from: &reader) + if hasRemaining(reader) { + throw UniffiInternalError.incompleteData + } + buf.deallocate() + return value + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public static func lower(_ value: SwiftType) -> RustBuffer { + var writer = createWriter() + write(value, into: &writer) + return RustBuffer(bytes: writer) + } +} +// An error type for FFI errors. These errors occur at the UniFFI level, not +// the library level. +fileprivate enum UniffiInternalError: LocalizedError { + case bufferOverflow + case incompleteData + case unexpectedOptionalTag + case unexpectedEnumCase + case unexpectedNullPointer + case unexpectedRustCallStatusCode + case unexpectedRustCallError + case unexpectedStaleHandle + case rustPanic(_ message: String) + + public var errorDescription: String? { + switch self { + case .bufferOverflow: return "Reading the requested value would read past the end of the buffer" + case .incompleteData: return "The buffer still has data after lifting its containing value" + case .unexpectedOptionalTag: return "Unexpected optional tag; should be 0 or 1" + case .unexpectedEnumCase: return "Raw enum value doesn't match any cases" + case .unexpectedNullPointer: return "Raw pointer value was null" + case .unexpectedRustCallStatusCode: return "Unexpected RustCallStatus code" + case .unexpectedRustCallError: return "CALL_ERROR but no errorClass specified" + case .unexpectedStaleHandle: return "The object in the handle map has been dropped already" + case let .rustPanic(message): return message + } + } +} + +fileprivate extension NSLock { + func withLock(f: () throws -> T) rethrows -> T { + self.lock() + defer { self.unlock() } + return try f() + } +} + +fileprivate let CALL_SUCCESS: Int8 = 0 +fileprivate let CALL_ERROR: Int8 = 1 +fileprivate let CALL_UNEXPECTED_ERROR: Int8 = 2 +fileprivate let CALL_CANCELLED: Int8 = 3 + +fileprivate extension RustCallStatus { + init() { + self.init( + code: CALL_SUCCESS, + errorBuf: RustBuffer.init( + capacity: 0, + len: 0, + data: nil + ) + ) + } +} + +private func rustCall(_ callback: (UnsafeMutablePointer) -> T) throws -> T { + let neverThrow: ((RustBuffer) throws -> Never)? = nil + return try makeRustCall(callback, errorHandler: neverThrow) +} + +private func rustCallWithError( + _ errorHandler: @escaping (RustBuffer) throws -> E, + _ callback: (UnsafeMutablePointer) -> T) throws -> T { + try makeRustCall(callback, errorHandler: errorHandler) +} + +private func makeRustCall( + _ callback: (UnsafeMutablePointer) -> T, + errorHandler: ((RustBuffer) throws -> E)? +) throws -> T { + uniffiEnsureInitialized() + var callStatus = RustCallStatus.init() + let returnedVal = callback(&callStatus) + try uniffiCheckCallStatus(callStatus: callStatus, errorHandler: errorHandler) + return returnedVal +} + +private func uniffiCheckCallStatus( + callStatus: RustCallStatus, + errorHandler: ((RustBuffer) throws -> E)? +) throws { + switch callStatus.code { + case CALL_SUCCESS: + return + + case CALL_ERROR: + if let errorHandler = errorHandler { + throw try errorHandler(callStatus.errorBuf) + } else { + callStatus.errorBuf.deallocate() + throw UniffiInternalError.unexpectedRustCallError + } + + case CALL_UNEXPECTED_ERROR: + // When the rust code sees a panic, it tries to construct a RustBuffer + // with the message. But if that code panics, then it just sends back + // an empty buffer. + if callStatus.errorBuf.len > 0 { + throw UniffiInternalError.rustPanic(try FfiConverterString.lift(callStatus.errorBuf)) + } else { + callStatus.errorBuf.deallocate() + throw UniffiInternalError.rustPanic("Rust panic") + } + + case CALL_CANCELLED: + fatalError("Cancellation not supported yet") + + default: + throw UniffiInternalError.unexpectedRustCallStatusCode + } +} + +private func uniffiTraitInterfaceCall( + callStatus: UnsafeMutablePointer, + makeCall: () throws -> T, + writeReturn: (T) -> () +) { + do { + try writeReturn(makeCall()) + } catch let error { + callStatus.pointee.code = CALL_UNEXPECTED_ERROR + callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error)) + } +} + +private func uniffiTraitInterfaceCallWithError( + callStatus: UnsafeMutablePointer, + makeCall: () throws -> T, + writeReturn: (T) -> (), + lowerError: (E) -> RustBuffer +) { + do { + try writeReturn(makeCall()) + } catch let error as E { + callStatus.pointee.code = CALL_ERROR + callStatus.pointee.errorBuf = lowerError(error) + } catch { + callStatus.pointee.code = CALL_UNEXPECTED_ERROR + callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error)) + } +} +fileprivate class UniffiHandleMap { + private var map: [UInt64: T] = [:] + private let lock = NSLock() + private var currentHandle: UInt64 = 1 + + func insert(obj: T) -> UInt64 { + lock.withLock { + let handle = currentHandle + currentHandle += 1 + map[handle] = obj + return handle + } + } + + func get(handle: UInt64) throws -> T { + try lock.withLock { + guard let obj = map[handle] else { + throw UniffiInternalError.unexpectedStaleHandle + } + return obj + } + } + + @discardableResult + func remove(handle: UInt64) throws -> T { + try lock.withLock { + guard let obj = map.removeValue(forKey: handle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return obj + } + } + + var count: Int { + get { + map.count + } + } +} + + +// Public interface members begin here. + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterUInt32: FfiConverterPrimitive { + typealias FfiType = UInt32 + typealias SwiftType = UInt32 + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UInt32 { + return try lift(readInt(&buf)) + } + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterUInt64: FfiConverterPrimitive { + typealias FfiType = UInt64 + typealias SwiftType = UInt64 + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UInt64 { + return try lift(readInt(&buf)) + } + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterBool : FfiConverter { + typealias FfiType = Int8 + typealias SwiftType = Bool + + public static func lift(_ value: Int8) throws -> Bool { + return value != 0 + } + + public static func lower(_ value: Bool) -> Int8 { + return value ? 1 : 0 + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Bool { + return try lift(readInt(&buf)) + } + + public static func write(_ value: Bool, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterString: FfiConverter { + typealias SwiftType = String + typealias FfiType = RustBuffer + + public static func lift(_ value: RustBuffer) throws -> String { + defer { + value.deallocate() + } + if value.data == nil { + return String() + } + let bytes = UnsafeBufferPointer(start: value.data!, count: Int(value.len)) + return String(bytes: bytes, encoding: String.Encoding.utf8)! + } + + public static func lower(_ value: String) -> RustBuffer { + return value.utf8CString.withUnsafeBufferPointer { ptr in + // The swift string gives us int8_t, we want uint8_t. + ptr.withMemoryRebound(to: UInt8.self) { ptr in + // The swift string gives us a trailing null byte, we don't want it. + let buf = UnsafeBufferPointer(rebasing: ptr.prefix(upTo: ptr.count - 1)) + return RustBuffer.from(buf) + } + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> String { + let len: Int32 = try readInt(&buf) + return String(bytes: try readBytes(&buf, count: Int(len)), encoding: String.Encoding.utf8)! + } + + public static func write(_ value: String, into buf: inout [UInt8]) { + let len = Int32(value.utf8.count) + writeInt(&buf, len) + writeBytes(&buf, value.utf8) + } +} + + + + +/** + * FFI wrapper for Invite. + */ +public protocol InviteHandleProtocol : AnyObject { + + /** + * Accept the invite and create a session. + */ + func accept(inviteePubkeyHex: String, inviteePrivkeyHex: String, deviceId: String?) throws -> InviteAcceptResult + + /** + * Accept the invite as an owner and include the owner pubkey in the response payload. + */ + func acceptWithOwner(inviteePubkeyHex: String, inviteePrivkeyHex: String, deviceId: String?, ownerPubkeyHex: String?) throws -> InviteAcceptResult + + /** + * Get the inviter's public key as hex. + */ + func getInviterPubkeyHex() -> String + + /** + * Get the shared secret as hex. + */ + func getSharedSecretHex() -> String + + /** + * Process an invite response event and create a session (inviter side). + * + * Returns `None` if the event is not a valid response for this invite. + */ + func processResponse(eventJson: String, inviterPrivkeyHex: String) throws -> InviteProcessResult? + + /** + * Serialize the invite to JSON for persistence. + */ + func serialize() throws -> String + + /** + * Update the owner pubkey embedded in invite URLs. + */ + func setOwnerPubkeyHex(ownerPubkeyHex: String?) throws + + /** + * Update the invite purpose (e.g. \"link\"). + */ + func setPurpose(purpose: String?) + + /** + * Convert the invite to a Nostr event JSON. + */ + func toEventJson() throws -> String + + /** + * Convert the invite to a shareable URL. + */ + func toUrl(root: String) throws -> String + +} + +/** + * FFI wrapper for Invite. + */ +open class InviteHandle: + InviteHandleProtocol { + fileprivate let pointer: UnsafeMutableRawPointer! + + /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public struct NoPointer { + public init() {} + } + + // TODO: We'd like this to be `private` but for Swifty reasons, + // we can't implement `FfiConverter` without making this `required` and we can't + // make it `required` without making it `public`. + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + self.pointer = pointer + } + + // This constructor can be used to instantiate a fake object. + // - Parameter noPointer: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. + // + // - Warning: + // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public func uniffiClonePointer() -> UnsafeMutableRawPointer { + return try! rustCall { uniffi_ndr_ffi_fn_clone_invitehandle(self.pointer, $0) } + } + // No primary constructor declared for this class. + + deinit { + guard let pointer = pointer else { + return + } + + try! rustCall { uniffi_ndr_ffi_fn_free_invitehandle(pointer, $0) } + } + + + /** + * Create a new invite. + */ +public static func createNew(inviterPubkeyHex: String, deviceId: String?, maxUses: UInt32?)throws -> InviteHandle { + return try FfiConverterTypeInviteHandle.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_constructor_invitehandle_create_new( + FfiConverterString.lower(inviterPubkeyHex), + FfiConverterOptionString.lower(deviceId), + FfiConverterOptionUInt32.lower(maxUses),$0 + ) +}) +} + + /** + * Deserialize an invite from JSON. + */ +public static func deserialize(json: String)throws -> InviteHandle { + return try FfiConverterTypeInviteHandle.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_constructor_invitehandle_deserialize( + FfiConverterString.lower(json),$0 + ) +}) +} + + /** + * Parse an invite from a Nostr event JSON. + */ +public static func fromEventJson(eventJson: String)throws -> InviteHandle { + return try FfiConverterTypeInviteHandle.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_constructor_invitehandle_from_event_json( + FfiConverterString.lower(eventJson),$0 + ) +}) +} + + /** + * Parse an invite from a URL. + */ +public static func fromUrl(url: String)throws -> InviteHandle { + return try FfiConverterTypeInviteHandle.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_constructor_invitehandle_from_url( + FfiConverterString.lower(url),$0 + ) +}) +} + + + + /** + * Accept the invite and create a session. + */ +open func accept(inviteePubkeyHex: String, inviteePrivkeyHex: String, deviceId: String?)throws -> InviteAcceptResult { + return try FfiConverterTypeInviteAcceptResult.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_invitehandle_accept(self.uniffiClonePointer(), + FfiConverterString.lower(inviteePubkeyHex), + FfiConverterString.lower(inviteePrivkeyHex), + FfiConverterOptionString.lower(deviceId),$0 + ) +}) +} + + /** + * Accept the invite as an owner and include the owner pubkey in the response payload. + */ +open func acceptWithOwner(inviteePubkeyHex: String, inviteePrivkeyHex: String, deviceId: String?, ownerPubkeyHex: String?)throws -> InviteAcceptResult { + return try FfiConverterTypeInviteAcceptResult.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_invitehandle_accept_with_owner(self.uniffiClonePointer(), + FfiConverterString.lower(inviteePubkeyHex), + FfiConverterString.lower(inviteePrivkeyHex), + FfiConverterOptionString.lower(deviceId), + FfiConverterOptionString.lower(ownerPubkeyHex),$0 + ) +}) +} + + /** + * Get the inviter's public key as hex. + */ +open func getInviterPubkeyHex() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_ndr_ffi_fn_method_invitehandle_get_inviter_pubkey_hex(self.uniffiClonePointer(),$0 + ) +}) +} + + /** + * Get the shared secret as hex. + */ +open func getSharedSecretHex() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_ndr_ffi_fn_method_invitehandle_get_shared_secret_hex(self.uniffiClonePointer(),$0 + ) +}) +} + + /** + * Process an invite response event and create a session (inviter side). + * + * Returns `None` if the event is not a valid response for this invite. + */ +open func processResponse(eventJson: String, inviterPrivkeyHex: String)throws -> InviteProcessResult? { + return try FfiConverterOptionTypeInviteProcessResult.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_invitehandle_process_response(self.uniffiClonePointer(), + FfiConverterString.lower(eventJson), + FfiConverterString.lower(inviterPrivkeyHex),$0 + ) +}) +} + + /** + * Serialize the invite to JSON for persistence. + */ +open func serialize()throws -> String { + return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_invitehandle_serialize(self.uniffiClonePointer(),$0 + ) +}) +} + + /** + * Update the owner pubkey embedded in invite URLs. + */ +open func setOwnerPubkeyHex(ownerPubkeyHex: String?)throws {try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_invitehandle_set_owner_pubkey_hex(self.uniffiClonePointer(), + FfiConverterOptionString.lower(ownerPubkeyHex),$0 + ) +} +} + + /** + * Update the invite purpose (e.g. \"link\"). + */ +open func setPurpose(purpose: String?) {try! rustCall() { + uniffi_ndr_ffi_fn_method_invitehandle_set_purpose(self.uniffiClonePointer(), + FfiConverterOptionString.lower(purpose),$0 + ) +} +} + + /** + * Convert the invite to a Nostr event JSON. + */ +open func toEventJson()throws -> String { + return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_invitehandle_to_event_json(self.uniffiClonePointer(),$0 + ) +}) +} + + /** + * Convert the invite to a shareable URL. + */ +open func toUrl(root: String)throws -> String { + return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_invitehandle_to_url(self.uniffiClonePointer(), + FfiConverterString.lower(root),$0 + ) +}) +} + + +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeInviteHandle: FfiConverter { + + typealias FfiType = UnsafeMutableRawPointer + typealias SwiftType = InviteHandle + + public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> InviteHandle { + return InviteHandle(unsafeFromRawPointer: pointer) + } + + public static func lower(_ value: InviteHandle) -> UnsafeMutableRawPointer { + return value.uniffiClonePointer() + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> InviteHandle { + let v: UInt64 = try readInt(&buf) + // The Rust code won't compile if a pointer won't fit in a UInt64. + // We have to go via `UInt` because that's the thing that's the size of a pointer. + let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) + if (ptr == nil) { + throw UniffiInternalError.unexpectedNullPointer + } + return try lift(ptr!) + } + + public static func write(_ value: InviteHandle, into buf: inout [UInt8]) { + // This fiddling is because `Int` is the thing that's the same size as a pointer. + // The Rust code won't compile if a pointer won't fit in a `UInt64`. + writeInt(&buf, UInt64(bitPattern: Int64(Int(bitPattern: lower(value))))) + } +} + + + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeInviteHandle_lift(_ pointer: UnsafeMutableRawPointer) throws -> InviteHandle { + return try FfiConverterTypeInviteHandle.lift(pointer) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeInviteHandle_lower(_ value: InviteHandle) -> UnsafeMutableRawPointer { + return FfiConverterTypeInviteHandle.lower(value) +} + + + + +/** + * FFI wrapper for Session. + */ +public protocol SessionHandleProtocol : AnyObject { + + /** + * Check if the session is ready to send messages. + */ + func canSend() -> Bool + + /** + * Decrypt a received event. + */ + func decryptEvent(outerEventJson: String) throws -> DecryptResult + + /** + * Check if an event is a double-ratchet message. + */ + func isDrMessage(eventJson: String) -> Bool + + /** + * Send a text message. + */ + func sendText(text: String) throws -> SendResult + + /** + * Serialize the session state to JSON. + */ + func stateJson() throws -> String + +} + +/** + * FFI wrapper for Session. + */ +open class SessionHandle: + SessionHandleProtocol { + fileprivate let pointer: UnsafeMutableRawPointer! + + /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public struct NoPointer { + public init() {} + } + + // TODO: We'd like this to be `private` but for Swifty reasons, + // we can't implement `FfiConverter` without making this `required` and we can't + // make it `required` without making it `public`. + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + self.pointer = pointer + } + + // This constructor can be used to instantiate a fake object. + // - Parameter noPointer: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. + // + // - Warning: + // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public func uniffiClonePointer() -> UnsafeMutableRawPointer { + return try! rustCall { uniffi_ndr_ffi_fn_clone_sessionhandle(self.pointer, $0) } + } + // No primary constructor declared for this class. + + deinit { + guard let pointer = pointer else { + return + } + + try! rustCall { uniffi_ndr_ffi_fn_free_sessionhandle(pointer, $0) } + } + + + /** + * Restore a session from serialized state JSON. + */ +public static func fromStateJson(stateJson: String)throws -> SessionHandle { + return try FfiConverterTypeSessionHandle.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_constructor_sessionhandle_from_state_json( + FfiConverterString.lower(stateJson),$0 + ) +}) +} + + /** + * Initialize a new session. + */ +public static func `init`(theirEphemeralPubkeyHex: String, ourEphemeralPrivkeyHex: String, isInitiator: Bool, sharedSecretHex: String, name: String?)throws -> SessionHandle { + return try FfiConverterTypeSessionHandle.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_constructor_sessionhandle_init( + FfiConverterString.lower(theirEphemeralPubkeyHex), + FfiConverterString.lower(ourEphemeralPrivkeyHex), + FfiConverterBool.lower(isInitiator), + FfiConverterString.lower(sharedSecretHex), + FfiConverterOptionString.lower(name),$0 + ) +}) +} + + + + /** + * Check if the session is ready to send messages. + */ +open func canSend() -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_ndr_ffi_fn_method_sessionhandle_can_send(self.uniffiClonePointer(),$0 + ) +}) +} + + /** + * Decrypt a received event. + */ +open func decryptEvent(outerEventJson: String)throws -> DecryptResult { + return try FfiConverterTypeDecryptResult.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionhandle_decrypt_event(self.uniffiClonePointer(), + FfiConverterString.lower(outerEventJson),$0 + ) +}) +} + + /** + * Check if an event is a double-ratchet message. + */ +open func isDrMessage(eventJson: String) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_ndr_ffi_fn_method_sessionhandle_is_dr_message(self.uniffiClonePointer(), + FfiConverterString.lower(eventJson),$0 + ) +}) +} + + /** + * Send a text message. + */ +open func sendText(text: String)throws -> SendResult { + return try FfiConverterTypeSendResult.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionhandle_send_text(self.uniffiClonePointer(), + FfiConverterString.lower(text),$0 + ) +}) +} + + /** + * Serialize the session state to JSON. + */ +open func stateJson()throws -> String { + return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionhandle_state_json(self.uniffiClonePointer(),$0 + ) +}) +} + + +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeSessionHandle: FfiConverter { + + typealias FfiType = UnsafeMutableRawPointer + typealias SwiftType = SessionHandle + + public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> SessionHandle { + return SessionHandle(unsafeFromRawPointer: pointer) + } + + public static func lower(_ value: SessionHandle) -> UnsafeMutableRawPointer { + return value.uniffiClonePointer() + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SessionHandle { + let v: UInt64 = try readInt(&buf) + // The Rust code won't compile if a pointer won't fit in a UInt64. + // We have to go via `UInt` because that's the thing that's the size of a pointer. + let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) + if (ptr == nil) { + throw UniffiInternalError.unexpectedNullPointer + } + return try lift(ptr!) + } + + public static func write(_ value: SessionHandle, into buf: inout [UInt8]) { + // This fiddling is because `Int` is the thing that's the same size as a pointer. + // The Rust code won't compile if a pointer won't fit in a `UInt64`. + writeInt(&buf, UInt64(bitPattern: Int64(Int(bitPattern: lower(value))))) + } +} + + + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeSessionHandle_lift(_ pointer: UnsafeMutableRawPointer) throws -> SessionHandle { + return try FfiConverterTypeSessionHandle.lift(pointer) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeSessionHandle_lower(_ value: SessionHandle) -> UnsafeMutableRawPointer { + return FfiConverterTypeSessionHandle.lower(value) +} + + + + +/** + * FFI wrapper for SessionManager. + */ +public protocol SessionManagerHandleProtocol : AnyObject { + + /** + * Accept an invite event JSON using SessionManager's owner-aware routing/auth checks. + */ + func acceptInviteFromEventJson(eventJson: String, ownerPubkeyHintHex: String?) throws -> SessionManagerAcceptInviteResult + + /** + * Accept an invite URL using SessionManager's owner-aware routing/auth checks. + * + * This flow also emits the signed invite response via SessionManager pubsub events, + * so hosts should continue draining and publishing `publish_signed` events. + */ + func acceptInviteFromUrl(inviteUrl: String, ownerPubkeyHintHex: String?) throws -> SessionManagerAcceptInviteResult + + /** + * Drain pending pubsub events from the internal queue. + */ + func drainEvents() throws -> [PubSubEvent] + + /** + * Export the active session state for a peer. + */ + func getActiveSessionState(peerPubkeyHex: String) throws -> String? + + /** + * Get our device id. + */ + func getDeviceId() -> String + + /** + * Return the tracked message-push author pubkeys for a peer owner. + */ + func getMessagePushAuthorPubkeys(peerOwnerPubkeyHex: String) throws -> [String] + + /** + * Return pairwise session snapshots used for message-push routing for a peer owner. + */ + func getMessagePushSessionStates(peerOwnerPubkeyHex: String) throws -> [MessagePushSessionStateResult] + + /** + * Get our public key as hex. + */ + func getOurPubkeyHex() -> String + + /** + * Get owner public key as hex. + */ + func getOwnerPubkeyHex() -> String + + /** + * Return the persisted user-record snapshot JSON for a peer owner, if present. + */ + func getStoredUserRecordJson(peerOwnerPubkeyHex: String) throws -> String? + + /** + * Get total active sessions. + */ + func getTotalSessions() -> UInt64 + + /** + * Create a group through the embedded GroupManager, with optional metadata fanout. + */ + func groupCreate(name: String, memberOwnerPubkeys: [String], fanoutMetadata: Bool?, nowMs: UInt64?) throws -> GroupCreateResult + + /** + * Handle a decrypted pairwise session rumor that may carry sender-key distribution. + */ + func groupHandleIncomingSessionEvent(eventJson: String, fromOwnerPubkeyHex: String, fromSenderDevicePubkeyHex: String?) throws -> [GroupDecryptedResult] + + /** + * Handle an incoming relay event that may be an encrypted one-to-many group outer event. + */ + func groupHandleOuterEvent(eventJson: String) throws -> GroupDecryptedResult? + + /** + * Return known sender-event pubkeys used for one-to-many group transport. + */ + func groupKnownSenderEventPubkeys() -> [String] + + /** + * Return the current group outer authors and which ones were newly added + * since the last sync plan request for this handle. + */ + func groupOuterSubscriptionPlan() -> GroupOuterSubscriptionPlanResult + + /** + * Remove a group from the embedded GroupManager. + */ + func groupRemove(groupId: String) + + /** + * Send a group event through GroupManager. + * + * Pairwise sender-key distribution rumors are sent through SessionManager sessions. + * The encrypted one-to-many outer event is emitted via the SessionManager pubsub queue. + */ + func groupSendEvent(groupId: String, kind: UInt32, content: String, tagsJson: String, nowMs: UInt64?) throws -> GroupSendResult + + /** + * Upsert group metadata into the embedded GroupManager. + */ + func groupUpsert(group: FfiGroupData) throws + + /** + * Import a session state for a peer. + */ + func importSessionState(peerPubkeyHex: String, stateJson: String, deviceId: String?) throws + + /** + * Initialize the session manager (loads state, creates device invite, subscribes). + */ + func `init`() throws + + /** + * List peer owner pubkeys known from loaded state or persisted storage. + */ + func knownPeerOwnerPubkeys() -> [String] + + /** + * Process a received Nostr event JSON. + */ + func processEvent(eventJson: String) throws + + /** + * Send an arbitrary inner rumor event to a recipient, returning stable inner id + outer ids. + * + * This is used for group chats where we need custom kinds/tags (e.g. group metadata kind 40, + * group-tagged chat messages kind 14, reactions kind 7, typing kind 25). + * + * The caller controls the inner rumor tags via `tags_json` (JSON array of string arrays). + * For group fan-out, do NOT include recipient-specific tags like `["p", ]` so + * the inner rumor id stays stable across all recipients. + */ + func sendEventWithInnerId(recipientPubkeyHex: String, kind: UInt32, content: String, tagsJson: String, createdAtSeconds: UInt64?) throws -> SendTextResult + + /** + * Send an emoji reaction (kind 7) to a specific message id. + */ + func sendReaction(recipientPubkeyHex: String, messageId: String, emoji: String, expiresAtSeconds: UInt64?) throws -> [String] + + /** + * Send a delivery/read receipt for messages. + */ + func sendReceipt(recipientPubkeyHex: String, receiptType: String, messageIds: [String], expiresAtSeconds: UInt64?) throws -> [String] + + /** + * Send an already-built rumor JSON to a recipient without rebuilding it. + * + * This preserves the original rumor pubkey, timestamp, tags, and id. + */ + func sendRumorJson(recipientPubkeyHex: String, rumorJson: String) throws -> SendTextResult + + /** + * Send a text message to a recipient. + */ + func sendText(recipientPubkeyHex: String, text: String, expiresAtSeconds: UInt64?) throws -> [String] + + /** + * Send a text message and return both the stable inner (rumor) id and the + * list of outer message event ids that were published. + */ + func sendTextWithInnerId(recipientPubkeyHex: String, text: String, expiresAtSeconds: UInt64?) throws -> SendTextResult + + /** + * Send a typing indicator. + */ + func sendTyping(recipientPubkeyHex: String, expiresAtSeconds: UInt64?) throws -> [String] + + /** + * Subscribe to a user's AppKeys/device-invite streams and converge sessions. + */ + func setupUser(userPubkeyHex: String) throws + +} + +/** + * FFI wrapper for SessionManager. + */ +open class SessionManagerHandle: + SessionManagerHandleProtocol { + fileprivate let pointer: UnsafeMutableRawPointer! + + /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public struct NoPointer { + public init() {} + } + + // TODO: We'd like this to be `private` but for Swifty reasons, + // we can't implement `FfiConverter` without making this `required` and we can't + // make it `required` without making it `public`. + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + self.pointer = pointer + } + + // This constructor can be used to instantiate a fake object. + // - Parameter noPointer: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. + // + // - Warning: + // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public func uniffiClonePointer() -> UnsafeMutableRawPointer { + return try! rustCall { uniffi_ndr_ffi_fn_clone_sessionmanagerhandle(self.pointer, $0) } + } + /** + * Create a new session manager with an internal event queue. + */ +public convenience init(ourPubkeyHex: String, ourIdentityPrivkeyHex: String, deviceId: String, ownerPubkeyHex: String?)throws { + let pointer = + try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_constructor_sessionmanagerhandle_new( + FfiConverterString.lower(ourPubkeyHex), + FfiConverterString.lower(ourIdentityPrivkeyHex), + FfiConverterString.lower(deviceId), + FfiConverterOptionString.lower(ownerPubkeyHex),$0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} + + deinit { + guard let pointer = pointer else { + return + } + + try! rustCall { uniffi_ndr_ffi_fn_free_sessionmanagerhandle(pointer, $0) } + } + + + /** + * Create a new session manager with file-backed storage. + */ +public static func newWithStoragePath(ourPubkeyHex: String, ourIdentityPrivkeyHex: String, deviceId: String, storagePath: String, ownerPubkeyHex: String?)throws -> SessionManagerHandle { + return try FfiConverterTypeSessionManagerHandle.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_constructor_sessionmanagerhandle_new_with_storage_path( + FfiConverterString.lower(ourPubkeyHex), + FfiConverterString.lower(ourIdentityPrivkeyHex), + FfiConverterString.lower(deviceId), + FfiConverterString.lower(storagePath), + FfiConverterOptionString.lower(ownerPubkeyHex),$0 + ) +}) +} + + + + /** + * Accept an invite event JSON using SessionManager's owner-aware routing/auth checks. + */ +open func acceptInviteFromEventJson(eventJson: String, ownerPubkeyHintHex: String?)throws -> SessionManagerAcceptInviteResult { + return try FfiConverterTypeSessionManagerAcceptInviteResult.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_accept_invite_from_event_json(self.uniffiClonePointer(), + FfiConverterString.lower(eventJson), + FfiConverterOptionString.lower(ownerPubkeyHintHex),$0 + ) +}) +} + + /** + * Accept an invite URL using SessionManager's owner-aware routing/auth checks. + * + * This flow also emits the signed invite response via SessionManager pubsub events, + * so hosts should continue draining and publishing `publish_signed` events. + */ +open func acceptInviteFromUrl(inviteUrl: String, ownerPubkeyHintHex: String?)throws -> SessionManagerAcceptInviteResult { + return try FfiConverterTypeSessionManagerAcceptInviteResult.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_accept_invite_from_url(self.uniffiClonePointer(), + FfiConverterString.lower(inviteUrl), + FfiConverterOptionString.lower(ownerPubkeyHintHex),$0 + ) +}) +} + + /** + * Drain pending pubsub events from the internal queue. + */ +open func drainEvents()throws -> [PubSubEvent] { + return try FfiConverterSequenceTypePubSubEvent.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_drain_events(self.uniffiClonePointer(),$0 + ) +}) +} + + /** + * Export the active session state for a peer. + */ +open func getActiveSessionState(peerPubkeyHex: String)throws -> String? { + return try FfiConverterOptionString.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_active_session_state(self.uniffiClonePointer(), + FfiConverterString.lower(peerPubkeyHex),$0 + ) +}) +} + + /** + * Get our device id. + */ +open func getDeviceId() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_device_id(self.uniffiClonePointer(),$0 + ) +}) +} + + /** + * Return the tracked message-push author pubkeys for a peer owner. + */ +open func getMessagePushAuthorPubkeys(peerOwnerPubkeyHex: String)throws -> [String] { + return try FfiConverterSequenceString.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_message_push_author_pubkeys(self.uniffiClonePointer(), + FfiConverterString.lower(peerOwnerPubkeyHex),$0 + ) +}) +} + + /** + * Return pairwise session snapshots used for message-push routing for a peer owner. + */ +open func getMessagePushSessionStates(peerOwnerPubkeyHex: String)throws -> [MessagePushSessionStateResult] { + return try FfiConverterSequenceTypeMessagePushSessionStateResult.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_message_push_session_states(self.uniffiClonePointer(), + FfiConverterString.lower(peerOwnerPubkeyHex),$0 + ) +}) +} + + /** + * Get our public key as hex. + */ +open func getOurPubkeyHex() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_our_pubkey_hex(self.uniffiClonePointer(),$0 + ) +}) +} + + /** + * Get owner public key as hex. + */ +open func getOwnerPubkeyHex() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_owner_pubkey_hex(self.uniffiClonePointer(),$0 + ) +}) +} + + /** + * Return the persisted user-record snapshot JSON for a peer owner, if present. + */ +open func getStoredUserRecordJson(peerOwnerPubkeyHex: String)throws -> String? { + return try FfiConverterOptionString.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_stored_user_record_json(self.uniffiClonePointer(), + FfiConverterString.lower(peerOwnerPubkeyHex),$0 + ) +}) +} + + /** + * Get total active sessions. + */ +open func getTotalSessions() -> UInt64 { + return try! FfiConverterUInt64.lift(try! rustCall() { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_get_total_sessions(self.uniffiClonePointer(),$0 + ) +}) +} + + /** + * Create a group through the embedded GroupManager, with optional metadata fanout. + */ +open func groupCreate(name: String, memberOwnerPubkeys: [String], fanoutMetadata: Bool?, nowMs: UInt64?)throws -> GroupCreateResult { + return try FfiConverterTypeGroupCreateResult.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_create(self.uniffiClonePointer(), + FfiConverterString.lower(name), + FfiConverterSequenceString.lower(memberOwnerPubkeys), + FfiConverterOptionBool.lower(fanoutMetadata), + FfiConverterOptionUInt64.lower(nowMs),$0 + ) +}) +} + + /** + * Handle a decrypted pairwise session rumor that may carry sender-key distribution. + */ +open func groupHandleIncomingSessionEvent(eventJson: String, fromOwnerPubkeyHex: String, fromSenderDevicePubkeyHex: String?)throws -> [GroupDecryptedResult] { + return try FfiConverterSequenceTypeGroupDecryptedResult.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_handle_incoming_session_event(self.uniffiClonePointer(), + FfiConverterString.lower(eventJson), + FfiConverterString.lower(fromOwnerPubkeyHex), + FfiConverterOptionString.lower(fromSenderDevicePubkeyHex),$0 + ) +}) +} + + /** + * Handle an incoming relay event that may be an encrypted one-to-many group outer event. + */ +open func groupHandleOuterEvent(eventJson: String)throws -> GroupDecryptedResult? { + return try FfiConverterOptionTypeGroupDecryptedResult.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_handle_outer_event(self.uniffiClonePointer(), + FfiConverterString.lower(eventJson),$0 + ) +}) +} + + /** + * Return known sender-event pubkeys used for one-to-many group transport. + */ +open func groupKnownSenderEventPubkeys() -> [String] { + return try! FfiConverterSequenceString.lift(try! rustCall() { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_known_sender_event_pubkeys(self.uniffiClonePointer(),$0 + ) +}) +} + + /** + * Return the current group outer authors and which ones were newly added + * since the last sync plan request for this handle. + */ +open func groupOuterSubscriptionPlan() -> GroupOuterSubscriptionPlanResult { + return try! FfiConverterTypeGroupOuterSubscriptionPlanResult.lift(try! rustCall() { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_outer_subscription_plan(self.uniffiClonePointer(),$0 + ) +}) +} + + /** + * Remove a group from the embedded GroupManager. + */ +open func groupRemove(groupId: String) {try! rustCall() { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_remove(self.uniffiClonePointer(), + FfiConverterString.lower(groupId),$0 + ) +} +} + + /** + * Send a group event through GroupManager. + * + * Pairwise sender-key distribution rumors are sent through SessionManager sessions. + * The encrypted one-to-many outer event is emitted via the SessionManager pubsub queue. + */ +open func groupSendEvent(groupId: String, kind: UInt32, content: String, tagsJson: String, nowMs: UInt64?)throws -> GroupSendResult { + return try FfiConverterTypeGroupSendResult.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_send_event(self.uniffiClonePointer(), + FfiConverterString.lower(groupId), + FfiConverterUInt32.lower(kind), + FfiConverterString.lower(content), + FfiConverterString.lower(tagsJson), + FfiConverterOptionUInt64.lower(nowMs),$0 + ) +}) +} + + /** + * Upsert group metadata into the embedded GroupManager. + */ +open func groupUpsert(group: FfiGroupData)throws {try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_group_upsert(self.uniffiClonePointer(), + FfiConverterTypeFfiGroupData.lower(group),$0 + ) +} +} + + /** + * Import a session state for a peer. + */ +open func importSessionState(peerPubkeyHex: String, stateJson: String, deviceId: String?)throws {try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_import_session_state(self.uniffiClonePointer(), + FfiConverterString.lower(peerPubkeyHex), + FfiConverterString.lower(stateJson), + FfiConverterOptionString.lower(deviceId),$0 + ) +} +} + + /** + * Initialize the session manager (loads state, creates device invite, subscribes). + */ +open func `init`()throws {try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_init(self.uniffiClonePointer(),$0 + ) +} +} + + /** + * List peer owner pubkeys known from loaded state or persisted storage. + */ +open func knownPeerOwnerPubkeys() -> [String] { + return try! FfiConverterSequenceString.lift(try! rustCall() { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_known_peer_owner_pubkeys(self.uniffiClonePointer(),$0 + ) +}) +} + + /** + * Process a received Nostr event JSON. + */ +open func processEvent(eventJson: String)throws {try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_process_event(self.uniffiClonePointer(), + FfiConverterString.lower(eventJson),$0 + ) +} +} + + /** + * Send an arbitrary inner rumor event to a recipient, returning stable inner id + outer ids. + * + * This is used for group chats where we need custom kinds/tags (e.g. group metadata kind 40, + * group-tagged chat messages kind 14, reactions kind 7, typing kind 25). + * + * The caller controls the inner rumor tags via `tags_json` (JSON array of string arrays). + * For group fan-out, do NOT include recipient-specific tags like `["p", ]` so + * the inner rumor id stays stable across all recipients. + */ +open func sendEventWithInnerId(recipientPubkeyHex: String, kind: UInt32, content: String, tagsJson: String, createdAtSeconds: UInt64?)throws -> SendTextResult { + return try FfiConverterTypeSendTextResult.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_event_with_inner_id(self.uniffiClonePointer(), + FfiConverterString.lower(recipientPubkeyHex), + FfiConverterUInt32.lower(kind), + FfiConverterString.lower(content), + FfiConverterString.lower(tagsJson), + FfiConverterOptionUInt64.lower(createdAtSeconds),$0 + ) +}) +} + + /** + * Send an emoji reaction (kind 7) to a specific message id. + */ +open func sendReaction(recipientPubkeyHex: String, messageId: String, emoji: String, expiresAtSeconds: UInt64?)throws -> [String] { + return try FfiConverterSequenceString.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_reaction(self.uniffiClonePointer(), + FfiConverterString.lower(recipientPubkeyHex), + FfiConverterString.lower(messageId), + FfiConverterString.lower(emoji), + FfiConverterOptionUInt64.lower(expiresAtSeconds),$0 + ) +}) +} + + /** + * Send a delivery/read receipt for messages. + */ +open func sendReceipt(recipientPubkeyHex: String, receiptType: String, messageIds: [String], expiresAtSeconds: UInt64?)throws -> [String] { + return try FfiConverterSequenceString.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_receipt(self.uniffiClonePointer(), + FfiConverterString.lower(recipientPubkeyHex), + FfiConverterString.lower(receiptType), + FfiConverterSequenceString.lower(messageIds), + FfiConverterOptionUInt64.lower(expiresAtSeconds),$0 + ) +}) +} + + /** + * Send an already-built rumor JSON to a recipient without rebuilding it. + * + * This preserves the original rumor pubkey, timestamp, tags, and id. + */ +open func sendRumorJson(recipientPubkeyHex: String, rumorJson: String)throws -> SendTextResult { + return try FfiConverterTypeSendTextResult.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_rumor_json(self.uniffiClonePointer(), + FfiConverterString.lower(recipientPubkeyHex), + FfiConverterString.lower(rumorJson),$0 + ) +}) +} + + /** + * Send a text message to a recipient. + */ +open func sendText(recipientPubkeyHex: String, text: String, expiresAtSeconds: UInt64?)throws -> [String] { + return try FfiConverterSequenceString.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_text(self.uniffiClonePointer(), + FfiConverterString.lower(recipientPubkeyHex), + FfiConverterString.lower(text), + FfiConverterOptionUInt64.lower(expiresAtSeconds),$0 + ) +}) +} + + /** + * Send a text message and return both the stable inner (rumor) id and the + * list of outer message event ids that were published. + */ +open func sendTextWithInnerId(recipientPubkeyHex: String, text: String, expiresAtSeconds: UInt64?)throws -> SendTextResult { + return try FfiConverterTypeSendTextResult.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_text_with_inner_id(self.uniffiClonePointer(), + FfiConverterString.lower(recipientPubkeyHex), + FfiConverterString.lower(text), + FfiConverterOptionUInt64.lower(expiresAtSeconds),$0 + ) +}) +} + + /** + * Send a typing indicator. + */ +open func sendTyping(recipientPubkeyHex: String, expiresAtSeconds: UInt64?)throws -> [String] { + return try FfiConverterSequenceString.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_send_typing(self.uniffiClonePointer(), + FfiConverterString.lower(recipientPubkeyHex), + FfiConverterOptionUInt64.lower(expiresAtSeconds),$0 + ) +}) +} + + /** + * Subscribe to a user's AppKeys/device-invite streams and converge sessions. + */ +open func setupUser(userPubkeyHex: String)throws {try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_method_sessionmanagerhandle_setup_user(self.uniffiClonePointer(), + FfiConverterString.lower(userPubkeyHex),$0 + ) +} +} + + +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeSessionManagerHandle: FfiConverter { + + typealias FfiType = UnsafeMutableRawPointer + typealias SwiftType = SessionManagerHandle + + public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> SessionManagerHandle { + return SessionManagerHandle(unsafeFromRawPointer: pointer) + } + + public static func lower(_ value: SessionManagerHandle) -> UnsafeMutableRawPointer { + return value.uniffiClonePointer() + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SessionManagerHandle { + let v: UInt64 = try readInt(&buf) + // The Rust code won't compile if a pointer won't fit in a UInt64. + // We have to go via `UInt` because that's the thing that's the size of a pointer. + let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) + if (ptr == nil) { + throw UniffiInternalError.unexpectedNullPointer + } + return try lift(ptr!) + } + + public static func write(_ value: SessionManagerHandle, into buf: inout [UInt8]) { + // This fiddling is because `Int` is the thing that's the same size as a pointer. + // The Rust code won't compile if a pointer won't fit in a `UInt64`. + writeInt(&buf, UInt64(bitPattern: Int64(Int(bitPattern: lower(value))))) + } +} + + + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeSessionManagerHandle_lift(_ pointer: UnsafeMutableRawPointer) throws -> SessionManagerHandle { + return try FfiConverterTypeSessionManagerHandle.lift(pointer) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeSessionManagerHandle_lower(_ value: SessionManagerHandle) -> UnsafeMutableRawPointer { + return FfiConverterTypeSessionManagerHandle.lower(value) +} + + +/** + * Result of decrypting a message. + */ +public struct DecryptResult { + public var plaintext: String + public var innerEventJson: String + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(plaintext: String, innerEventJson: String) { + self.plaintext = plaintext + self.innerEventJson = innerEventJson + } +} + + + +extension DecryptResult: Equatable, Hashable { + public static func ==(lhs: DecryptResult, rhs: DecryptResult) -> Bool { + if lhs.plaintext != rhs.plaintext { + return false + } + if lhs.innerEventJson != rhs.innerEventJson { + return false + } + return true + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(plaintext) + hasher.combine(innerEventJson) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeDecryptResult: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> DecryptResult { + return + try DecryptResult( + plaintext: FfiConverterString.read(from: &buf), + innerEventJson: FfiConverterString.read(from: &buf) + ) + } + + public static func write(_ value: DecryptResult, into buf: inout [UInt8]) { + FfiConverterString.write(value.plaintext, into: &buf) + FfiConverterString.write(value.innerEventJson, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeDecryptResult_lift(_ buf: RustBuffer) throws -> DecryptResult { + return try FfiConverterTypeDecryptResult.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeDecryptResult_lower(_ value: DecryptResult) -> RustBuffer { + return FfiConverterTypeDecryptResult.lower(value) +} + + +/** + * FFI-friendly device entry for AppKeys. + */ +public struct FfiDeviceEntry { + public var identityPubkeyHex: String + public var createdAt: UInt64 + public var deviceLabel: String? + public var clientLabel: String? + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(identityPubkeyHex: String, createdAt: UInt64, deviceLabel: String?, clientLabel: String?) { + self.identityPubkeyHex = identityPubkeyHex + self.createdAt = createdAt + self.deviceLabel = deviceLabel + self.clientLabel = clientLabel + } +} + + + +extension FfiDeviceEntry: Equatable, Hashable { + public static func ==(lhs: FfiDeviceEntry, rhs: FfiDeviceEntry) -> Bool { + if lhs.identityPubkeyHex != rhs.identityPubkeyHex { + return false + } + if lhs.createdAt != rhs.createdAt { + return false + } + if lhs.deviceLabel != rhs.deviceLabel { + return false + } + if lhs.clientLabel != rhs.clientLabel { + return false + } + return true + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(identityPubkeyHex) + hasher.combine(createdAt) + hasher.combine(deviceLabel) + hasher.combine(clientLabel) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeFfiDeviceEntry: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FfiDeviceEntry { + return + try FfiDeviceEntry( + identityPubkeyHex: FfiConverterString.read(from: &buf), + createdAt: FfiConverterUInt64.read(from: &buf), + deviceLabel: FfiConverterOptionString.read(from: &buf), + clientLabel: FfiConverterOptionString.read(from: &buf) + ) + } + + public static func write(_ value: FfiDeviceEntry, into buf: inout [UInt8]) { + FfiConverterString.write(value.identityPubkeyHex, into: &buf) + FfiConverterUInt64.write(value.createdAt, into: &buf) + FfiConverterOptionString.write(value.deviceLabel, into: &buf) + FfiConverterOptionString.write(value.clientLabel, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeFfiDeviceEntry_lift(_ buf: RustBuffer) throws -> FfiDeviceEntry { + return try FfiConverterTypeFfiDeviceEntry.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeFfiDeviceEntry_lower(_ value: FfiDeviceEntry) -> RustBuffer { + return FfiConverterTypeFfiDeviceEntry.lower(value) +} + + +/** + * FFI-friendly group metadata payload. + */ +public struct FfiGroupData { + public var id: String + public var name: String + public var description: String? + public var picture: String? + public var members: [String] + public var admins: [String] + public var createdAtMs: UInt64 + public var secret: String? + public var accepted: Bool? + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(id: String, name: String, description: String?, picture: String?, members: [String], admins: [String], createdAtMs: UInt64, secret: String?, accepted: Bool?) { + self.id = id + self.name = name + self.description = description + self.picture = picture + self.members = members + self.admins = admins + self.createdAtMs = createdAtMs + self.secret = secret + self.accepted = accepted + } +} + + + +extension FfiGroupData: Equatable, Hashable { + public static func ==(lhs: FfiGroupData, rhs: FfiGroupData) -> Bool { + if lhs.id != rhs.id { + return false + } + if lhs.name != rhs.name { + return false + } + if lhs.description != rhs.description { + return false + } + if lhs.picture != rhs.picture { + return false + } + if lhs.members != rhs.members { + return false + } + if lhs.admins != rhs.admins { + return false + } + if lhs.createdAtMs != rhs.createdAtMs { + return false + } + if lhs.secret != rhs.secret { + return false + } + if lhs.accepted != rhs.accepted { + return false + } + return true + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + hasher.combine(name) + hasher.combine(description) + hasher.combine(picture) + hasher.combine(members) + hasher.combine(admins) + hasher.combine(createdAtMs) + hasher.combine(secret) + hasher.combine(accepted) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeFfiGroupData: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FfiGroupData { + return + try FfiGroupData( + id: FfiConverterString.read(from: &buf), + name: FfiConverterString.read(from: &buf), + description: FfiConverterOptionString.read(from: &buf), + picture: FfiConverterOptionString.read(from: &buf), + members: FfiConverterSequenceString.read(from: &buf), + admins: FfiConverterSequenceString.read(from: &buf), + createdAtMs: FfiConverterUInt64.read(from: &buf), + secret: FfiConverterOptionString.read(from: &buf), + accepted: FfiConverterOptionBool.read(from: &buf) + ) + } + + public static func write(_ value: FfiGroupData, into buf: inout [UInt8]) { + FfiConverterString.write(value.id, into: &buf) + FfiConverterString.write(value.name, into: &buf) + FfiConverterOptionString.write(value.description, into: &buf) + FfiConverterOptionString.write(value.picture, into: &buf) + FfiConverterSequenceString.write(value.members, into: &buf) + FfiConverterSequenceString.write(value.admins, into: &buf) + FfiConverterUInt64.write(value.createdAtMs, into: &buf) + FfiConverterOptionString.write(value.secret, into: &buf) + FfiConverterOptionBool.write(value.accepted, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeFfiGroupData_lift(_ buf: RustBuffer) throws -> FfiGroupData { + return try FfiConverterTypeFfiGroupData.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeFfiGroupData_lower(_ value: FfiGroupData) -> RustBuffer { + return FfiConverterTypeFfiGroupData.lower(value) +} + + +/** + * FFI-friendly keypair with hex-encoded keys. + */ +public struct FfiKeyPair { + public var publicKeyHex: String + public var privateKeyHex: String + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(publicKeyHex: String, privateKeyHex: String) { + self.publicKeyHex = publicKeyHex + self.privateKeyHex = privateKeyHex + } +} + + + +extension FfiKeyPair: Equatable, Hashable { + public static func ==(lhs: FfiKeyPair, rhs: FfiKeyPair) -> Bool { + if lhs.publicKeyHex != rhs.publicKeyHex { + return false + } + if lhs.privateKeyHex != rhs.privateKeyHex { + return false + } + return true + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(publicKeyHex) + hasher.combine(privateKeyHex) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeFfiKeyPair: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FfiKeyPair { + return + try FfiKeyPair( + publicKeyHex: FfiConverterString.read(from: &buf), + privateKeyHex: FfiConverterString.read(from: &buf) + ) + } + + public static func write(_ value: FfiKeyPair, into buf: inout [UInt8]) { + FfiConverterString.write(value.publicKeyHex, into: &buf) + FfiConverterString.write(value.privateKeyHex, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeFfiKeyPair_lift(_ buf: RustBuffer) throws -> FfiKeyPair { + return try FfiConverterTypeFfiKeyPair.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeFfiKeyPair_lower(_ value: FfiKeyPair) -> RustBuffer { + return FfiConverterTypeFfiKeyPair.lower(value) +} + + +/** + * Metadata fanout summary for group creation. + */ +public struct GroupCreateFanout { + public var enabled: Bool + public var attempted: UInt64 + public var succeeded: [String] + public var failed: [String] + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(enabled: Bool, attempted: UInt64, succeeded: [String], failed: [String]) { + self.enabled = enabled + self.attempted = attempted + self.succeeded = succeeded + self.failed = failed + } +} + + + +extension GroupCreateFanout: Equatable, Hashable { + public static func ==(lhs: GroupCreateFanout, rhs: GroupCreateFanout) -> Bool { + if lhs.enabled != rhs.enabled { + return false + } + if lhs.attempted != rhs.attempted { + return false + } + if lhs.succeeded != rhs.succeeded { + return false + } + if lhs.failed != rhs.failed { + return false + } + return true + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(enabled) + hasher.combine(attempted) + hasher.combine(succeeded) + hasher.combine(failed) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeGroupCreateFanout: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GroupCreateFanout { + return + try GroupCreateFanout( + enabled: FfiConverterBool.read(from: &buf), + attempted: FfiConverterUInt64.read(from: &buf), + succeeded: FfiConverterSequenceString.read(from: &buf), + failed: FfiConverterSequenceString.read(from: &buf) + ) + } + + public static func write(_ value: GroupCreateFanout, into buf: inout [UInt8]) { + FfiConverterBool.write(value.enabled, into: &buf) + FfiConverterUInt64.write(value.attempted, into: &buf) + FfiConverterSequenceString.write(value.succeeded, into: &buf) + FfiConverterSequenceString.write(value.failed, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGroupCreateFanout_lift(_ buf: RustBuffer) throws -> GroupCreateFanout { + return try FfiConverterTypeGroupCreateFanout.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGroupCreateFanout_lower(_ value: GroupCreateFanout) -> RustBuffer { + return FfiConverterTypeGroupCreateFanout.lower(value) +} + + +/** + * Result of creating a group through GroupManager. + */ +public struct GroupCreateResult { + public var group: FfiGroupData + public var metadataRumorJson: String? + public var fanout: GroupCreateFanout + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(group: FfiGroupData, metadataRumorJson: String?, fanout: GroupCreateFanout) { + self.group = group + self.metadataRumorJson = metadataRumorJson + self.fanout = fanout + } +} + + + +extension GroupCreateResult: Equatable, Hashable { + public static func ==(lhs: GroupCreateResult, rhs: GroupCreateResult) -> Bool { + if lhs.group != rhs.group { + return false + } + if lhs.metadataRumorJson != rhs.metadataRumorJson { + return false + } + if lhs.fanout != rhs.fanout { + return false + } + return true + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(group) + hasher.combine(metadataRumorJson) + hasher.combine(fanout) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeGroupCreateResult: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GroupCreateResult { + return + try GroupCreateResult( + group: FfiConverterTypeFfiGroupData.read(from: &buf), + metadataRumorJson: FfiConverterOptionString.read(from: &buf), + fanout: FfiConverterTypeGroupCreateFanout.read(from: &buf) + ) + } + + public static func write(_ value: GroupCreateResult, into buf: inout [UInt8]) { + FfiConverterTypeFfiGroupData.write(value.group, into: &buf) + FfiConverterOptionString.write(value.metadataRumorJson, into: &buf) + FfiConverterTypeGroupCreateFanout.write(value.fanout, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGroupCreateResult_lift(_ buf: RustBuffer) throws -> GroupCreateResult { + return try FfiConverterTypeGroupCreateResult.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGroupCreateResult_lower(_ value: GroupCreateResult) -> RustBuffer { + return FfiConverterTypeGroupCreateResult.lower(value) +} + + +/** + * Decrypted group event returned by GroupManager. + */ +public struct GroupDecryptedResult { + public var groupId: String + public var senderEventPubkeyHex: String + public var senderDevicePubkeyHex: String + public var senderOwnerPubkeyHex: String? + public var outerEventId: String + public var outerCreatedAt: UInt64 + public var keyId: UInt32 + public var messageNumber: UInt32 + public var innerEventJson: String + public var innerEventId: String + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(groupId: String, senderEventPubkeyHex: String, senderDevicePubkeyHex: String, senderOwnerPubkeyHex: String?, outerEventId: String, outerCreatedAt: UInt64, keyId: UInt32, messageNumber: UInt32, innerEventJson: String, innerEventId: String) { + self.groupId = groupId + self.senderEventPubkeyHex = senderEventPubkeyHex + self.senderDevicePubkeyHex = senderDevicePubkeyHex + self.senderOwnerPubkeyHex = senderOwnerPubkeyHex + self.outerEventId = outerEventId + self.outerCreatedAt = outerCreatedAt + self.keyId = keyId + self.messageNumber = messageNumber + self.innerEventJson = innerEventJson + self.innerEventId = innerEventId + } +} + + + +extension GroupDecryptedResult: Equatable, Hashable { + public static func ==(lhs: GroupDecryptedResult, rhs: GroupDecryptedResult) -> Bool { + if lhs.groupId != rhs.groupId { + return false + } + if lhs.senderEventPubkeyHex != rhs.senderEventPubkeyHex { + return false + } + if lhs.senderDevicePubkeyHex != rhs.senderDevicePubkeyHex { + return false + } + if lhs.senderOwnerPubkeyHex != rhs.senderOwnerPubkeyHex { + return false + } + if lhs.outerEventId != rhs.outerEventId { + return false + } + if lhs.outerCreatedAt != rhs.outerCreatedAt { + return false + } + if lhs.keyId != rhs.keyId { + return false + } + if lhs.messageNumber != rhs.messageNumber { + return false + } + if lhs.innerEventJson != rhs.innerEventJson { + return false + } + if lhs.innerEventId != rhs.innerEventId { + return false + } + return true + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(groupId) + hasher.combine(senderEventPubkeyHex) + hasher.combine(senderDevicePubkeyHex) + hasher.combine(senderOwnerPubkeyHex) + hasher.combine(outerEventId) + hasher.combine(outerCreatedAt) + hasher.combine(keyId) + hasher.combine(messageNumber) + hasher.combine(innerEventJson) + hasher.combine(innerEventId) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeGroupDecryptedResult: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GroupDecryptedResult { + return + try GroupDecryptedResult( + groupId: FfiConverterString.read(from: &buf), + senderEventPubkeyHex: FfiConverterString.read(from: &buf), + senderDevicePubkeyHex: FfiConverterString.read(from: &buf), + senderOwnerPubkeyHex: FfiConverterOptionString.read(from: &buf), + outerEventId: FfiConverterString.read(from: &buf), + outerCreatedAt: FfiConverterUInt64.read(from: &buf), + keyId: FfiConverterUInt32.read(from: &buf), + messageNumber: FfiConverterUInt32.read(from: &buf), + innerEventJson: FfiConverterString.read(from: &buf), + innerEventId: FfiConverterString.read(from: &buf) + ) + } + + public static func write(_ value: GroupDecryptedResult, into buf: inout [UInt8]) { + FfiConverterString.write(value.groupId, into: &buf) + FfiConverterString.write(value.senderEventPubkeyHex, into: &buf) + FfiConverterString.write(value.senderDevicePubkeyHex, into: &buf) + FfiConverterOptionString.write(value.senderOwnerPubkeyHex, into: &buf) + FfiConverterString.write(value.outerEventId, into: &buf) + FfiConverterUInt64.write(value.outerCreatedAt, into: &buf) + FfiConverterUInt32.write(value.keyId, into: &buf) + FfiConverterUInt32.write(value.messageNumber, into: &buf) + FfiConverterString.write(value.innerEventJson, into: &buf) + FfiConverterString.write(value.innerEventId, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGroupDecryptedResult_lift(_ buf: RustBuffer) throws -> GroupDecryptedResult { + return try FfiConverterTypeGroupDecryptedResult.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGroupDecryptedResult_lower(_ value: GroupDecryptedResult) -> RustBuffer { + return FfiConverterTypeGroupDecryptedResult.lower(value) +} + + +/** + * Shared outer-subscription sync plan for group sender-event authors. + */ +public struct GroupOuterSubscriptionPlanResult { + public var authors: [String] + public var addedAuthors: [String] + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(authors: [String], addedAuthors: [String]) { + self.authors = authors + self.addedAuthors = addedAuthors + } +} + + + +extension GroupOuterSubscriptionPlanResult: Equatable, Hashable { + public static func ==(lhs: GroupOuterSubscriptionPlanResult, rhs: GroupOuterSubscriptionPlanResult) -> Bool { + if lhs.authors != rhs.authors { + return false + } + if lhs.addedAuthors != rhs.addedAuthors { + return false + } + return true + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(authors) + hasher.combine(addedAuthors) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeGroupOuterSubscriptionPlanResult: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GroupOuterSubscriptionPlanResult { + return + try GroupOuterSubscriptionPlanResult( + authors: FfiConverterSequenceString.read(from: &buf), + addedAuthors: FfiConverterSequenceString.read(from: &buf) + ) + } + + public static func write(_ value: GroupOuterSubscriptionPlanResult, into buf: inout [UInt8]) { + FfiConverterSequenceString.write(value.authors, into: &buf) + FfiConverterSequenceString.write(value.addedAuthors, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGroupOuterSubscriptionPlanResult_lift(_ buf: RustBuffer) throws -> GroupOuterSubscriptionPlanResult { + return try FfiConverterTypeGroupOuterSubscriptionPlanResult.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGroupOuterSubscriptionPlanResult_lower(_ value: GroupOuterSubscriptionPlanResult) -> RustBuffer { + return FfiConverterTypeGroupOuterSubscriptionPlanResult.lower(value) +} + + +/** + * Result of sending a group event through GroupManager. + */ +public struct GroupSendResult { + public var outerEventJson: String + public var innerEventJson: String + public var outerEventId: String + public var innerEventId: String + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(outerEventJson: String, innerEventJson: String, outerEventId: String, innerEventId: String) { + self.outerEventJson = outerEventJson + self.innerEventJson = innerEventJson + self.outerEventId = outerEventId + self.innerEventId = innerEventId + } +} + + + +extension GroupSendResult: Equatable, Hashable { + public static func ==(lhs: GroupSendResult, rhs: GroupSendResult) -> Bool { + if lhs.outerEventJson != rhs.outerEventJson { + return false + } + if lhs.innerEventJson != rhs.innerEventJson { + return false + } + if lhs.outerEventId != rhs.outerEventId { + return false + } + if lhs.innerEventId != rhs.innerEventId { + return false + } + return true + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(outerEventJson) + hasher.combine(innerEventJson) + hasher.combine(outerEventId) + hasher.combine(innerEventId) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeGroupSendResult: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GroupSendResult { + return + try GroupSendResult( + outerEventJson: FfiConverterString.read(from: &buf), + innerEventJson: FfiConverterString.read(from: &buf), + outerEventId: FfiConverterString.read(from: &buf), + innerEventId: FfiConverterString.read(from: &buf) + ) + } + + public static func write(_ value: GroupSendResult, into buf: inout [UInt8]) { + FfiConverterString.write(value.outerEventJson, into: &buf) + FfiConverterString.write(value.innerEventJson, into: &buf) + FfiConverterString.write(value.outerEventId, into: &buf) + FfiConverterString.write(value.innerEventId, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGroupSendResult_lift(_ buf: RustBuffer) throws -> GroupSendResult { + return try FfiConverterTypeGroupSendResult.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGroupSendResult_lower(_ value: GroupSendResult) -> RustBuffer { + return FfiConverterTypeGroupSendResult.lower(value) +} + + +/** + * Result of accepting an invite. + */ +public struct InviteAcceptResult { + public var session: SessionHandle + public var responseEventJson: String + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(session: SessionHandle, responseEventJson: String) { + self.session = session + self.responseEventJson = responseEventJson + } +} + + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeInviteAcceptResult: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> InviteAcceptResult { + return + try InviteAcceptResult( + session: FfiConverterTypeSessionHandle.read(from: &buf), + responseEventJson: FfiConverterString.read(from: &buf) + ) + } + + public static func write(_ value: InviteAcceptResult, into buf: inout [UInt8]) { + FfiConverterTypeSessionHandle.write(value.session, into: &buf) + FfiConverterString.write(value.responseEventJson, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeInviteAcceptResult_lift(_ buf: RustBuffer) throws -> InviteAcceptResult { + return try FfiConverterTypeInviteAcceptResult.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeInviteAcceptResult_lower(_ value: InviteAcceptResult) -> RustBuffer { + return FfiConverterTypeInviteAcceptResult.lower(value) +} + + +/** + * Result of processing an invite response. + */ +public struct InviteProcessResult { + public var session: SessionHandle + public var inviteePubkeyHex: String + public var deviceId: String? + public var ownerPubkeyHex: String? + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(session: SessionHandle, inviteePubkeyHex: String, deviceId: String?, ownerPubkeyHex: String?) { + self.session = session + self.inviteePubkeyHex = inviteePubkeyHex + self.deviceId = deviceId + self.ownerPubkeyHex = ownerPubkeyHex + } +} + + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeInviteProcessResult: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> InviteProcessResult { + return + try InviteProcessResult( + session: FfiConverterTypeSessionHandle.read(from: &buf), + inviteePubkeyHex: FfiConverterString.read(from: &buf), + deviceId: FfiConverterOptionString.read(from: &buf), + ownerPubkeyHex: FfiConverterOptionString.read(from: &buf) + ) + } + + public static func write(_ value: InviteProcessResult, into buf: inout [UInt8]) { + FfiConverterTypeSessionHandle.write(value.session, into: &buf) + FfiConverterString.write(value.inviteePubkeyHex, into: &buf) + FfiConverterOptionString.write(value.deviceId, into: &buf) + FfiConverterOptionString.write(value.ownerPubkeyHex, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeInviteProcessResult_lift(_ buf: RustBuffer) throws -> InviteProcessResult { + return try FfiConverterTypeInviteProcessResult.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeInviteProcessResult_lower(_ value: InviteProcessResult) -> RustBuffer { + return FfiConverterTypeInviteProcessResult.lower(value) +} + + +/** + * Session-state snapshot used to inspect message-push routing without reading storage files. + */ +public struct MessagePushSessionStateResult { + public var stateJson: String + public var trackedSenderPubkeys: [String] + public var hasReceivingCapability: Bool + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(stateJson: String, trackedSenderPubkeys: [String], hasReceivingCapability: Bool) { + self.stateJson = stateJson + self.trackedSenderPubkeys = trackedSenderPubkeys + self.hasReceivingCapability = hasReceivingCapability + } +} + + + +extension MessagePushSessionStateResult: Equatable, Hashable { + public static func ==(lhs: MessagePushSessionStateResult, rhs: MessagePushSessionStateResult) -> Bool { + if lhs.stateJson != rhs.stateJson { + return false + } + if lhs.trackedSenderPubkeys != rhs.trackedSenderPubkeys { + return false + } + if lhs.hasReceivingCapability != rhs.hasReceivingCapability { + return false + } + return true + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(stateJson) + hasher.combine(trackedSenderPubkeys) + hasher.combine(hasReceivingCapability) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMessagePushSessionStateResult: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MessagePushSessionStateResult { + return + try MessagePushSessionStateResult( + stateJson: FfiConverterString.read(from: &buf), + trackedSenderPubkeys: FfiConverterSequenceString.read(from: &buf), + hasReceivingCapability: FfiConverterBool.read(from: &buf) + ) + } + + public static func write(_ value: MessagePushSessionStateResult, into buf: inout [UInt8]) { + FfiConverterString.write(value.stateJson, into: &buf) + FfiConverterSequenceString.write(value.trackedSenderPubkeys, into: &buf) + FfiConverterBool.write(value.hasReceivingCapability, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMessagePushSessionStateResult_lift(_ buf: RustBuffer) throws -> MessagePushSessionStateResult { + return try FfiConverterTypeMessagePushSessionStateResult.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMessagePushSessionStateResult_lower(_ value: MessagePushSessionStateResult) -> RustBuffer { + return FfiConverterTypeMessagePushSessionStateResult.lower(value) +} + + +/** + * Event emitted by SessionManager for external publish/subscribe handling. + */ +public struct PubSubEvent { + public var kind: String + public var subid: String? + public var filterJson: String? + public var eventJson: String? + public var senderPubkeyHex: String? + public var content: String? + public var eventId: String? + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(kind: String, subid: String?, filterJson: String?, eventJson: String?, senderPubkeyHex: String?, content: String?, eventId: String?) { + self.kind = kind + self.subid = subid + self.filterJson = filterJson + self.eventJson = eventJson + self.senderPubkeyHex = senderPubkeyHex + self.content = content + self.eventId = eventId + } +} + + + +extension PubSubEvent: Equatable, Hashable { + public static func ==(lhs: PubSubEvent, rhs: PubSubEvent) -> Bool { + if lhs.kind != rhs.kind { + return false + } + if lhs.subid != rhs.subid { + return false + } + if lhs.filterJson != rhs.filterJson { + return false + } + if lhs.eventJson != rhs.eventJson { + return false + } + if lhs.senderPubkeyHex != rhs.senderPubkeyHex { + return false + } + if lhs.content != rhs.content { + return false + } + if lhs.eventId != rhs.eventId { + return false + } + return true + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(kind) + hasher.combine(subid) + hasher.combine(filterJson) + hasher.combine(eventJson) + hasher.combine(senderPubkeyHex) + hasher.combine(content) + hasher.combine(eventId) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypePubSubEvent: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PubSubEvent { + return + try PubSubEvent( + kind: FfiConverterString.read(from: &buf), + subid: FfiConverterOptionString.read(from: &buf), + filterJson: FfiConverterOptionString.read(from: &buf), + eventJson: FfiConverterOptionString.read(from: &buf), + senderPubkeyHex: FfiConverterOptionString.read(from: &buf), + content: FfiConverterOptionString.read(from: &buf), + eventId: FfiConverterOptionString.read(from: &buf) + ) + } + + public static func write(_ value: PubSubEvent, into buf: inout [UInt8]) { + FfiConverterString.write(value.kind, into: &buf) + FfiConverterOptionString.write(value.subid, into: &buf) + FfiConverterOptionString.write(value.filterJson, into: &buf) + FfiConverterOptionString.write(value.eventJson, into: &buf) + FfiConverterOptionString.write(value.senderPubkeyHex, into: &buf) + FfiConverterOptionString.write(value.content, into: &buf) + FfiConverterOptionString.write(value.eventId, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypePubSubEvent_lift(_ buf: RustBuffer) throws -> PubSubEvent { + return try FfiConverterTypePubSubEvent.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypePubSubEvent_lower(_ value: PubSubEvent) -> RustBuffer { + return FfiConverterTypePubSubEvent.lower(value) +} + + +/** + * Result of sending a message. + */ +public struct SendResult { + public var outerEventJson: String + public var innerEventJson: String + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(outerEventJson: String, innerEventJson: String) { + self.outerEventJson = outerEventJson + self.innerEventJson = innerEventJson + } +} + + + +extension SendResult: Equatable, Hashable { + public static func ==(lhs: SendResult, rhs: SendResult) -> Bool { + if lhs.outerEventJson != rhs.outerEventJson { + return false + } + if lhs.innerEventJson != rhs.innerEventJson { + return false + } + return true + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(outerEventJson) + hasher.combine(innerEventJson) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeSendResult: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SendResult { + return + try SendResult( + outerEventJson: FfiConverterString.read(from: &buf), + innerEventJson: FfiConverterString.read(from: &buf) + ) + } + + public static func write(_ value: SendResult, into buf: inout [UInt8]) { + FfiConverterString.write(value.outerEventJson, into: &buf) + FfiConverterString.write(value.innerEventJson, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeSendResult_lift(_ buf: RustBuffer) throws -> SendResult { + return try FfiConverterTypeSendResult.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeSendResult_lower(_ value: SendResult) -> RustBuffer { + return FfiConverterTypeSendResult.lower(value) +} + + +/** + * Result of sending a text message including stable inner id. + */ +public struct SendTextResult { + public var innerId: String + public var outerEventIds: [String] + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(innerId: String, outerEventIds: [String]) { + self.innerId = innerId + self.outerEventIds = outerEventIds + } +} + + + +extension SendTextResult: Equatable, Hashable { + public static func ==(lhs: SendTextResult, rhs: SendTextResult) -> Bool { + if lhs.innerId != rhs.innerId { + return false + } + if lhs.outerEventIds != rhs.outerEventIds { + return false + } + return true + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(innerId) + hasher.combine(outerEventIds) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeSendTextResult: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SendTextResult { + return + try SendTextResult( + innerId: FfiConverterString.read(from: &buf), + outerEventIds: FfiConverterSequenceString.read(from: &buf) + ) + } + + public static func write(_ value: SendTextResult, into buf: inout [UInt8]) { + FfiConverterString.write(value.innerId, into: &buf) + FfiConverterSequenceString.write(value.outerEventIds, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeSendTextResult_lift(_ buf: RustBuffer) throws -> SendTextResult { + return try FfiConverterTypeSendTextResult.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeSendTextResult_lower(_ value: SendTextResult) -> RustBuffer { + return FfiConverterTypeSendTextResult.lower(value) +} + + +/** + * Result of accepting an invite through SessionManager. + */ +public struct SessionManagerAcceptInviteResult { + public var ownerPubkeyHex: String + public var inviterDevicePubkeyHex: String + public var deviceId: String + public var createdNewSession: Bool + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(ownerPubkeyHex: String, inviterDevicePubkeyHex: String, deviceId: String, createdNewSession: Bool) { + self.ownerPubkeyHex = ownerPubkeyHex + self.inviterDevicePubkeyHex = inviterDevicePubkeyHex + self.deviceId = deviceId + self.createdNewSession = createdNewSession + } +} + + + +extension SessionManagerAcceptInviteResult: Equatable, Hashable { + public static func ==(lhs: SessionManagerAcceptInviteResult, rhs: SessionManagerAcceptInviteResult) -> Bool { + if lhs.ownerPubkeyHex != rhs.ownerPubkeyHex { + return false + } + if lhs.inviterDevicePubkeyHex != rhs.inviterDevicePubkeyHex { + return false + } + if lhs.deviceId != rhs.deviceId { + return false + } + if lhs.createdNewSession != rhs.createdNewSession { + return false + } + return true + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(ownerPubkeyHex) + hasher.combine(inviterDevicePubkeyHex) + hasher.combine(deviceId) + hasher.combine(createdNewSession) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeSessionManagerAcceptInviteResult: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SessionManagerAcceptInviteResult { + return + try SessionManagerAcceptInviteResult( + ownerPubkeyHex: FfiConverterString.read(from: &buf), + inviterDevicePubkeyHex: FfiConverterString.read(from: &buf), + deviceId: FfiConverterString.read(from: &buf), + createdNewSession: FfiConverterBool.read(from: &buf) + ) + } + + public static func write(_ value: SessionManagerAcceptInviteResult, into buf: inout [UInt8]) { + FfiConverterString.write(value.ownerPubkeyHex, into: &buf) + FfiConverterString.write(value.inviterDevicePubkeyHex, into: &buf) + FfiConverterString.write(value.deviceId, into: &buf) + FfiConverterBool.write(value.createdNewSession, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeSessionManagerAcceptInviteResult_lift(_ buf: RustBuffer) throws -> SessionManagerAcceptInviteResult { + return try FfiConverterTypeSessionManagerAcceptInviteResult.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeSessionManagerAcceptInviteResult_lower(_ value: SessionManagerAcceptInviteResult) -> RustBuffer { + return FfiConverterTypeSessionManagerAcceptInviteResult.lower(value) +} + + +/** + * FFI-friendly error type. + */ +public enum NdrError { + + + + case InvalidKey(String + ) + case InvalidEvent(String + ) + case CryptoFailure(String + ) + case StateMismatch(String + ) + case Serialization(String + ) + case InviteError(String + ) + case SessionNotReady(String + ) +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeNdrError: FfiConverterRustBuffer { + typealias SwiftType = NdrError + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> NdrError { + let variant: Int32 = try readInt(&buf) + switch variant { + + + + + case 1: return .InvalidKey( + try FfiConverterString.read(from: &buf) + ) + case 2: return .InvalidEvent( + try FfiConverterString.read(from: &buf) + ) + case 3: return .CryptoFailure( + try FfiConverterString.read(from: &buf) + ) + case 4: return .StateMismatch( + try FfiConverterString.read(from: &buf) + ) + case 5: return .Serialization( + try FfiConverterString.read(from: &buf) + ) + case 6: return .InviteError( + try FfiConverterString.read(from: &buf) + ) + case 7: return .SessionNotReady( + try FfiConverterString.read(from: &buf) + ) + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: NdrError, into buf: inout [UInt8]) { + switch value { + + + + + + case let .InvalidKey(v1): + writeInt(&buf, Int32(1)) + FfiConverterString.write(v1, into: &buf) + + + case let .InvalidEvent(v1): + writeInt(&buf, Int32(2)) + FfiConverterString.write(v1, into: &buf) + + + case let .CryptoFailure(v1): + writeInt(&buf, Int32(3)) + FfiConverterString.write(v1, into: &buf) + + + case let .StateMismatch(v1): + writeInt(&buf, Int32(4)) + FfiConverterString.write(v1, into: &buf) + + + case let .Serialization(v1): + writeInt(&buf, Int32(5)) + FfiConverterString.write(v1, into: &buf) + + + case let .InviteError(v1): + writeInt(&buf, Int32(6)) + FfiConverterString.write(v1, into: &buf) + + + case let .SessionNotReady(v1): + writeInt(&buf, Int32(7)) + FfiConverterString.write(v1, into: &buf) + + } + } +} + + +extension NdrError: Equatable, Hashable {} + +extension NdrError: Foundation.LocalizedError { + public var errorDescription: String? { + String(reflecting: self) + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionUInt32: FfiConverterRustBuffer { + typealias SwiftType = UInt32? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterUInt32.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterUInt32.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionUInt64: FfiConverterRustBuffer { + typealias SwiftType = UInt64? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterUInt64.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterUInt64.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionBool: FfiConverterRustBuffer { + typealias SwiftType = Bool? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterBool.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterBool.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionString: FfiConverterRustBuffer { + typealias SwiftType = String? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterString.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterString.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionTypeGroupDecryptedResult: FfiConverterRustBuffer { + typealias SwiftType = GroupDecryptedResult? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterTypeGroupDecryptedResult.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterTypeGroupDecryptedResult.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionTypeInviteProcessResult: FfiConverterRustBuffer { + typealias SwiftType = InviteProcessResult? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterTypeInviteProcessResult.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterTypeInviteProcessResult.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceString: FfiConverterRustBuffer { + typealias SwiftType = [String] + + public static func write(_ value: [String], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterString.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [String] { + let len: Int32 = try readInt(&buf) + var seq = [String]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterString.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypeFfiDeviceEntry: FfiConverterRustBuffer { + typealias SwiftType = [FfiDeviceEntry] + + public static func write(_ value: [FfiDeviceEntry], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypeFfiDeviceEntry.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [FfiDeviceEntry] { + let len: Int32 = try readInt(&buf) + var seq = [FfiDeviceEntry]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypeFfiDeviceEntry.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypeGroupDecryptedResult: FfiConverterRustBuffer { + typealias SwiftType = [GroupDecryptedResult] + + public static func write(_ value: [GroupDecryptedResult], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypeGroupDecryptedResult.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [GroupDecryptedResult] { + let len: Int32 = try readInt(&buf) + var seq = [GroupDecryptedResult]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypeGroupDecryptedResult.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypeMessagePushSessionStateResult: FfiConverterRustBuffer { + typealias SwiftType = [MessagePushSessionStateResult] + + public static func write(_ value: [MessagePushSessionStateResult], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypeMessagePushSessionStateResult.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [MessagePushSessionStateResult] { + let len: Int32 = try readInt(&buf) + var seq = [MessagePushSessionStateResult]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypeMessagePushSessionStateResult.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypePubSubEvent: FfiConverterRustBuffer { + typealias SwiftType = [PubSubEvent] + + public static func write(_ value: [PubSubEvent], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypePubSubEvent.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [PubSubEvent] { + let len: Int32 = try readInt(&buf) + var seq = [PubSubEvent]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypePubSubEvent.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceSequenceString: FfiConverterRustBuffer { + typealias SwiftType = [[String]] + + public static func write(_ value: [[String]], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterSequenceString.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [[String]] { + let len: Int32 = try readInt(&buf) + var seq = [[String]]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterSequenceString.read(from: &buf)) + } + return seq + } +} +/** + * Create a signed AppKeys event JSON for publishing to relays. + */ +public func createSignedAppKeysEvent(ownerPubkeyHex: String, ownerPrivkeyHex: String, devices: [FfiDeviceEntry])throws -> String { + return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_func_create_signed_app_keys_event( + FfiConverterString.lower(ownerPubkeyHex), + FfiConverterString.lower(ownerPrivkeyHex), + FfiConverterSequenceTypeFfiDeviceEntry.lower(devices),$0 + ) +}) +} +/** + * Derive a public key from a hex-encoded private key. + */ +public func derivePublicKey(privkeyHex: String)throws -> String { + return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_func_derive_public_key( + FfiConverterString.lower(privkeyHex),$0 + ) +}) +} +/** + * Generate a new keypair. + */ +public func generateKeypair() -> FfiKeyPair { + return try! FfiConverterTypeFfiKeyPair.lift(try! rustCall() { + uniffi_ndr_ffi_fn_func_generate_keypair($0 + ) +}) +} +/** + * Parse an AppKeys event JSON and return the contained device entries. + */ +public func parseAppKeysEvent(eventJson: String, ownerPrivkeyHex: String?)throws -> [FfiDeviceEntry] { + return try FfiConverterSequenceTypeFfiDeviceEntry.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_func_parse_app_keys_event( + FfiConverterString.lower(eventJson), + FfiConverterOptionString.lower(ownerPrivkeyHex),$0 + ) +}) +} +/** + * Resolve conversation routing candidates for a decrypted rumor. + */ +public func resolveConversationCandidatePubkeys(ownerPubkeyHex: String, rumorPubkeyHex: String, rumorTags: [[String]], senderPubkeyHex: String) -> [String] { + return try! FfiConverterSequenceString.lift(try! rustCall() { + uniffi_ndr_ffi_fn_func_resolve_conversation_candidate_pubkeys( + FfiConverterString.lower(ownerPubkeyHex), + FfiConverterString.lower(rumorPubkeyHex), + FfiConverterSequenceSequenceString.lower(rumorTags), + FfiConverterString.lower(senderPubkeyHex),$0 + ) +}) +} +/** + * Resolve the latest authorized device list from a set of AppKeys event JSON strings. + */ +public func resolveLatestAppKeysDevices(eventJsons: [String], ownerPrivkeyHex: String?)throws -> [FfiDeviceEntry] { + return try FfiConverterSequenceTypeFfiDeviceEntry.lift(try rustCallWithError(FfiConverterTypeNdrError.lift) { + uniffi_ndr_ffi_fn_func_resolve_latest_app_keys_devices( + FfiConverterSequenceString.lower(eventJsons), + FfiConverterOptionString.lower(ownerPrivkeyHex),$0 + ) +}) +} +/** + * Returns the version of the ndr-ffi crate. + */ +public func version() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_ndr_ffi_fn_func_version($0 + ) +}) +} + +private enum InitializationResult { + case ok + case contractVersionMismatch + case apiChecksumMismatch +} +// Use a global variable to perform the versioning checks. Swift ensures that +// the code inside is only computed once. +private var initializationResult: InitializationResult = { + // Get the bindings contract version from our ComponentInterface + let bindings_contract_version = 26 + // Get the scaffolding contract version by calling the into the dylib + let scaffolding_contract_version = ffi_ndr_ffi_uniffi_contract_version() + if bindings_contract_version != scaffolding_contract_version { + return InitializationResult.contractVersionMismatch + } + if (uniffi_ndr_ffi_checksum_func_create_signed_app_keys_event() != 62391) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_func_derive_public_key() != 23373) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_func_generate_keypair() != 56100) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_func_parse_app_keys_event() != 24603) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_func_resolve_conversation_candidate_pubkeys() != 3184) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_func_resolve_latest_app_keys_devices() != 24185) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_func_version() != 58200) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_invitehandle_accept() != 50404) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_invitehandle_accept_with_owner() != 19609) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_invitehandle_get_inviter_pubkey_hex() != 17047) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_invitehandle_get_shared_secret_hex() != 42269) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_invitehandle_process_response() != 8323) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_invitehandle_serialize() != 6090) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_invitehandle_set_owner_pubkey_hex() != 988) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_invitehandle_set_purpose() != 14438) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_invitehandle_to_event_json() != 25504) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_invitehandle_to_url() != 21533) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionhandle_can_send() != 64471) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionhandle_decrypt_event() != 61795) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionhandle_is_dr_message() != 39495) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionhandle_send_text() != 53814) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionhandle_state_json() != 62261) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_accept_invite_from_event_json() != 10447) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_accept_invite_from_url() != 1488) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_drain_events() != 33023) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_active_session_state() != 34884) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_device_id() != 27863) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_message_push_author_pubkeys() != 25521) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_message_push_session_states() != 52859) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_our_pubkey_hex() != 15248) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_owner_pubkey_hex() != 38134) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_stored_user_record_json() != 54503) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_get_total_sessions() != 54736) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_create() != 41536) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_handle_incoming_session_event() != 45714) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_handle_outer_event() != 9485) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_known_sender_event_pubkeys() != 34048) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_outer_subscription_plan() != 65323) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_remove() != 33157) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_send_event() != 4165) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_group_upsert() != 12505) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_import_session_state() != 57446) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_init() != 12215) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_known_peer_owner_pubkeys() != 12569) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_process_event() != 55445) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_event_with_inner_id() != 35167) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_reaction() != 32190) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_receipt() != 34112) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_rumor_json() != 27697) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_text() != 39171) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_text_with_inner_id() != 49408) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_send_typing() != 11765) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_method_sessionmanagerhandle_setup_user() != 27115) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_constructor_invitehandle_create_new() != 4301) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_constructor_invitehandle_deserialize() != 552) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_constructor_invitehandle_from_event_json() != 46752) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_constructor_invitehandle_from_url() != 7682) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_constructor_sessionhandle_from_state_json() != 2882) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_constructor_sessionhandle_init() != 28461) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_constructor_sessionmanagerhandle_new() != 8939) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ndr_ffi_checksum_constructor_sessionmanagerhandle_new_with_storage_path() != 33050) { + return InitializationResult.apiChecksumMismatch + } + + return InitializationResult.ok +}() + +private func uniffiEnsureInitialized() { + switch initializationResult { + case .ok: + break + case .contractVersionMismatch: + fatalError("UniFFI contract version mismatch: try cleaning and rebuilding your project") + case .apiChecksumMismatch: + fatalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } +} + +// swiftlint:enable all \ No newline at end of file diff --git a/localPackages/NdrFfi/Tests/NdrFfiTests.swift b/localPackages/NdrFfi/Tests/NdrFfiTests.swift new file mode 100644 index 00000000..d099b8cc --- /dev/null +++ b/localPackages/NdrFfi/Tests/NdrFfiTests.swift @@ -0,0 +1,204 @@ +import XCTest +@testable import NdrFfi + +final class NdrFfiTests: XCTestCase { + + // MARK: - Version Tests + + func testVersion() { + let v = NdrFfi.version() + XCTAssertFalse(v.isEmpty, "Version should not be empty") + print("ndr-ffi version: \(v)") + } + + // MARK: - Keypair Tests + + func testKeypairGeneration() { + let keypair = generateKeypair() + + XCTAssertEqual(keypair.publicKeyHex.count, 64, "Public key should be 64 hex characters") + XCTAssertEqual(keypair.privateKeyHex.count, 64, "Private key should be 64 hex characters") + + // Verify they're valid hex + XCTAssertNotNil(Data(hexString: keypair.publicKeyHex), "Public key should be valid hex") + XCTAssertNotNil(Data(hexString: keypair.privateKeyHex), "Private key should be valid hex") + + print("Generated keypair - pubkey: \(keypair.publicKeyHex.prefix(16))...") + } + + func testMultipleKeypairsAreDifferent() { + let kp1 = generateKeypair() + let kp2 = generateKeypair() + + XCTAssertNotEqual(kp1.publicKeyHex, kp2.publicKeyHex, "Different keypairs should have different public keys") + XCTAssertNotEqual(kp1.privateKeyHex, kp2.privateKeyHex, "Different keypairs should have different private keys") + } + + // MARK: - SessionManager Tests + + func testSessionManagerInitEmitsInviteEvent() throws { + let keys = generateKeypair() + let mgr = try SessionManagerHandle( + ourPubkeyHex: keys.publicKeyHex, + ourIdentityPrivkeyHex: keys.privateKeyHex, + deviceId: "test-device", + ownerPubkeyHex: nil + ) + try mgr.`init`() + + let events = try mgr.drainEvents() + let inviteEventJson = try XCTUnwrap( + events.first(where: { $0.kind == "publish_signed" })?.eventJson, + "Expected SessionManager to publish an invite on init" + ) + XCTAssertEqual(try extractNostrKind(json: inviteEventJson), 30078) + } + + func testSessionManagerAcceptInviteFromEventJsonEstablishesSession() throws { + let alice = generateKeypair() + let bob = generateKeypair() + + let aliceMgr = try SessionManagerHandle( + ourPubkeyHex: alice.publicKeyHex, + ourIdentityPrivkeyHex: alice.privateKeyHex, + deviceId: "alice-device", + ownerPubkeyHex: nil + ) + let bobMgr = try SessionManagerHandle( + ourPubkeyHex: bob.publicKeyHex, + ourIdentityPrivkeyHex: bob.privateKeyHex, + deviceId: "bob-device", + ownerPubkeyHex: nil + ) + try aliceMgr.`init`() + try bobMgr.`init`() + + let aliceInitEvents = try aliceMgr.drainEvents() + _ = try bobMgr.drainEvents() // discard Bob init invite + + let aliceInviteEventJson = try XCTUnwrap( + aliceInitEvents.first(where: { $0.kind == "publish_signed" })?.eventJson, + "Expected Alice to publish an invite on init" + ) + XCTAssertEqual(try extractNostrKind(json: aliceInviteEventJson), 30078) + + let accept = try bobMgr.acceptInviteFromEventJson(eventJson: aliceInviteEventJson, ownerPubkeyHintHex: nil) + XCTAssertTrue(accept.createdNewSession) + + let bobAfterAccept = try bobMgr.drainEvents() + let responseEventJson = try XCTUnwrap( + bobAfterAccept.first(where: { $0.kind == "publish_signed" && ((try? extractNostrKind(json: $0.eventJson ?? "")) == 1059) })?.eventJson, + "Expected Bob to publish a giftwrap response after accepting invite" + ) + XCTAssertEqual(try extractNostrKind(json: responseEventJson), 1059) + + try aliceMgr.processEvent(eventJson: responseEventJson) + _ = try aliceMgr.drainEvents() + + XCTAssertNotNil(try aliceMgr.getActiveSessionState(peerPubkeyHex: bob.publicKeyHex)) + XCTAssertNotNil(try bobMgr.getActiveSessionState(peerPubkeyHex: alice.publicKeyHex)) + } + + func testSessionManagerSendTextDecryptsOnOtherSide() throws { + let alice = generateKeypair() + let bob = generateKeypair() + + let aliceMgr = try SessionManagerHandle( + ourPubkeyHex: alice.publicKeyHex, + ourIdentityPrivkeyHex: alice.privateKeyHex, + deviceId: "alice-device", + ownerPubkeyHex: nil + ) + let bobMgr = try SessionManagerHandle( + ourPubkeyHex: bob.publicKeyHex, + ourIdentityPrivkeyHex: bob.privateKeyHex, + deviceId: "bob-device", + ownerPubkeyHex: nil + ) + try aliceMgr.`init`() + try bobMgr.`init`() + + let aliceInvite = try XCTUnwrap( + try aliceMgr.drainEvents().first(where: { $0.kind == "publish_signed" })?.eventJson + ) + _ = try bobMgr.drainEvents() // discard Bob init invite + + _ = try bobMgr.acceptInviteFromEventJson(eventJson: aliceInvite, ownerPubkeyHintHex: nil) + let bobAfterAccept = try bobMgr.drainEvents() + let bobResponse = try XCTUnwrap( + bobAfterAccept.first(where: { $0.kind == "publish_signed" && ((try? extractNostrKind(json: $0.eventJson ?? "")) == 1059) })?.eventJson + ) + try aliceMgr.processEvent(eventJson: bobResponse) + _ = try aliceMgr.drainEvents() + + _ = try bobMgr.sendText(recipientPubkeyHex: alice.publicKeyHex, text: "hello from bob", expiresAtSeconds: nil) + let bobOutbound = try bobMgr.drainEvents().compactMap { e -> String? in + guard e.kind == "publish_signed", let json = e.eventJson else { return nil } + return ((try? extractNostrKind(json: json)) == 1060) ? json : nil + } + XCTAssertFalse(bobOutbound.isEmpty, "Expected at least one kind 1060 message to publish") + + for eventJson in bobOutbound { + try aliceMgr.processEvent(eventJson: eventJson) + } + let aliceEvents = try aliceMgr.drainEvents() + let decryptedInner = try XCTUnwrap( + aliceEvents.first(where: { $0.kind == "decrypted_message" })?.content, + "Expected a decrypted inner event to surface" + ) + XCTAssertEqual(try innerEventContent(json: decryptedInner), "hello from bob") + } + + func testSessionManagerRejectsInvalidInviteEventJson() throws { + let keys = generateKeypair() + let mgr = try SessionManagerHandle( + ourPubkeyHex: keys.publicKeyHex, + ourIdentityPrivkeyHex: keys.privateKeyHex, + deviceId: "test-device", + ownerPubkeyHex: nil + ) + try mgr.`init`() + + let notAnInvite = """ + {"kind":1,"id":"test","pubkey":"test","created_at":0,"content":"hello","tags":[],"sig":"test"} + """ + XCTAssertThrowsError(try mgr.acceptInviteFromEventJson(eventJson: notAnInvite, ownerPubkeyHintHex: nil)) + } +} + +// MARK: - Helper Extensions + +extension Data { + init?(hexString: String) { + let len = hexString.count / 2 + var data = Data(capacity: len) + var i = hexString.startIndex + for _ in 0.. Int { + let data = Data(json.utf8) + let obj = try JSONSerialization.jsonObject(with: data, options: []) + guard let dict = obj as? [String: Any] else { throw NSError(domain: "NdrFfiTests", code: 1) } + guard let kind = dict["kind"] as? Int else { throw NSError(domain: "NdrFfiTests", code: 2) } + return kind +} + +private func innerEventContent(json: String) throws -> String { + let data = Data(json.utf8) + let obj = try JSONSerialization.jsonObject(with: data, options: []) + guard let dict = obj as? [String: Any] else { throw NSError(domain: "NdrFfiTests", code: 3) } + guard let content = dict["content"] as? String else { throw NSError(domain: "NdrFfiTests", code: 4) } + return content +} diff --git a/localPackages/NdrFfi/VENDORED_FROM.md b/localPackages/NdrFfi/VENDORED_FROM.md new file mode 100644 index 00000000..6956d17b --- /dev/null +++ b/localPackages/NdrFfi/VENDORED_FROM.md @@ -0,0 +1,19 @@ +# Vendored Provenance + +Current vendored `NdrFfi` artifacts in this package correspond to: + +- Upstream repository: `git@github.com:mmalmi/nostr-double-ratchet.git` +- Upstream crate: `rust/crates/ndr-ffi` +- Upstream version: `v0.0.97` +- Upstream source revision: `v0.0.97-3-g5fa8dbb` +- Upstream commit: `5fa8dbb7d4a2ea21e448e5fa220f655030de12f2` +- Rebuild script: `build-apple.sh` +- Static archive post-processing: `xcrun strip -S` to remove DWARF debug info while preserving link symbols +- Rust toolchain used for the vendored refresh: `rustc 1.94.1 (e408947bf 2026-03-25)` + +Vendored outputs updated from that source: + +- `Sources/NdrFfi/NdrFfi.swift` +- `Frameworks/NdrFfi.xcframework` (`macos-arm64_x86_64`, `ios-arm64`, `ios-arm64_x86_64-simulator`) + +Recorded on `2026-04-25T09:00:04Z`. diff --git a/localPackages/NdrFfi/build-apple.sh b/localPackages/NdrFfi/build-apple.sh new file mode 100755 index 00000000..6109edba --- /dev/null +++ b/localPackages/NdrFfi/build-apple.sh @@ -0,0 +1,120 @@ +#!/bin/bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PACKAGE_DIR="$SCRIPT_DIR" +SOURCE_DIR="${1:-${NDR_SOURCE_DIR:-$HOME/src/nostr-double-ratchet}}" +RUST_ROOT="$SOURCE_DIR/rust" + +MACOS_MIN="${MACOSX_DEPLOYMENT_TARGET:-13.0}" +IOS_MIN="${IPHONEOS_DEPLOYMENT_TARGET:-16.0}" + +if [[ ! -d "$RUST_ROOT" ]]; then + echo "error: expected nostr-double-ratchet checkout at $SOURCE_DIR" >&2 + exit 1 +fi + +WORK_ROOT="$(mktemp -d "${TMPDIR:-/tmp}/ndrffi-apple.XXXXXX")" +TARGET_DIR="$WORK_ROOT/target" +OUT_DIR="$WORK_ROOT/out" +BINDINGS_DIR="$OUT_DIR/bindings" +HEADERS_DIR="$OUT_DIR/headers" + +cleanup() { + rm -rf "$WORK_ROOT" +} +trap cleanup EXIT + +mkdir -p "$BINDINGS_DIR" "$HEADERS_DIR" + +echo "==> Building ndr-ffi from $SOURCE_DIR" +echo " macOS minimum: $MACOS_MIN" +echo " iOS minimum: $IOS_MIN" + +cd "$RUST_ROOT" + +echo "==> Generating Swift bindings" +env \ + CARGO_TARGET_DIR="$TARGET_DIR" \ + cargo build -p ndr-ffi --lib + +env \ + CARGO_TARGET_DIR="$TARGET_DIR" \ + cargo run -p ndr-ffi --features bindgen-cli --bin uniffi-bindgen -- \ + generate \ + --library "$TARGET_DIR/debug/libndr_ffi.dylib" \ + --language swift \ + --out-dir "$BINDINGS_DIR" + +cp "$BINDINGS_DIR/ndr_ffiFFI.h" "$HEADERS_DIR/ndr_ffiFFI.h" + +cat > "$HEADERS_DIR/module.modulemap" <<'EOF' +module ndr_ffiFFI { + header "ndr_ffiFFI.h" + export * +} +EOF + +echo "==> Building macOS slices" +for target in aarch64-apple-darwin x86_64-apple-darwin; do + env \ + CARGO_TARGET_DIR="$TARGET_DIR" \ + MACOSX_DEPLOYMENT_TARGET="$MACOS_MIN" \ + CFLAGS_aarch64_apple_darwin="-mmacosx-version-min=$MACOS_MIN" \ + CXXFLAGS_aarch64_apple_darwin="-mmacosx-version-min=$MACOS_MIN" \ + CFLAGS_x86_64_apple_darwin="-mmacosx-version-min=$MACOS_MIN" \ + CXXFLAGS_x86_64_apple_darwin="-mmacosx-version-min=$MACOS_MIN" \ + RUSTFLAGS="-C link-arg=-mmacosx-version-min=$MACOS_MIN" \ + cargo build -p ndr-ffi --lib --release --target "$target" +done + +echo "==> Building iOS slices" +for target in aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios; do + env \ + CARGO_TARGET_DIR="$TARGET_DIR" \ + IPHONEOS_DEPLOYMENT_TARGET="$IOS_MIN" \ + cargo build -p ndr-ffi --lib --release --target "$target" +done + +MACOS_ARM64_LIB="$TARGET_DIR/aarch64-apple-darwin/release/libndr_ffi.a" +MACOS_X64_LIB="$TARGET_DIR/x86_64-apple-darwin/release/libndr_ffi.a" +MACOS_FAT_LIB="$OUT_DIR/libndr_ffi_macos.a" +if [[ -f "$MACOS_ARM64_LIB" ]] && [[ -f "$MACOS_X64_LIB" ]]; then + lipo -create "$MACOS_ARM64_LIB" "$MACOS_X64_LIB" -output "$MACOS_FAT_LIB" +elif [[ -f "$MACOS_ARM64_LIB" ]]; then + cp "$MACOS_ARM64_LIB" "$MACOS_FAT_LIB" +elif [[ -f "$MACOS_X64_LIB" ]]; then + cp "$MACOS_X64_LIB" "$MACOS_FAT_LIB" +fi + +SIM_ARM64_LIB="$TARGET_DIR/aarch64-apple-ios-sim/release/libndr_ffi.a" +SIM_X64_LIB="$TARGET_DIR/x86_64-apple-ios/release/libndr_ffi.a" +SIM_FAT_LIB="$OUT_DIR/libndr_ffi_sim.a" +if [[ -f "$SIM_ARM64_LIB" ]] && [[ -f "$SIM_X64_LIB" ]]; then + lipo -create "$SIM_ARM64_LIB" "$SIM_X64_LIB" -output "$SIM_FAT_LIB" +elif [[ -f "$SIM_ARM64_LIB" ]]; then + cp "$SIM_ARM64_LIB" "$SIM_FAT_LIB" +elif [[ -f "$SIM_X64_LIB" ]]; then + cp "$SIM_X64_LIB" "$SIM_FAT_LIB" +fi + +echo "==> Assembling XCFramework" +xcodebuild -create-xcframework \ + -library "$MACOS_FAT_LIB" -headers "$HEADERS_DIR" \ + -library "$TARGET_DIR/aarch64-apple-ios/release/libndr_ffi.a" -headers "$HEADERS_DIR" \ + -library "$SIM_FAT_LIB" -headers "$HEADERS_DIR" \ + -output "$OUT_DIR/NdrFfi.xcframework" + +echo "==> Updating vendored package" +cp "$BINDINGS_DIR/ndr_ffi.swift" "$PACKAGE_DIR/Sources/NdrFfi/NdrFfi.swift" +rm -rf "$PACKAGE_DIR/Frameworks/NdrFfi.xcframework" +cp -R "$OUT_DIR/NdrFfi.xcframework" "$PACKAGE_DIR/Frameworks/NdrFfi.xcframework" + +echo "==> Stripping debug info from vendored static libraries" +for lib in "$PACKAGE_DIR"/Frameworks/NdrFfi.xcframework/*/libndr_ffi*.a; do + [[ -f "$lib" ]] && xcrun strip -S "$lib" +done + +echo "==> Done" +echo " Updated $PACKAGE_DIR/Sources/NdrFfi/NdrFfi.swift" +echo " Updated $PACKAGE_DIR/Frameworks/NdrFfi.xcframework"