"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 _msgs = require("./msgs");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var MsgClientImpl = /*#__PURE__*/function () {
  function MsgClientImpl(rpc) {
    (0, _classCallCheck2["default"])(this, MsgClientImpl);
    (0, _defineProperty2["default"])(this, "rpc", void 0);
    this.rpc = rpc;
    this.valsetConfirm = this.valsetConfirm.bind(this);
    this.sendToEth = this.sendToEth.bind(this);
    this.requestBatch = this.requestBatch.bind(this);
    this.confirmBatch = this.confirmBatch.bind(this);
    this.depositClaim = this.depositClaim.bind(this);
    this.withdrawClaim = this.withdrawClaim.bind(this);
    this.valsetUpdateClaim = this.valsetUpdateClaim.bind(this);
    this.eRC20DeployedClaim = this.eRC20DeployedClaim.bind(this);
    this.setOrchestratorAddresses = this.setOrchestratorAddresses.bind(this);
    this.cancelSendToEth = this.cancelSendToEth.bind(this);
    this.submitBadSignatureEvidence = this.submitBadSignatureEvidence.bind(this);
  }
  (0, _createClass2["default"])(MsgClientImpl, [{
    key: "valsetConfirm",
    value: function valsetConfirm(request) {
      var data = _msgs.MsgValsetConfirm.encode(request).finish();
      var promise = this.rpc.request("injective.peggy.v1.Msg", "ValsetConfirm", data);
      return promise.then(function (data) {
        return _msgs.MsgValsetConfirmResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "sendToEth",
    value: function sendToEth(request) {
      var data = _msgs.MsgSendToEth.encode(request).finish();
      var promise = this.rpc.request("injective.peggy.v1.Msg", "SendToEth", data);
      return promise.then(function (data) {
        return _msgs.MsgSendToEthResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "requestBatch",
    value: function requestBatch(request) {
      var data = _msgs.MsgRequestBatch.encode(request).finish();
      var promise = this.rpc.request("injective.peggy.v1.Msg", "RequestBatch", data);
      return promise.then(function (data) {
        return _msgs.MsgRequestBatchResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "confirmBatch",
    value: function confirmBatch(request) {
      var data = _msgs.MsgConfirmBatch.encode(request).finish();
      var promise = this.rpc.request("injective.peggy.v1.Msg", "ConfirmBatch", data);
      return promise.then(function (data) {
        return _msgs.MsgConfirmBatchResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "depositClaim",
    value: function depositClaim(request) {
      var data = _msgs.MsgDepositClaim.encode(request).finish();
      var promise = this.rpc.request("injective.peggy.v1.Msg", "DepositClaim", data);
      return promise.then(function (data) {
        return _msgs.MsgDepositClaimResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "withdrawClaim",
    value: function withdrawClaim(request) {
      var data = _msgs.MsgWithdrawClaim.encode(request).finish();
      var promise = this.rpc.request("injective.peggy.v1.Msg", "WithdrawClaim", data);
      return promise.then(function (data) {
        return _msgs.MsgWithdrawClaimResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "valsetUpdateClaim",
    value: function valsetUpdateClaim(request) {
      var data = _msgs.MsgValsetUpdatedClaim.encode(request).finish();
      var promise = this.rpc.request("injective.peggy.v1.Msg", "ValsetUpdateClaim", data);
      return promise.then(function (data) {
        return _msgs.MsgValsetUpdatedClaimResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "eRC20DeployedClaim",
    value: function eRC20DeployedClaim(request) {
      var data = _msgs.MsgERC20DeployedClaim.encode(request).finish();
      var promise = this.rpc.request("injective.peggy.v1.Msg", "ERC20DeployedClaim", data);
      return promise.then(function (data) {
        return _msgs.MsgERC20DeployedClaimResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "setOrchestratorAddresses",
    value: function setOrchestratorAddresses(request) {
      var data = _msgs.MsgSetOrchestratorAddresses.encode(request).finish();
      var promise = this.rpc.request("injective.peggy.v1.Msg", "SetOrchestratorAddresses", data);
      return promise.then(function (data) {
        return _msgs.MsgSetOrchestratorAddressesResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "cancelSendToEth",
    value: function cancelSendToEth(request) {
      var data = _msgs.MsgCancelSendToEth.encode(request).finish();
      var promise = this.rpc.request("injective.peggy.v1.Msg", "CancelSendToEth", data);
      return promise.then(function (data) {
        return _msgs.MsgCancelSendToEthResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "submitBadSignatureEvidence",
    value: function submitBadSignatureEvidence(request) {
      var data = _msgs.MsgSubmitBadSignatureEvidence.encode(request).finish();
      var promise = this.rpc.request("injective.peggy.v1.Msg", "SubmitBadSignatureEvidence", data);
      return promise.then(function (data) {
        return _msgs.MsgSubmitBadSignatureEvidenceResponse.decode(new _m0.Reader(data));
      });
    }
  }]);
  return MsgClientImpl;
}();
exports.MsgClientImpl = MsgClientImpl;