"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/channel 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.channelOpenInit = this.channelOpenInit.bind(this);
    this.channelOpenTry = this.channelOpenTry.bind(this);
    this.channelOpenAck = this.channelOpenAck.bind(this);
    this.channelOpenConfirm = this.channelOpenConfirm.bind(this);
    this.channelCloseInit = this.channelCloseInit.bind(this);
    this.channelCloseConfirm = this.channelCloseConfirm.bind(this);
    this.recvPacket = this.recvPacket.bind(this);
    this.timeout = this.timeout.bind(this);
    this.timeoutOnClose = this.timeoutOnClose.bind(this);
    this.acknowledgement = this.acknowledgement.bind(this);
    this.channelUpgradeInit = this.channelUpgradeInit.bind(this);
    this.channelUpgradeTry = this.channelUpgradeTry.bind(this);
    this.channelUpgradeAck = this.channelUpgradeAck.bind(this);
    this.channelUpgradeConfirm = this.channelUpgradeConfirm.bind(this);
    this.channelUpgradeOpen = this.channelUpgradeOpen.bind(this);
    this.channelUpgradeTimeout = this.channelUpgradeTimeout.bind(this);
    this.channelUpgradeCancel = this.channelUpgradeCancel.bind(this);
    this.updateChannelParams = this.updateChannelParams.bind(this);
    this.pruneAcknowledgements = this.pruneAcknowledgements.bind(this);
  }
  return (0, _createClass2["default"])(MsgClientImpl, [{
    key: "channelOpenInit",
    value: function channelOpenInit(request) {
      var data = _tx.MsgChannelOpenInit.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenInit", data);
      return promise.then(function (data) {
        return _tx.MsgChannelOpenInitResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "channelOpenTry",
    value: function channelOpenTry(request) {
      var data = _tx.MsgChannelOpenTry.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenTry", data);
      return promise.then(function (data) {
        return _tx.MsgChannelOpenTryResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "channelOpenAck",
    value: function channelOpenAck(request) {
      var data = _tx.MsgChannelOpenAck.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenAck", data);
      return promise.then(function (data) {
        return _tx.MsgChannelOpenAckResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "channelOpenConfirm",
    value: function channelOpenConfirm(request) {
      var data = _tx.MsgChannelOpenConfirm.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenConfirm", data);
      return promise.then(function (data) {
        return _tx.MsgChannelOpenConfirmResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "channelCloseInit",
    value: function channelCloseInit(request) {
      var data = _tx.MsgChannelCloseInit.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelCloseInit", data);
      return promise.then(function (data) {
        return _tx.MsgChannelCloseInitResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "channelCloseConfirm",
    value: function channelCloseConfirm(request) {
      var data = _tx.MsgChannelCloseConfirm.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelCloseConfirm", data);
      return promise.then(function (data) {
        return _tx.MsgChannelCloseConfirmResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "recvPacket",
    value: function recvPacket(request) {
      var data = _tx.MsgRecvPacket.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "RecvPacket", data);
      return promise.then(function (data) {
        return _tx.MsgRecvPacketResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "timeout",
    value: function timeout(request) {
      var data = _tx.MsgTimeout.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "Timeout", data);
      return promise.then(function (data) {
        return _tx.MsgTimeoutResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "timeoutOnClose",
    value: function timeoutOnClose(request) {
      var data = _tx.MsgTimeoutOnClose.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "TimeoutOnClose", data);
      return promise.then(function (data) {
        return _tx.MsgTimeoutOnCloseResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "acknowledgement",
    value: function acknowledgement(request) {
      var data = _tx.MsgAcknowledgement.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "Acknowledgement", data);
      return promise.then(function (data) {
        return _tx.MsgAcknowledgementResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "channelUpgradeInit",
    value: function channelUpgradeInit(request) {
      var data = _tx.MsgChannelUpgradeInit.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeInit", data);
      return promise.then(function (data) {
        return _tx.MsgChannelUpgradeInitResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "channelUpgradeTry",
    value: function channelUpgradeTry(request) {
      var data = _tx.MsgChannelUpgradeTry.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeTry", data);
      return promise.then(function (data) {
        return _tx.MsgChannelUpgradeTryResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "channelUpgradeAck",
    value: function channelUpgradeAck(request) {
      var data = _tx.MsgChannelUpgradeAck.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeAck", data);
      return promise.then(function (data) {
        return _tx.MsgChannelUpgradeAckResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "channelUpgradeConfirm",
    value: function channelUpgradeConfirm(request) {
      var data = _tx.MsgChannelUpgradeConfirm.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeConfirm", data);
      return promise.then(function (data) {
        return _tx.MsgChannelUpgradeConfirmResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "channelUpgradeOpen",
    value: function channelUpgradeOpen(request) {
      var data = _tx.MsgChannelUpgradeOpen.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeOpen", data);
      return promise.then(function (data) {
        return _tx.MsgChannelUpgradeOpenResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "channelUpgradeTimeout",
    value: function channelUpgradeTimeout(request) {
      var data = _tx.MsgChannelUpgradeTimeout.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeTimeout", data);
      return promise.then(function (data) {
        return _tx.MsgChannelUpgradeTimeoutResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "channelUpgradeCancel",
    value: function channelUpgradeCancel(request) {
      var data = _tx.MsgChannelUpgradeCancel.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeCancel", data);
      return promise.then(function (data) {
        return _tx.MsgChannelUpgradeCancelResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "updateChannelParams",
    value: function updateChannelParams(request) {
      var data = _tx.MsgUpdateParams.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "UpdateChannelParams", data);
      return promise.then(function (data) {
        return _tx.MsgUpdateParamsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "pruneAcknowledgements",
    value: function pruneAcknowledgements(request) {
      var data = _tx.MsgPruneAcknowledgements.encode(request).finish();
      var promise = this.rpc.request("ibc.core.channel.v1.Msg", "PruneAcknowledgements", data);
      return promise.then(function (data) {
        return _tx.MsgPruneAcknowledgementsResponse.decode(new _m0.Reader(data));
      });
    }
  }]);
}();