import Foundation

/// Delivery packet (0x08) — delivery confirmation from server.
/// Field order matches TypeScript server: toPublicKey, messageId.
struct PacketDelivery: Packet {
    static let packetId = 0x08

    var toPublicKey: String = ""
    var messageId: String = ""

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

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