import Foundation

/// Typing packet (0x0B) — typing indicator.
/// Field order matches TypeScript: privateKey, fromPublicKey, toPublicKey.
struct PacketTyping: Packet {
    static let packetId = 0x0B

    var privateKey: String = ""
    var fromPublicKey: String = ""
    var toPublicKey: String = ""

    func write(to stream: Stream) {
        stream.writeString(privateKey)
        stream.writeString(fromPublicKey)
        stream.writeString(toPublicKey)
    }

    mutating func read(from stream: Stream) {
        privateKey = stream.readString()
        fromPublicKey = stream.readString()
        toPublicKey = stream.readString()
    }
}
