"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 distribution 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.setWithdrawAddress = this.setWithdrawAddress.bind(this);
    this.withdrawDelegatorReward = this.withdrawDelegatorReward.bind(this);
    this.withdrawValidatorCommission = this.withdrawValidatorCommission.bind(this);
    this.fundCommunityPool = this.fundCommunityPool.bind(this);
    this.updateParams = this.updateParams.bind(this);
    this.communityPoolSpend = this.communityPoolSpend.bind(this);
    this.depositValidatorRewardsPool = this.depositValidatorRewardsPool.bind(this);
  }
  return (0, _createClass2["default"])(MsgClientImpl, [{
    key: "setWithdrawAddress",
    value: function setWithdrawAddress(request) {
      var data = _tx.MsgSetWithdrawAddress.encode(request).finish();
      var promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "SetWithdrawAddress", data);
      return promise.then(function (data) {
        return _tx.MsgSetWithdrawAddressResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "withdrawDelegatorReward",
    value: function withdrawDelegatorReward(request) {
      var data = _tx.MsgWithdrawDelegatorReward.encode(request).finish();
      var promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "WithdrawDelegatorReward", data);
      return promise.then(function (data) {
        return _tx.MsgWithdrawDelegatorRewardResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "withdrawValidatorCommission",
    value: function withdrawValidatorCommission(request) {
      var data = _tx.MsgWithdrawValidatorCommission.encode(request).finish();
      var promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "WithdrawValidatorCommission", data);
      return promise.then(function (data) {
        return _tx.MsgWithdrawValidatorCommissionResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "fundCommunityPool",
    value: function fundCommunityPool(request) {
      var data = _tx.MsgFundCommunityPool.encode(request).finish();
      var promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "FundCommunityPool", data);
      return promise.then(function (data) {
        return _tx.MsgFundCommunityPoolResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "updateParams",
    value: function updateParams(request) {
      var data = _tx.MsgUpdateParams.encode(request).finish();
      var promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "UpdateParams", data);
      return promise.then(function (data) {
        return _tx.MsgUpdateParamsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "communityPoolSpend",
    value: function communityPoolSpend(request) {
      var data = _tx.MsgCommunityPoolSpend.encode(request).finish();
      var promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "CommunityPoolSpend", data);
      return promise.then(function (data) {
        return _tx.MsgCommunityPoolSpendResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "depositValidatorRewardsPool",
    value: function depositValidatorRewardsPool(request) {
      var data = _tx.MsgDepositValidatorRewardsPool.encode(request).finish();
      var promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "DepositValidatorRewardsPool", data);
      return promise.then(function (data) {
        return _tx.MsgDepositValidatorRewardsPoolResponse.decode(new _m0.Reader(data));
      });
    }
  }]);
}();