"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatLog = formatLog;
function formatLog(log, { args, eventName, } = {}) {
    return {
        ...log,
        blockHash: log.blockHash ? log.blockHash : null,
        blockNumber: log.blockNumber ? BigInt(log.blockNumber) : null,
        blockTimestamp: log.blockTimestamp
            ? BigInt(log.blockTimestamp)
            : log.blockTimestamp === null
                ? null
                : undefined,
        logIndex: log.logIndex ? Number(log.logIndex) : null,
        transactionHash: log.transactionHash ? log.transactionHash : null,
        transactionIndex: log.transactionIndex
            ? Number(log.transactionIndex)
            : null,
        ...(eventName ? { args, eventName } : {}),
    };
}
//# sourceMappingURL=log.js.map