"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializePoqoSendReceiptReq = serializePoqoSendReceiptReq;
exports.deserializePoqoSendReceiptReq = deserializePoqoSendReceiptReq;
const TypeIdentifierEnum_1 = require("./enum/TypeIdentifierEnum");
const SignedReceipt_1 = require("./SignedReceipt");
const cPoqoSendReceiptReqVersion = 1;
function serializePoqoSendReceiptReq(stream, obj, root = false) {
    if (root) {
        stream.writeUInt16(TypeIdentifierEnum_1.TypeIdentifierEnum.cPoqoSendReceiptReq);
    }
    stream.writeUInt8(cPoqoSendReceiptReqVersion);
    (0, SignedReceipt_1.serializeSignedReceipt)(stream, obj);
    stream.writeUInt32(obj.txGroupCycle);
}
function deserializePoqoSendReceiptReq(stream) {
    const version = stream.readUInt8();
    if (version > cPoqoSendReceiptReqVersion) {
        throw new Error('PoQoSendReceiptReq Unsupported version');
    }
    return { ...(0, SignedReceipt_1.deserializeSignedReceipt)(stream), txGroupCycle: stream.readUInt32() };
}
//# sourceMappingURL=PoqoSendReceiptReq.js.map