"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.createRpcQueryExtension = exports.QueryClientImpl = void 0;
const _m0 = __importStar(require("protobufjs/minimal"));
const stargate_1 = require("@cosmjs/stargate");
const query_1 = require("./query");
class QueryClientImpl {
    constructor(rpc) {
        this.rpc = rpc;
        this.clobPair = this.clobPair.bind(this);
        this.clobPairAll = this.clobPairAll.bind(this);
        this.mevNodeToNodeCalculation = this.mevNodeToNodeCalculation.bind(this);
        this.equityTierLimitConfiguration = this.equityTierLimitConfiguration.bind(this);
        this.blockRateLimitConfiguration = this.blockRateLimitConfiguration.bind(this);
        this.liquidationsConfiguration = this.liquidationsConfiguration.bind(this);
        this.statefulOrder = this.statefulOrder.bind(this);
        this.nextClobPairId = this.nextClobPairId.bind(this);
        this.leverage = this.leverage.bind(this);
        this.streamOrderbookUpdates = this.streamOrderbookUpdates.bind(this);
    }
    clobPair(request) {
        const data = query_1.QueryGetClobPairRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.clob.Query", "ClobPair", data);
        return promise.then(data => query_1.QueryClobPairResponse.decode(new _m0.Reader(data)));
    }
    clobPairAll(request = {
        pagination: undefined
    }) {
        const data = query_1.QueryAllClobPairRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.clob.Query", "ClobPairAll", data);
        return promise.then(data => query_1.QueryClobPairAllResponse.decode(new _m0.Reader(data)));
    }
    mevNodeToNodeCalculation(request) {
        const data = query_1.MevNodeToNodeCalculationRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.clob.Query", "MevNodeToNodeCalculation", data);
        return promise.then(data => query_1.MevNodeToNodeCalculationResponse.decode(new _m0.Reader(data)));
    }
    equityTierLimitConfiguration(request = {}) {
        const data = query_1.QueryEquityTierLimitConfigurationRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.clob.Query", "EquityTierLimitConfiguration", data);
        return promise.then(data => query_1.QueryEquityTierLimitConfigurationResponse.decode(new _m0.Reader(data)));
    }
    blockRateLimitConfiguration(request = {}) {
        const data = query_1.QueryBlockRateLimitConfigurationRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.clob.Query", "BlockRateLimitConfiguration", data);
        return promise.then(data => query_1.QueryBlockRateLimitConfigurationResponse.decode(new _m0.Reader(data)));
    }
    liquidationsConfiguration(request = {}) {
        const data = query_1.QueryLiquidationsConfigurationRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.clob.Query", "LiquidationsConfiguration", data);
        return promise.then(data => query_1.QueryLiquidationsConfigurationResponse.decode(new _m0.Reader(data)));
    }
    statefulOrder(request) {
        const data = query_1.QueryStatefulOrderRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.clob.Query", "StatefulOrder", data);
        return promise.then(data => query_1.QueryStatefulOrderResponse.decode(new _m0.Reader(data)));
    }
    nextClobPairId(request = {}) {
        const data = query_1.QueryNextClobPairIdRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.clob.Query", "NextClobPairId", data);
        return promise.then(data => query_1.QueryNextClobPairIdResponse.decode(new _m0.Reader(data)));
    }
    leverage(request) {
        const data = query_1.QueryLeverageRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.clob.Query", "Leverage", data);
        return promise.then(data => query_1.QueryLeverageResponse.decode(new _m0.Reader(data)));
    }
    streamOrderbookUpdates(request) {
        const data = query_1.StreamOrderbookUpdatesRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.clob.Query", "StreamOrderbookUpdates", data);
        return promise.then(data => query_1.StreamOrderbookUpdatesResponse.decode(new _m0.Reader(data)));
    }
}
exports.QueryClientImpl = QueryClientImpl;
const createRpcQueryExtension = (base) => {
    const rpc = (0, stargate_1.createProtobufRpcClient)(base);
    const queryService = new QueryClientImpl(rpc);
    return {
        clobPair(request) {
            return queryService.clobPair(request);
        },
        clobPairAll(request) {
            return queryService.clobPairAll(request);
        },
        mevNodeToNodeCalculation(request) {
            return queryService.mevNodeToNodeCalculation(request);
        },
        equityTierLimitConfiguration(request) {
            return queryService.equityTierLimitConfiguration(request);
        },
        blockRateLimitConfiguration(request) {
            return queryService.blockRateLimitConfiguration(request);
        },
        liquidationsConfiguration(request) {
            return queryService.liquidationsConfiguration(request);
        },
        statefulOrder(request) {
            return queryService.statefulOrder(request);
        },
        nextClobPairId(request) {
            return queryService.nextClobPairId(request);
        },
        leverage(request) {
            return queryService.leverage(request);
        },
        streamOrderbookUpdates(request) {
            return queryService.streamOrderbookUpdates(request);
        }
    };
};
exports.createRpcQueryExtension = createRpcQueryExtension;
//# sourceMappingURL=data:application/json;base64, 