"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.setMarketsHardCap = this.setMarketsHardCap.bind(this);
        this.createMarketPermissionless = this.createMarketPermissionless.bind(this);
        this.setListingVaultDepositParams = this.setListingVaultDepositParams.bind(this);
        this.upgradeIsolatedPerpetualToCross = this.upgradeIsolatedPerpetualToCross.bind(this);
    }
    setMarketsHardCap(request) {
        const data = tx_1.MsgSetMarketsHardCap.encode(request).finish();
        const promise = this.rpc.request("ritbit.listing.Msg", "SetMarketsHardCap", data);
        return promise.then(data => tx_1.MsgSetMarketsHardCapResponse.decode(new _m0.Reader(data)));
    }
    createMarketPermissionless(request) {
        const data = tx_1.MsgCreateMarketPermissionless.encode(request).finish();
        const promise = this.rpc.request("ritbit.listing.Msg", "CreateMarketPermissionless", data);
        return promise.then(data => tx_1.MsgCreateMarketPermissionlessResponse.decode(new _m0.Reader(data)));
    }
    setListingVaultDepositParams(request) {
        const data = tx_1.MsgSetListingVaultDepositParams.encode(request).finish();
        const promise = this.rpc.request("ritbit.listing.Msg", "SetListingVaultDepositParams", data);
        return promise.then(data => tx_1.MsgSetListingVaultDepositParamsResponse.decode(new _m0.Reader(data)));
    }
    upgradeIsolatedPerpetualToCross(request) {
        const data = tx_1.MsgUpgradeIsolatedPerpetualToCross.encode(request).finish();
        const promise = this.rpc.request("ritbit.listing.Msg", "UpgradeIsolatedPerpetualToCross", data);
        return promise.then(data => tx_1.MsgUpgradeIsolatedPerpetualToCrossResponse.decode(new _m0.Reader(data)));
    }
}
exports.MsgClientImpl = MsgClientImpl;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHgucnBjLm1zZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL25vZGVfbW9kdWxlcy9Acml0Yml0L3Y0LXByb3RvL3NyYy9jb2RlZ2VuL3JpdGJpdC9saXN0aW5nL3R4LnJwYy5tc2cudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQ0Esd0RBQTBDO0FBQzFDLDZCQUEwUztBQW1CMVMsTUFBYSxhQUFhO0lBR3hCLFlBQVksR0FBUTtRQUNsQixJQUFJLENBQUMsR0FBRyxHQUFHLEdBQUcsQ0FBQztRQUNmLElBQUksQ0FBQyxpQkFBaUIsR0FBRyxJQUFJLENBQUMsaUJBQWlCLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO1FBQzNELElBQUksQ0FBQywwQkFBMEIsR0FBRyxJQUFJLENBQ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