"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/08-wasm 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.storeCode = this.storeCode.bind(this);
    this.removeChecksum = this.removeChecksum.bind(this);
    this.migrateContract = this.migrateContract.bind(this);
  }
  return (0, _createClass2["default"])(MsgClientImpl, [{
    key: "storeCode",
    value: function storeCode(request) {
      var data = _tx.MsgStoreCode.encode(request).finish();
      var promise = this.rpc.request("ibc.lightclients.wasm.v1.Msg", "StoreCode", data);
      return promise.then(function (data) {
        return _tx.MsgStoreCodeResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "removeChecksum",
    value: function removeChecksum(request) {
      var data = _tx.MsgRemoveChecksum.encode(request).finish();
      var promise = this.rpc.request("ibc.lightclients.wasm.v1.Msg", "RemoveChecksum", data);
      return promise.then(function (data) {
        return _tx.MsgRemoveChecksumResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "migrateContract",
    value: function migrateContract(request) {
      var data = _tx.MsgMigrateContract.encode(request).finish();
      var promise = this.rpc.request("ibc.lightclients.wasm.v1.Msg", "MigrateContract", data);
      return promise.then(function (data) {
        return _tx.MsgMigrateContractResponse.decode(new _m0.Reader(data));
      });
    }
  }]);
}();