"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TimestampToHeight = exports.HeightToTimestamp = exports.HeightToDate = exports.DateToHeight = void 0;
const genesisTimestamp = 1648598400;
function DateToHeight(date) {
    const timestamp = date.getTime() / 1000;
    return TimestampToHeight(timestamp);
}
exports.DateToHeight = DateToHeight;
function HeightToDate(height) {
    const d = new Date();
    d.setTime(HeightToTimestamp(height) * 1000);
    return d;
}
exports.HeightToDate = HeightToDate;
function HeightToTimestamp(height) {
    return (height * 30) + genesisTimestamp;
}
exports.HeightToTimestamp = HeightToTimestamp;
function TimestampToHeight(timestamp) {
    return Math.floor((timestamp - genesisTimestamp) / 30);
}
exports.TimestampToHeight = TimestampToHeight;
//# sourceMappingURL=ChainHeight.js.map