"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 project 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.createEntity = this.createEntity.bind(this);
    this.updateEntity = this.updateEntity.bind(this);
    this.updateEntityVerified = this.updateEntityVerified.bind(this);
    this.transferEntity = this.transferEntity.bind(this);
    this.createEntityAccount = this.createEntityAccount.bind(this);
    this.grantEntityAccountAuthz = this.grantEntityAccountAuthz.bind(this);
    this.revokeEntityAccountAuthz = this.revokeEntityAccountAuthz.bind(this);
  }
  return (0, _createClass2["default"])(MsgClientImpl, [{
    key: "createEntity",
    value: function createEntity(request) {
      var data = _tx.MsgCreateEntity.encode(request).finish();
      var promise = this.rpc.request("ixo.entity.v1beta1.Msg", "CreateEntity", data);
      return promise.then(function (data) {
        return _tx.MsgCreateEntityResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "updateEntity",
    value: function updateEntity(request) {
      var data = _tx.MsgUpdateEntity.encode(request).finish();
      var promise = this.rpc.request("ixo.entity.v1beta1.Msg", "UpdateEntity", data);
      return promise.then(function (data) {
        return _tx.MsgUpdateEntityResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "updateEntityVerified",
    value: function updateEntityVerified(request) {
      var data = _tx.MsgUpdateEntityVerified.encode(request).finish();
      var promise = this.rpc.request("ixo.entity.v1beta1.Msg", "UpdateEntityVerified", data);
      return promise.then(function (data) {
        return _tx.MsgUpdateEntityVerifiedResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "transferEntity",
    value: function transferEntity(request) {
      var data = _tx.MsgTransferEntity.encode(request).finish();
      var promise = this.rpc.request("ixo.entity.v1beta1.Msg", "TransferEntity", data);
      return promise.then(function (data) {
        return _tx.MsgTransferEntityResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "createEntityAccount",
    value: function createEntityAccount(request) {
      var data = _tx.MsgCreateEntityAccount.encode(request).finish();
      var promise = this.rpc.request("ixo.entity.v1beta1.Msg", "CreateEntityAccount", data);
      return promise.then(function (data) {
        return _tx.MsgCreateEntityAccountResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "grantEntityAccountAuthz",
    value: function grantEntityAccountAuthz(request) {
      var data = _tx.MsgGrantEntityAccountAuthz.encode(request).finish();
      var promise = this.rpc.request("ixo.entity.v1beta1.Msg", "GrantEntityAccountAuthz", data);
      return promise.then(function (data) {
        return _tx.MsgGrantEntityAccountAuthzResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "revokeEntityAccountAuthz",
    value: function revokeEntityAccountAuthz(request) {
      var data = _tx.MsgRevokeEntityAccountAuthz.encode(request).finish();
      var promise = this.rpc.request("ixo.entity.v1beta1.Msg", "RevokeEntityAccountAuthz", data);
      return promise.then(function (data) {
        return _tx.MsgRevokeEntityAccountAuthzResponse.decode(new _m0.Reader(data));
      });
    }
  }]);
}();