"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MessageID = void 0;
const utils_1 = require("@streamr/utils");
const MessageRef_1 = require("./MessageRef");
const validations_1 = require("./validations");
class MessageID {
    streamId;
    streamPartition;
    timestamp;
    sequenceNumber;
    publisherId;
    msgChainId;
    constructor(streamId, streamPartition, timestamp, sequenceNumber, publisherId, msgChainId) {
        (0, validations_1.validateIsNotNegativeInteger)('streamPartition', streamPartition);
        (0, validations_1.validateIsNotNegativeInteger)('timestamp', timestamp);
        (0, validations_1.validateIsNotNegativeInteger)('sequenceNumber', sequenceNumber);
        this.streamId = streamId;
        this.streamPartition = streamPartition;
        this.timestamp = timestamp;
        this.sequenceNumber = sequenceNumber;
        this.publisherId = publisherId;
        this.msgChainId = msgChainId;
    }
    getStreamPartID() {
        return (0, utils_1.toStreamPartID)(this.streamId, this.streamPartition);
    }
    toMessageRef() {
        return new MessageRef_1.MessageRef(this.timestamp, this.sequenceNumber);
    }
}
exports.MessageID = MessageID;
//# sourceMappingURL=MessageID.js.map