"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertBytesToGroupKeyResponse = exports.convertGroupKeyResponseToBytes = exports.convertBytesToGroupKeyRequest = exports.convertGroupKeyRequestToBytes = void 0;
exports.convertStreamMessageToBytes = convertStreamMessageToBytes;
exports.convertBytesToStreamMessage = convertBytesToStreamMessage;
const trackerless_network_1 = require("@streamr/trackerless-network");
const GroupKeyRequestTranslator_1 = require("./GroupKeyRequestTranslator");
const GroupKeyResponseTranslator_1 = require("./GroupKeyResponseTranslator");
const StreamMessageTranslator_1 = require("./StreamMessageTranslator");
function convertStreamMessageToBytes(oldStreamMessage) {
    return trackerless_network_1.StreamMessage.toBinary(StreamMessageTranslator_1.StreamMessageTranslator.toProtobuf(oldStreamMessage));
}
function convertBytesToStreamMessage(bytes) {
    return StreamMessageTranslator_1.StreamMessageTranslator.toClientProtocol(trackerless_network_1.StreamMessage.fromBinary(bytes));
}
const convertGroupKeyRequestToBytes = (oldGroupKeyRequest) => {
    return trackerless_network_1.GroupKeyRequest.toBinary(GroupKeyRequestTranslator_1.GroupKeyRequestTranslator.toProtobuf(oldGroupKeyRequest));
};
exports.convertGroupKeyRequestToBytes = convertGroupKeyRequestToBytes;
const convertBytesToGroupKeyRequest = (bytes) => {
    return GroupKeyRequestTranslator_1.GroupKeyRequestTranslator.toClientProtocol(trackerless_network_1.GroupKeyRequest.fromBinary(bytes));
};
exports.convertBytesToGroupKeyRequest = convertBytesToGroupKeyRequest;
const convertGroupKeyResponseToBytes = (oldGroupKeyResponse) => {
    return trackerless_network_1.GroupKeyResponse.toBinary(GroupKeyResponseTranslator_1.GroupKeyResponseTranslator.toProtobuf(oldGroupKeyResponse));
};
exports.convertGroupKeyResponseToBytes = convertGroupKeyResponseToBytes;
const convertBytesToGroupKeyResponse = (bytes) => {
    return GroupKeyResponseTranslator_1.GroupKeyResponseTranslator.toClientProtocol(trackerless_network_1.GroupKeyResponse.fromBinary(bytes));
};
exports.convertBytesToGroupKeyResponse = convertBytesToGroupKeyResponse;
//# sourceMappingURL=oldStreamMessageBinaryUtils.js.map