"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.createToken = this.createToken.bind(this);
    this.mintToken = this.mintToken.bind(this);
    this.transferToken = this.transferToken.bind(this);
    this.retireToken = this.retireToken.bind(this);
    this.transferCredit = this.transferCredit.bind(this);
    this.cancelToken = this.cancelToken.bind(this);
    this.pauseToken = this.pauseToken.bind(this);
    this.stopToken = this.stopToken.bind(this);
  }
  return (0, _createClass2["default"])(MsgClientImpl, [{
    key: "createToken",
    value: function createToken(request) {
      var data = _tx.MsgCreateToken.encode(request).finish();
      var promise = this.rpc.request("ixo.token.v1beta1.Msg", "CreateToken", data);
      return promise.then(function (data) {
        return _tx.MsgCreateTokenResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "mintToken",
    value: function mintToken(request) {
      var data = _tx.MsgMintToken.encode(request).finish();
      var promise = this.rpc.request("ixo.token.v1beta1.Msg", "MintToken", data);
      return promise.then(function (data) {
        return _tx.MsgMintTokenResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "transferToken",
    value: function transferToken(request) {
      var data = _tx.MsgTransferToken.encode(request).finish();
      var promise = this.rpc.request("ixo.token.v1beta1.Msg", "TransferToken", data);
      return promise.then(function (data) {
        return _tx.MsgTransferTokenResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "retireToken",
    value: function retireToken(request) {
      var data = _tx.MsgRetireToken.encode(request).finish();
      var promise = this.rpc.request("ixo.token.v1beta1.Msg", "RetireToken", data);
      return promise.then(function (data) {
        return _tx.MsgRetireTokenResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "transferCredit",
    value: function transferCredit(request) {
      var data = _tx.MsgTransferCredit.encode(request).finish();
      var promise = this.rpc.request("ixo.token.v1beta1.Msg", "TransferCredit", data);
      return promise.then(function (data) {
        return _tx.MsgTransferCreditResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "cancelToken",
    value: function cancelToken(request) {
      var data = _tx.MsgCancelToken.encode(request).finish();
      var promise = this.rpc.request("ixo.token.v1beta1.Msg", "CancelToken", data);
      return promise.then(function (data) {
        return _tx.MsgCancelTokenResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "pauseToken",
    value: function pauseToken(request) {
      var data = _tx.MsgPauseToken.encode(request).finish();
      var promise = this.rpc.request("ixo.token.v1beta1.Msg", "PauseToken", data);
      return promise.then(function (data) {
        return _tx.MsgPauseTokenResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "stopToken",
    value: function stopToken(request) {
      var data = _tx.MsgStopToken.encode(request).finish();
      var promise = this.rpc.request("ixo.token.v1beta1.Msg", "StopToken", data);
      return promise.then(function (data) {
        return _tx.MsgStopTokenResponse.decode(new _m0.Reader(data));
      });
    }
  }]);
}();