"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deserializeGetConfirmOrChallengeReq = exports.serializeGetConfirmOrChallengeReq = void 0;
const TypeIdentifierEnum_1 = require("./enum/TypeIdentifierEnum");
const cGetConfirmOrChallengeReqVersion = 1;
function serializeGetConfirmOrChallengeReq(stream, obj, root = false) {
    if (root) {
        stream.writeUInt16(TypeIdentifierEnum_1.TypeIdentifierEnum.cGetConfirmOrChallengeReq);
    }
    stream.writeUInt8(cGetConfirmOrChallengeReqVersion);
    stream.writeString(obj.txId);
}
exports.serializeGetConfirmOrChallengeReq = serializeGetConfirmOrChallengeReq;
function deserializeGetConfirmOrChallengeReq(stream) {
    const version = stream.readUInt8();
    if (version > cGetConfirmOrChallengeReqVersion) {
        throw new Error('GetConfirmOrChallengeReq version mismatch');
    }
    return {
        txId: stream.readString(),
    };
}
exports.deserializeGetConfirmOrChallengeReq = deserializeGetConfirmOrChallengeReq;
//# sourceMappingURL=GetConfirmOrChallengeReq.js.map