"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.affiliateInfo = this.affiliateInfo.bind(this);
        this.referredBy = this.referredBy.bind(this);
        this.allAffiliateTiers = this.allAffiliateTiers.bind(this);
        this.affiliateWhitelist = this.affiliateWhitelist.bind(this);
        this.affiliateParameters = this.affiliateParameters.bind(this);
        this.affiliateOverrides = this.affiliateOverrides.bind(this);
    }
    affiliateInfo(request) {
        const data = query_1.AffiliateInfoRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.affiliates.Query", "AffiliateInfo", data);
        return promise.then(data => query_1.AffiliateInfoResponse.decode(new _m0.Reader(data)));
    }
    referredBy(request) {
        const data = query_1.ReferredByRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.affiliates.Query", "ReferredBy", data);
        return promise.then(data => query_1.ReferredByResponse.decode(new _m0.Reader(data)));
    }
    allAffiliateTiers(request = {}) {
        const data = query_1.AllAffiliateTiersRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.affiliates.Query", "AllAffiliateTiers", data);
        return promise.then(data => query_1.AllAffiliateTiersResponse.decode(new _m0.Reader(data)));
    }
    affiliateWhitelist(request = {}) {
        const data = query_1.AffiliateWhitelistRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.affiliates.Query", "AffiliateWhitelist", data);
        return promise.then(data => query_1.AffiliateWhitelistResponse.decode(new _m0.Reader(data)));
    }
    affiliateParameters(request = {}) {
        const data = query_1.AffiliateParametersRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.affiliates.Query", "AffiliateParameters", data);
        return promise.then(data => query_1.AffiliateParametersResponse.decode(new _m0.Reader(data)));
    }
    affiliateOverrides(request = {}) {
        const data = query_1.AffiliateOverridesRequest.encode(request).finish();
        const promise = this.rpc.request("ritbit.affiliates.Query", "AffiliateOverrides", data);
        return promise.then(data => query_1.AffiliateOverridesResponse.decode(new _m0.Reader(data)));
    }
}
exports.QueryClientImpl = QueryClientImpl;
const createRpcQueryExtension = (base) => {
    const rpc = (0, stargate_1.createProtobufRpcClient)(base);
    const queryService = new QueryClientImpl(rpc);
    return {
        affiliateInfo(request) {
            return queryService.affiliateInfo(request);
        },
        referredBy(request) {
            return queryService.referredBy(request);
        },
        allAffiliateTiers(request) {
            return queryService.allAffiliateTiers(request);
        },
        affiliateWhitelist(request) {
            return queryService.affiliateWhitelist(request);
        },
        affiliateParameters(request) {
            return queryService.affiliateParameters(request);
        },
        affiliateOverrides(request) {
            return queryService.affiliateOverrides(request);
        }
    };
};
exports.createRpcQueryExtension = createRpcQueryExtension;
//# sourceMappingURL=data:application/json;base64, 