"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UtxoBlock = void 0;
const utils_1 = require("../../utils/utils");
const BlockBase_1 = require("../BlockBase");
class UtxoBlock extends BlockBase_1.BlockBase {
    get data() {
        return this.privateData;
    }
    //
    get number() {
        return this.data.height;
    }
    get blockHash() {
        return this.data.hash;
    }
    get stdBlockHash() {
        return this.data.hash;
    }
    get previousBlockHash() {
        return this.data.previousblockhash;
    }
    get stdPreviousBlockHash() {
        return this.data.previousblockhash;
    }
    get unixTimestamp() {
        return this.data.time;
    }
    get transactionIds() {
        var _a;
        return (_a = this.data.tx) === null || _a === void 0 ? void 0 : _a.map((tx) => {
            /* istanbul ignore if */
            if (!tx) {
                return "0x0";
            }
            /* istanbul ignore else */
            if (tx.txid) {
                return (0, utils_1.prefix0x)(tx.txid);
            }
            else {
                if (typeof tx === "string") {
                    // eslint-disable-next-line @typescript-eslint/no-explicit-any
                    return (0, utils_1.prefix0x)(tx);
                }
                else {
                    return "0x0";
                }
            }
        });
    }
    get stdTransactionIds() {
        var _a;
        // todo: @Luka: tx is already Id on DOGE
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        return (_a = this.data.tx) === null || _a === void 0 ? void 0 : _a.map((tx) => (tx.txid ? tx.txid : tx));
    }
    get transactionCount() {
        return this.data.tx.length;
    }
}
exports.UtxoBlock = UtxoBlock;
//# sourceMappingURL=UtxoBlock.js.map