"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.LiquidateSubaccountsResponse = exports.LiquidateSubaccountsRequest = void 0;
const subaccount_1 = require("../../subaccounts/subaccount");
const liquidations_1 = require("../../clob/liquidations");
const _m0 = __importStar(require("protobufjs/minimal"));
function createBaseLiquidateSubaccountsRequest() {
    return {
        blockHeight: 0,
        liquidatableSubaccountIds: [],
        negativeTncSubaccountIds: [],
        subaccountOpenPositionInfo: []
    };
}
exports.LiquidateSubaccountsRequest = {
    encode(message, writer = _m0.Writer.create()) {
        if (message.blockHeight !== 0) {
            writer.uint32(8).uint32(message.blockHeight);
        }
        for (const v of message.liquidatableSubaccountIds) {
            subaccount_1.SubaccountId.encode(v, writer.uint32(18).fork()).ldelim();
        }
        for (const v of message.negativeTncSubaccountIds) {
            subaccount_1.SubaccountId.encode(v, writer.uint32(26).fork()).ldelim();
        }
        for (const v of message.subaccountOpenPositionInfo) {
            liquidations_1.SubaccountOpenPositionInfo.encode(v, writer.uint32(34).fork()).ldelim();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseLiquidateSubaccountsRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.blockHeight = reader.uint32();
                    break;
                case 2:
                    message.liquidatableSubaccountIds.push(subaccount_1.SubaccountId.decode(reader, reader.uint32()));
                    break;
                case 3:
                    message.negativeTncSubaccountIds.push(subaccount_1.SubaccountId.decode(reader, reader.uint32()));
                    break;
                case 4:
                    message.subaccountOpenPositionInfo.push(liquidations_1.SubaccountOpenPositionInfo.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        var _a, _b, _c, _d;
        const message = createBaseLiquidateSubaccountsRequest();
        message.blockHeight = (_a = object.blockHeight) !== null && _a !== void 0 ? _a : 0;
        message.liquidatableSubaccountIds = ((_b = object.liquidatableSubaccountIds) === null || _b === void 0 ? void 0 : _b.map(e => subaccount_1.SubaccountId.fromPartial(e))) || [];
        message.negativeTncSubaccountIds = ((_c = object.negativeTncSubaccountIds) === null || _c === void 0 ? void 0 : _c.map(e => subaccount_1.SubaccountId.fromPartial(e))) || [];
        message.subaccountOpenPositionInfo = ((_d = object.subaccountOpenPositionInfo) === null || _d === void 0 ? void 0 : _d.map(e => liquidations_1.SubaccountOpenPositionInfo.fromPartial(e))) || [];
        return message;
    }
};
function createBaseLiquidateSubaccountsResponse() {
    return {};
}
exports.LiquidateSubaccountsResponse = {
    encode(_, writer = _m0.Writer.create()) {
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseLiquidateSubaccountsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(_) {
        const message = createBaseLiquidateSubaccountsResponse();
        return message;
    }
};
//# sourceMappingURL=data:application/json;base64, 