"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.MsgClientImpl = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _m0 = _interopRequireWildcard(require("protobufjs/minimal"));
var _tx = require("./tx");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
//@ts-nocheck
/** Msg defines the ibc/client Msg service. */
var MsgClientImpl = exports.MsgClientImpl = /*#__PURE__*/function () {
  function MsgClientImpl(rpc) {
    (0, _classCallCheck2["default"])(this, MsgClientImpl);
    (0, _defineProperty2["default"])(this, "rpc", void 0);
    this.rpc = rpc;
    this.createClient = this.createClient.bind(this);
    this.updateClient = this.updateClient.bind(this);
    this.upgradeClient = this.upgradeClient.bind(this);
    this.submitMisbehaviour = this.submitMisbehaviour.bind(this);
    this.recoverClient = this.recoverClient.bind(this);
    this.iBCSoftwareUpgrade = this.iBCSoftwareUpgrade.bind(this);
    this.updateClientParams = this.updateClientParams.bind(this);
  }
  return (0, _createClass2["default"])(MsgClientImpl, [{
    key: "createClient",
    value: function createClient(request) {
      var data = _tx.MsgCreateClient.encode(request).finish();
      var promise = this.rpc.request("ibc.core.client.v1.Msg", "CreateClient", data);
      return promise.then(function (data) {
        return _tx.MsgCreateClientResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "updateClient",
    value: function updateClient(request) {
      var data = _tx.MsgUpdateClient.encode(request).finish();
      var promise = this.rpc.request("ibc.core.client.v1.Msg", "UpdateClient", data);
      return promise.then(function (data) {
        return _tx.MsgUpdateClientResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "upgradeClient",
    value: function upgradeClient(request) {
      var data = _tx.MsgUpgradeClient.encode(request).finish();
      var promise = this.rpc.request("ibc.core.client.v1.Msg", "UpgradeClient", data);
      return promise.then(function (data) {
        return _tx.MsgUpgradeClientResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "submitMisbehaviour",
    value: function submitMisbehaviour(request) {
      var data = _tx.MsgSubmitMisbehaviour.encode(request).finish();
      var promise = this.rpc.request("ibc.core.client.v1.Msg", "SubmitMisbehaviour", data);
      return promise.then(function (data) {
        return _tx.MsgSubmitMisbehaviourResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "recoverClient",
    value: function recoverClient(request) {
      var data = _tx.MsgRecoverClient.encode(request).finish();
      var promise = this.rpc.request("ibc.core.client.v1.Msg", "RecoverClient", data);
      return promise.then(function (data) {
        return _tx.MsgRecoverClientResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "iBCSoftwareUpgrade",
    value: function iBCSoftwareUpgrade(request) {
      var data = _tx.MsgIBCSoftwareUpgrade.encode(request).finish();
      var promise = this.rpc.request("ibc.core.client.v1.Msg", "IBCSoftwareUpgrade", data);
      return promise.then(function (data) {
        return _tx.MsgIBCSoftwareUpgradeResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "updateClientParams",
    value: function updateClientParams(request) {
      var data = _tx.MsgUpdateParams.encode(request).finish();
      var promise = this.rpc.request("ibc.core.client.v1.Msg", "UpdateClientParams", data);
      return promise.then(function (data) {
        return _tx.MsgUpdateParamsResponse.decode(new _m0.Reader(data));
      });
    }
  }]);
}();