"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.marketMapperRevenueShareParams = this.marketMapperRevenueShareParams.bind(this);
        this.marketMapperRevShareDetails = this.marketMapperRevShareDetails.bind(this);
        this.unconditionalRevShareConfig = this.unconditionalRevShareConfig.bind(this);
        this.orderRouterRevShare = this.orderRouterRevShare.bind(this);
        this.vaultRevShareConfig = this.vaultRevShareConfig.bind(this);
    }
    marketMapperRevenueShareParams(request = {}) {
        const data = query_1.QueryMarketMapperRevenueShareParams.encode(request).finish();
        const promise = this.rpc.request("ritbit.revshare.Query", "MarketMapperRevenueShareParams", data);
        return promise.then(data => query_1.QueryMarketMapperRevenueShareParamsResponse.decode(new _m0.Reader(data)));
    }
    marketMapperRevShareDetails(request) {
        const data = query_1.QueryMarketMapperRevShareDetails.encode(request).finish();
        const promise = this.rpc.request("ritbit.revshare.Query", "MarketMapperRevShareDetails", data);
        return promise.then(data => query_1.QueryMarketMapperRevShareDetailsResponse.decode(new _m0.Reader(data)));
    }
    unconditionalRevShareConfig(request = {}) {
        const data = query_1.QueryUnconditionalRevShareConfig.encode(request).finish();
        const promise = this.rpc.request("ritbit.revshare.Query", "UnconditionalRevShareConfig", data);
        return promise.then(data => query_1.QueryUnconditionalRevShareConfigResponse.decode(new _m0.Reader(data)));
    }
    orderRouterRevShare(request) {
        const data = query_1.QueryOrderRouterRevShare.encode(request).finish();
        const promise = this.rpc.request("ritbit.revshare.Query", "OrderRouterRevShare", data);
        return promise.then(data => query_1.QueryOrderRouterRevShareResponse.decode(new _m0.Reader(data)));
    }
    vaultRevShareConfig(request = {}) {
        const data = query_1.QueryVaultRevShareConfig.encode(request).finish();
        const promise = this.rpc.request("ritbit.revshare.Query", "VaultRevShareConfig", data);
        return promise.then(data => query_1.QueryVaultRevShareConfigResponse.decode(new _m0.Reader(data)));
    }
}
exports.QueryClientImpl = QueryClientImpl;
const createRpcQueryExtension = (base) => {
    const rpc = (0, stargate_1.createProtobufRpcClient)(base);
    const queryService = new QueryClientImpl(rpc);
    return {
        marketMapperRevenueShareParams(request) {
            return queryService.marketMapperRevenueShareParams(request);
        },
        marketMapperRevShareDetails(request) {
            return queryService.marketMapperRevShareDetails(request);
        },
        unconditionalRevShareConfig(request) {
            return queryService.unconditionalRevShareConfig(request);
        },
        orderRouterRevShare(request) {
            return queryService.orderRouterRevShare(request);
        },
        vaultRevShareConfig(request) {
            return queryService.vaultRevShareConfig(request);
        }
    };
};
exports.createRpcQueryExtension = createRpcQueryExtension;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnkucnBjLlF1ZXJ5Lmp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