"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.MsgClientImpl = void 0;
const _m0 = __importStar(require("protobufjs/minimal"));
const tx_1 = require("./tx");
class MsgClientImpl {
    constructor(rpc) {
        this.rpc = rpc;
        this.registerAffiliate = this.registerAffiliate.bind(this);
        this.updateAffiliateTiers = this.updateAffiliateTiers.bind(this);
        this.updateAffiliateWhitelist = this.updateAffiliateWhitelist.bind(this);
        this.updateAffiliateParameters = this.updateAffiliateParameters.bind(this);
        this.updateAffiliateOverrides = this.updateAffiliateOverrides.bind(this);
    }
    registerAffiliate(request) {
        const data = tx_1.MsgRegisterAffiliate.encode(request).finish();
        const promise = this.rpc.request("ritbit.affiliates.Msg", "RegisterAffiliate", data);
        return promise.then(data => tx_1.MsgRegisterAffiliateResponse.decode(new _m0.Reader(data)));
    }
    updateAffiliateTiers(request) {
        const data = tx_1.MsgUpdateAffiliateTiers.encode(request).finish();
        const promise = this.rpc.request("ritbit.affiliates.Msg", "UpdateAffiliateTiers", data);
        return promise.then(data => tx_1.MsgUpdateAffiliateTiersResponse.decode(new _m0.Reader(data)));
    }
    updateAffiliateWhitelist(request) {
        const data = tx_1.MsgUpdateAffiliateWhitelist.encode(request).finish();
        const promise = this.rpc.request("ritbit.affiliates.Msg", "UpdateAffiliateWhitelist", data);
        return promise.then(data => tx_1.MsgUpdateAffiliateWhitelistResponse.decode(new _m0.Reader(data)));
    }
    updateAffiliateParameters(request) {
        const data = tx_1.MsgUpdateAffiliateParameters.encode(request).finish();
        const promise = this.rpc.request("ritbit.affiliates.Msg", "UpdateAffiliateParameters", data);
        return promise.then(data => tx_1.MsgUpdateAffiliateParametersResponse.decode(new _m0.Reader(data)));
    }
    updateAffiliateOverrides(request) {
        const data = tx_1.MsgUpdateAffiliateOverrides.encode(request).finish();
        const promise = this.rpc.request("ritbit.affiliates.Msg", "UpdateAffiliateOverrides", data);
        return promise.then(data => tx_1.MsgUpdateAffiliateOverridesResponse.decode(new _m0.Reader(data)));
    }
}
exports.MsgClientImpl = MsgClientImpl;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHgucnBjLm1zZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL25vZGVfbW9kdWxlcy9Acml0Yml0L3Y0LXByb3RvL3NyYy9jb2RlZ2VuL3JpdGJpdC9hZmZpbGlhdGVzL3R4LnJwYy5tc2cudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQ0Esd0RBQTBDO0FBQzFDLDZCQUE0VTtBQW1CNVUsTUFBYSxhQUFhO0lBR3hCLFlBQVksR0FBUTtRQUNsQixJQUFJLENBQUMsR0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