"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.RedisOrder = exports.RedisOrder_TickerTypeSDKType = exports.RedisOrder_TickerType = void 0;
exports.redisOrder_TickerTypeFromJSON = redisOrder_TickerTypeFromJSON;
exports.redisOrder_TickerTypeToJSON = redisOrder_TickerTypeToJSON;
const clob_1 = require("../protocol/v1/clob");
const _m0 = __importStar(require("protobufjs/minimal"));
/** Enum for the ticker type, PERPETUAL or SPOT. */
var RedisOrder_TickerType;
(function (RedisOrder_TickerType) {
    /**
     * TICKER_TYPE_UNSPECIFIED - Default value for the enum. Should never be used in an initialized
     * `RedisOrder`.
     */
    RedisOrder_TickerType[RedisOrder_TickerType["TICKER_TYPE_UNSPECIFIED"] = 0] = "TICKER_TYPE_UNSPECIFIED";
    /** TICKER_TYPE_PERPETUAL - Ticker is for a perpetual pair. */
    RedisOrder_TickerType[RedisOrder_TickerType["TICKER_TYPE_PERPETUAL"] = 1] = "TICKER_TYPE_PERPETUAL";
    /** TICKER_TYPE_SPOT - Ticker is for a spot pair. */
    RedisOrder_TickerType[RedisOrder_TickerType["TICKER_TYPE_SPOT"] = 2] = "TICKER_TYPE_SPOT";
    RedisOrder_TickerType[RedisOrder_TickerType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(RedisOrder_TickerType || (exports.RedisOrder_TickerType = RedisOrder_TickerType = {}));
exports.RedisOrder_TickerTypeSDKType = RedisOrder_TickerType;
function redisOrder_TickerTypeFromJSON(object) {
    switch (object) {
        case 0:
        case "TICKER_TYPE_UNSPECIFIED":
            return RedisOrder_TickerType.TICKER_TYPE_UNSPECIFIED;
        case 1:
        case "TICKER_TYPE_PERPETUAL":
            return RedisOrder_TickerType.TICKER_TYPE_PERPETUAL;
        case 2:
        case "TICKER_TYPE_SPOT":
            return RedisOrder_TickerType.TICKER_TYPE_SPOT;
        case -1:
        case "UNRECOGNIZED":
        default:
            return RedisOrder_TickerType.UNRECOGNIZED;
    }
}
function redisOrder_TickerTypeToJSON(object) {
    switch (object) {
        case RedisOrder_TickerType.TICKER_TYPE_UNSPECIFIED:
            return "TICKER_TYPE_UNSPECIFIED";
        case RedisOrder_TickerType.TICKER_TYPE_PERPETUAL:
            return "TICKER_TYPE_PERPETUAL";
        case RedisOrder_TickerType.TICKER_TYPE_SPOT:
            return "TICKER_TYPE_SPOT";
        case RedisOrder_TickerType.UNRECOGNIZED:
        default:
            return "UNRECOGNIZED";
    }
}
function createBaseRedisOrder() {
    return {
        id: "",
        order: undefined,
        ticker: "",
        tickerType: 0,
        price: "",
        size: ""
    };
}
exports.RedisOrder = {
    encode(message, writer = _m0.Writer.create()) {
        if (message.id !== "") {
            writer.uint32(10).string(message.id);
        }
        if (message.order !== undefined) {
            clob_1.IndexerOrder.encode(message.order, writer.uint32(18).fork()).ldelim();
        }
        if (message.ticker !== "") {
            writer.uint32(26).string(message.ticker);
        }
        if (message.tickerType !== 0) {
            writer.uint32(32).int32(message.tickerType);
        }
        if (message.price !== "") {
            writer.uint32(42).string(message.price);
        }
        if (message.size !== "") {
            writer.uint32(50).string(message.size);
        }
        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 = createBaseRedisOrder();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.id = reader.string();
                    break;
                case 2:
                    message.order = clob_1.IndexerOrder.decode(reader, reader.uint32());
                    break;
                case 3:
                    message.ticker = reader.string();
                    break;
                case 4:
                    message.tickerType = reader.int32();
                    break;
                case 5:
                    message.price = reader.string();
                    break;
                case 6:
                    message.size = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        var _a, _b, _c, _d, _e;
        const message = createBaseRedisOrder();
        message.id = (_a = object.id) !== null && _a !== void 0 ? _a : "";
        message.order = object.order !== undefined && object.order !== null ? clob_1.IndexerOrder.fromPartial(object.order) : undefined;
        message.ticker = (_b = object.ticker) !== null && _b !== void 0 ? _b : "";
        message.tickerType = (_c = object.tickerType) !== null && _c !== void 0 ? _c : 0;
        message.price = (_d = object.price) !== null && _d !== void 0 ? _d : "";
        message.size = (_e = object.size) !== null && _e !== void 0 ? _e : "";
        return message;
    }
};
//# sourceMappingURL=data:application/json;base64, 