"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GroupKeyRequestTranslator = void 0;
const utils_1 = require("@streamr/utils");
const GroupKeyRequest_1 = require("./GroupKeyRequest");
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
class GroupKeyRequestTranslator {
    static toProtobuf(msg) {
        const translated = {
            recipientId: (0, utils_1.toUserIdRaw)(msg.recipient),
            requestId: msg.requestId,
            rsaPublicKey: (0, utils_1.utf8ToBinary)(msg.rsaPublicKey),
            groupKeyIds: [...msg.groupKeyIds]
        };
        return translated;
    }
    static toClientProtocol(msg) {
        const translated = new GroupKeyRequest_1.GroupKeyRequest({
            recipient: (0, utils_1.toUserId)(msg.recipientId),
            requestId: msg.requestId,
            rsaPublicKey: (0, utils_1.binaryToUtf8)(msg.rsaPublicKey),
            groupKeyIds: msg.groupKeyIds
        });
        return translated;
    }
}
exports.GroupKeyRequestTranslator = GroupKeyRequestTranslator;
//# sourceMappingURL=GroupKeyRequestTranslator.js.map