"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.addPremiumVotes = this.addPremiumVotes.bind(this);
        this.createPerpetual = this.createPerpetual.bind(this);
        this.setLiquidityTier = this.setLiquidityTier.bind(this);
        this.updatePerpetualParams = this.updatePerpetualParams.bind(this);
        this.updateParams = this.updateParams.bind(this);
    }
    addPremiumVotes(request) {
        const data = tx_1.MsgAddPremiumVotes.encode(request).finish();
        const promise = this.rpc.request("ritbit.perpetuals.Msg", "AddPremiumVotes", data);
        return promise.then(data => tx_1.MsgAddPremiumVotesResponse.decode(new _m0.Reader(data)));
    }
    createPerpetual(request) {
        const data = tx_1.MsgCreatePerpetual.encode(request).finish();
        const promise = this.rpc.request("ritbit.perpetuals.Msg", "CreatePerpetual", data);
        return promise.then(data => tx_1.MsgCreatePerpetualResponse.decode(new _m0.Reader(data)));
    }
    setLiquidityTier(request) {
        const data = tx_1.MsgSetLiquidityTier.encode(request).finish();
        const promise = this.rpc.request("ritbit.perpetuals.Msg", "SetLiquidityTier", data);
        return promise.then(data => tx_1.MsgSetLiquidityTierResponse.decode(new _m0.Reader(data)));
    }
    updatePerpetualParams(request) {
        const data = tx_1.MsgUpdatePerpetualParams.encode(request).finish();
        const promise = this.rpc.request("ritbit.perpetuals.Msg", "UpdatePerpetualParams", data);
        return promise.then(data => tx_1.MsgUpdatePerpetualParamsResponse.decode(new _m0.Reader(data)));
    }
    updateParams(request) {
        const data = tx_1.MsgUpdateParams.encode(request).finish();
        const promise = this.rpc.request("ritbit.perpetuals.Msg", "UpdateParams", data);
        return promise.then(data => tx_1.MsgUpdateParamsResponse.decode(new _m0.Reader(data)));
    }
}
exports.MsgClientImpl = MsgClientImpl;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHgucnBjLm1zZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL25vZGVfbW9kdWxlcy9Acml0Yml0L3Y0LXByb3RvL3NyYy9jb2RlZ2VuL3JpdGJpdC9wZXJwZXR1YWxzL3R4LnJwYy5tc2cudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQ0Esd0RBQTBDO0FBQzFDLDZCQUE4UTtBQXlCOVEsTUFBYSxhQUFhO0lBR3hCLFlBQVksR0FBUTtRQUNsQixJQUFJLENBQUMsR0FBRyxHQUFHLEdBQUcsQ0FBQztRQUNmLElBQUksQ0FBQyxlQUFlLEdBQUcsSUFBSSxDQUFDLGVBQWUsQ0FBQyxJQUF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