"use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.EventWithdrawClaim = exports.EventValsetUpdateRequest = exports.EventValsetUpdateClaim = exports.EventValsetConfirm = exports.EventSubmitBadSignatureEvidence = exports.EventSetOrchestratorAddresses = exports.EventSendToEth = exports.EventOutgoingBatchCanceled = exports.EventOutgoingBatch = exports.EventERC20DeployedClaim = exports.EventDepositClaim = exports.EventConfirmBatch = exports.EventCancelSendToEth = exports.EventBridgeWithdrawCanceled = exports.EventAttestationVote = exports.EventAttestationObserved = void 0;
var _types = require("./types");
var _helpers = require("../../../helpers");
var _m0 = _interopRequireWildcard(require("protobufjs/minimal"));
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; }
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function createBaseEventAttestationObserved() {
  return {
    attestationType: 0,
    bridgeContract: "",
    bridgeChainId: _helpers.Long.UZERO,
    attestationId: new Uint8Array(),
    nonce: _helpers.Long.UZERO
  };
}
var EventAttestationObserved = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.attestationType !== 0) {
      writer.uint32(8).int32(message.attestationType);
    }
    if (message.bridgeContract !== "") {
      writer.uint32(18).string(message.bridgeContract);
    }
    if (!message.bridgeChainId.isZero()) {
      writer.uint32(24).uint64(message.bridgeChainId);
    }
    if (message.attestationId.length !== 0) {
      writer.uint32(34).bytes(message.attestationId);
    }
    if (!message.nonce.isZero()) {
      writer.uint32(40).uint64(message.nonce);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseEventAttestationObserved();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.attestationType = reader.int32();
          break;
        case 2:
          message.bridgeContract = reader.string();
          break;
        case 3:
          message.bridgeChainId = reader.uint64();
          break;
        case 4:
          message.attestationId = reader.bytes();
          break;
        case 5:
          message.nonce = reader.uint64();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$attestationTy, _object$bridgeContrac, _object$attestationId;
    var message = createBaseEventAttestationObserved();
    message.attestationType = (_object$attestationTy = object.attestationType) !== null && _object$attestationTy !== void 0 ? _object$attestationTy : 0;
    message.bridgeContract = (_object$bridgeContrac = object.bridgeContract) !== null && _object$bridgeContrac !== void 0 ? _object$bridgeContrac : "";
    message.bridgeChainId = object.bridgeChainId !== undefined && object.bridgeChainId !== null ? _helpers.Long.fromValue(object.bridgeChainId) : _helpers.Long.UZERO;
    message.attestationId = (_object$attestationId = object.attestationId) !== null && _object$attestationId !== void 0 ? _object$attestationId : new Uint8Array();
    message.nonce = object.nonce !== undefined && object.nonce !== null ? _helpers.Long.fromValue(object.nonce) : _helpers.Long.UZERO;
    return message;
  }
};
exports.EventAttestationObserved = EventAttestationObserved;
function createBaseEventBridgeWithdrawCanceled() {
  return {
    bridgeContract: "",
    bridgeChainId: _helpers.Long.UZERO
  };
}
var EventBridgeWithdrawCanceled = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.bridgeContract !== "") {
      writer.uint32(10).string(message.bridgeContract);
    }
    if (!message.bridgeChainId.isZero()) {
      writer.uint32(16).uint64(message.bridgeChainId);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseEventBridgeWithdrawCanceled();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.bridgeContract = reader.string();
          break;
        case 2:
          message.bridgeChainId = reader.uint64();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$bridgeContrac2;
    var message = createBaseEventBridgeWithdrawCanceled();
    message.bridgeContract = (_object$bridgeContrac2 = object.bridgeContract) !== null && _object$bridgeContrac2 !== void 0 ? _object$bridgeContrac2 : "";
    message.bridgeChainId = object.bridgeChainId !== undefined && object.bridgeChainId !== null ? _helpers.Long.fromValue(object.bridgeChainId) : _helpers.Long.UZERO;
    return message;
  }
};
exports.EventBridgeWithdrawCanceled = EventBridgeWithdrawCanceled;
function createBaseEventOutgoingBatch() {
  return {
    denom: "",
    orchestratorAddress: "",
    batchNonce: _helpers.Long.UZERO,
    batchTimeout: _helpers.Long.UZERO,
    batchTxIds: []
  };
}
var EventOutgoingBatch = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.denom !== "") {
      writer.uint32(10).string(message.denom);
    }
    if (message.orchestratorAddress !== "") {
      writer.uint32(18).string(message.orchestratorAddress);
    }
    if (!message.batchNonce.isZero()) {
      writer.uint32(24).uint64(message.batchNonce);
    }
    if (!message.batchTimeout.isZero()) {
      writer.uint32(32).uint64(message.batchTimeout);
    }
    writer.uint32(42).fork();
    var _iterator = _createForOfIteratorHelper(message.batchTxIds),
      _step;
    try {
      for (_iterator.s(); !(_step = _iterator.n()).done;) {
        var v = _step.value;
        writer.uint64(v);
      }
    } catch (err) {
      _iterator.e(err);
    } finally {
      _iterator.f();
    }
    writer.ldelim();
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseEventOutgoingBatch();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.denom = reader.string();
          break;
        case 2:
          message.orchestratorAddress = reader.string();
          break;
        case 3:
          message.batchNonce = reader.uint64();
          break;
        case 4:
          message.batchTimeout = reader.uint64();
          break;
        case 5:
          if ((tag & 7) === 2) {
            var end2 = reader.uint32() + reader.pos;
            while (reader.pos < end2) {
              message.batchTxIds.push(reader.uint64());
            }
          } else {
            message.batchTxIds.push(reader.uint64());
          }
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$denom, _object$orchestratorA, _object$batchTxIds;
    var message = createBaseEventOutgoingBatch();
    message.denom = (_object$denom = object.denom) !== null && _object$denom !== void 0 ? _object$denom : "";
    message.orchestratorAddress = (_object$orchestratorA = object.orchestratorAddress) !== null && _object$orchestratorA !== void 0 ? _object$orchestratorA : "";
    message.batchNonce = object.batchNonce !== undefined && object.batchNonce !== null ? _helpers.Long.fromValue(object.batchNonce) : _helpers.Long.UZERO;
    message.batchTimeout = object.batchTimeout !== undefined && object.batchTimeout !== null ? _helpers.Long.fromValue(object.batchTimeout) : _helpers.Long.UZERO;
    message.batchTxIds = ((_object$batchTxIds = object.batchTxIds) === null || _object$batchTxIds === void 0 ? void 0 : _object$batchTxIds.map(function (e) {
      return _helpers.Long.fromValue(e);
    })) || [];
    return message;
  }
};
exports.EventOutgoingBatch = EventOutgoingBatch;
function createBaseEventOutgoingBatchCanceled() {
  return {
    bridgeContract: "",
    bridgeChainId: _helpers.Long.UZERO,
    batchId: _helpers.Long.UZERO,
    nonce: _helpers.Long.UZERO
  };
}
var EventOutgoingBatchCanceled = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.bridgeContract !== "") {
      writer.uint32(10).string(message.bridgeContract);
    }
    if (!message.bridgeChainId.isZero()) {
      writer.uint32(16).uint64(message.bridgeChainId);
    }
    if (!message.batchId.isZero()) {
      writer.uint32(24).uint64(message.batchId);
    }
    if (!message.nonce.isZero()) {
      writer.uint32(32).uint64(message.nonce);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseEventOutgoingBatchCanceled();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.bridgeContract = reader.string();
          break;
        case 2:
          message.bridgeChainId = reader.uint64();
          break;
        case 3:
          message.batchId = reader.uint64();
          break;
        case 4:
          message.nonce = reader.uint64();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$bridgeContrac3;
    var message = createBaseEventOutgoingBatchCanceled();
    message.bridgeContract = (_object$bridgeContrac3 = object.bridgeContract) !== null && _object$bridgeContrac3 !== void 0 ? _object$bridgeContrac3 : "";
    message.bridgeChainId = object.bridgeChainId !== undefined && object.bridgeChainId !== null ? _helpers.Long.fromValue(object.bridgeChainId) : _helpers.Long.UZERO;
    message.batchId = object.batchId !== undefined && object.batchId !== null ? _helpers.Long.fromValue(object.batchId) : _helpers.Long.UZERO;
    message.nonce = object.nonce !== undefined && object.nonce !== null ? _helpers.Long.fromValue(object.nonce) : _helpers.Long.UZERO;
    return message;
  }
};
exports.EventOutgoingBatchCanceled = EventOutgoingBatchCanceled;
function createBaseEventValsetUpdateRequest() {
  return {
    valsetNonce: _helpers.Long.UZERO,
    valsetHeight: _helpers.Long.UZERO,
    valsetMembers: [],
    rewardAmount: "",
    rewardToken: ""
  };
}
var EventValsetUpdateRequest = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (!message.valsetNonce.isZero()) {
      writer.uint32(8).uint64(message.valsetNonce);
    }
    if (!message.valsetHeight.isZero()) {
      writer.uint32(16).uint64(message.valsetHeight);
    }
    var _iterator2 = _createForOfIteratorHelper(message.valsetMembers),
      _step2;
    try {
      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
        var v = _step2.value;
        _types.BridgeValidator.encode(v, writer.uint32(26).fork()).ldelim();
      }
    } catch (err) {
      _iterator2.e(err);
    } finally {
      _iterator2.f();
    }
    if (message.rewardAmount !== "") {
      writer.uint32(34).string(message.rewardAmount);
    }
    if (message.rewardToken !== "") {
      writer.uint32(42).string(message.rewardToken);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseEventValsetUpdateRequest();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.valsetNonce = reader.uint64();
          break;
        case 2:
          message.valsetHeight = reader.uint64();
          break;
        case 3:
          message.valsetMembers.push(_types.BridgeValidator.decode(reader, reader.uint32()));
          break;
        case 4:
          message.rewardAmount = reader.string();
          break;
        case 5:
          message.rewardToken = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$valsetMembers, _object$rewardAmount, _object$rewardToken;
    var message = createBaseEventValsetUpdateRequest();
    message.valsetNonce = object.valsetNonce !== undefined && object.valsetNonce !== null ? _helpers.Long.fromValue(object.valsetNonce) : _helpers.Long.UZERO;
    message.valsetHeight = object.valsetHeight !== undefined && object.valsetHeight !== null ? _helpers.Long.fromValue(object.valsetHeight) : _helpers.Long.UZERO;
    message.valsetMembers = ((_object$valsetMembers = object.valsetMembers) === null || _object$valsetMembers === void 0 ? void 0 : _object$valsetMembers.map(function (e) {
      return _types.BridgeValidator.fromPartial(e);
    })) || [];
    message.rewardAmount = (_object$rewardAmount = object.rewardAmount) !== null && _object$rewardAmount !== void 0 ? _object$rewardAmount : "";
    message.rewardToken = (_object$rewardToken = object.rewardToken) !== null && _object$rewardToken !== void 0 ? _object$rewardToken : "";
    return message;
  }
};
exports.EventValsetUpdateRequest = EventValsetUpdateRequest;
function createBaseEventSetOrchestratorAddresses() {
  return {
    validatorAddress: "",
    orchestratorAddress: "",
    operatorEthAddress: ""
  };
}
var EventSetOrchestratorAddresses = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.validatorAddress !== "") {
      writer.uint32(10).string(message.validatorAddress);
    }
    if (message.orchestratorAddress !== "") {
      writer.uint32(18).string(message.orchestratorAddress);
    }
    if (message.operatorEthAddress !== "") {
      writer.uint32(26).string(message.operatorEthAddress);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseEventSetOrchestratorAddresses();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.validatorAddress = reader.string();
          break;
        case 2:
          message.orchestratorAddress = reader.string();
          break;
        case 3:
          message.operatorEthAddress = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$validatorAddr, _object$orchestratorA2, _object$operatorEthAd;
    var message = createBaseEventSetOrchestratorAddresses();
    message.validatorAddress = (_object$validatorAddr = object.validatorAddress) !== null && _object$validatorAddr !== void 0 ? _object$validatorAddr : "";
    message.orchestratorAddress = (_object$orchestratorA2 = object.orchestratorAddress) !== null && _object$orchestratorA2 !== void 0 ? _object$orchestratorA2 : "";
    message.operatorEthAddress = (_object$operatorEthAd = object.operatorEthAddress) !== null && _object$operatorEthAd !== void 0 ? _object$operatorEthAd : "";
    return message;
  }
};
exports.EventSetOrchestratorAddresses = EventSetOrchestratorAddresses;
function createBaseEventValsetConfirm() {
  return {
    valsetNonce: _helpers.Long.UZERO,
    orchestratorAddress: ""
  };
}
var EventValsetConfirm = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (!message.valsetNonce.isZero()) {
      writer.uint32(8).uint64(message.valsetNonce);
    }
    if (message.orchestratorAddress !== "") {
      writer.uint32(18).string(message.orchestratorAddress);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseEventValsetConfirm();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.valsetNonce = reader.uint64();
          break;
        case 2:
          message.orchestratorAddress = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$orchestratorA3;
    var message = createBaseEventValsetConfirm();
    message.valsetNonce = object.valsetNonce !== undefined && object.valsetNonce !== null ? _helpers.Long.fromValue(object.valsetNonce) : _helpers.Long.UZERO;
    message.orchestratorAddress = (_object$orchestratorA3 = object.orchestratorAddress) !== null && _object$orchestratorA3 !== void 0 ? _object$orchestratorA3 : "";
    return message;
  }
};
exports.EventValsetConfirm = EventValsetConfirm;
function createBaseEventSendToEth() {
  return {
    outgoingTxId: _helpers.Long.UZERO,
    sender: "",
    receiver: "",
    amount: "",
    bridgeFee: ""
  };
}
var EventSendToEth = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (!message.outgoingTxId.isZero()) {
      writer.uint32(8).uint64(message.outgoingTxId);
    }
    if (message.sender !== "") {
      writer.uint32(18).string(message.sender);
    }
    if (message.receiver !== "") {
      writer.uint32(26).string(message.receiver);
    }
    if (message.amount !== "") {
      writer.uint32(34).string(message.amount);
    }
    if (message.bridgeFee !== "") {
      writer.uint32(42).string(message.bridgeFee);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseEventSendToEth();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.outgoingTxId = reader.uint64();
          break;
        case 2:
          message.sender = reader.string();
          break;
        case 3:
          message.receiver = reader.string();
          break;
        case 4:
          message.amount = reader.string();
          break;
        case 5:
          message.bridgeFee = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$sender, _object$receiver, _object$amount, _object$bridgeFee;
    var message = createBaseEventSendToEth();
    message.outgoingTxId = object.outgoingTxId !== undefined && object.outgoingTxId !== null ? _helpers.Long.fromValue(object.outgoingTxId) : _helpers.Long.UZERO;
    message.sender = (_object$sender = object.sender) !== null && _object$sender !== void 0 ? _object$sender : "";
    message.receiver = (_object$receiver = object.receiver) !== null && _object$receiver !== void 0 ? _object$receiver : "";
    message.amount = (_object$amount = object.amount) !== null && _object$amount !== void 0 ? _object$amount : "";
    message.bridgeFee = (_object$bridgeFee = object.bridgeFee) !== null && _object$bridgeFee !== void 0 ? _object$bridgeFee : "";
    return message;
  }
};
exports.EventSendToEth = EventSendToEth;
function createBaseEventConfirmBatch() {
  return {
    batchNonce: _helpers.Long.UZERO,
    orchestratorAddress: ""
  };
}
var EventConfirmBatch = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (!message.batchNonce.isZero()) {
      writer.uint32(8).uint64(message.batchNonce);
    }
    if (message.orchestratorAddress !== "") {
      writer.uint32(18).string(message.orchestratorAddress);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseEventConfirmBatch();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.batchNonce = reader.uint64();
          break;
        case 2:
          message.orchestratorAddress = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$orchestratorA4;
    var message = createBaseEventConfirmBatch();
    message.batchNonce = object.batchNonce !== undefined && object.batchNonce !== null ? _helpers.Long.fromValue(object.batchNonce) : _helpers.Long.UZERO;
    message.orchestratorAddress = (_object$orchestratorA4 = object.orchestratorAddress) !== null && _object$orchestratorA4 !== void 0 ? _object$orchestratorA4 : "";
    return message;
  }
};
exports.EventConfirmBatch = EventConfirmBatch;
function createBaseEventAttestationVote() {
  return {
    eventNonce: _helpers.Long.UZERO,
    attestationId: new Uint8Array(),
    voter: ""
  };
}
var EventAttestationVote = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (!message.eventNonce.isZero()) {
      writer.uint32(8).uint64(message.eventNonce);
    }
    if (message.attestationId.length !== 0) {
      writer.uint32(18).bytes(message.attestationId);
    }
    if (message.voter !== "") {
      writer.uint32(26).string(message.voter);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseEventAttestationVote();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.eventNonce = reader.uint64();
          break;
        case 2:
          message.attestationId = reader.bytes();
          break;
        case 3:
          message.voter = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$attestationId2, _object$voter;
    var message = createBaseEventAttestationVote();
    message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? _helpers.Long.fromValue(object.eventNonce) : _helpers.Long.UZERO;
    message.attestationId = (_object$attestationId2 = object.attestationId) !== null && _object$attestationId2 !== void 0 ? _object$attestationId2 : new Uint8Array();
    message.voter = (_object$voter = object.voter) !== null && _object$voter !== void 0 ? _object$voter : "";
    return message;
  }
};
exports.EventAttestationVote = EventAttestationVote;
function createBaseEventDepositClaim() {
  return {
    eventNonce: _helpers.Long.UZERO,
    eventHeight: _helpers.Long.UZERO,
    attestationId: new Uint8Array(),
    ethereumSender: "",
    cosmosReceiver: "",
    tokenContract: "",
    amount: "",
    orchestratorAddress: "",
    data: ""
  };
}
var EventDepositClaim = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (!message.eventNonce.isZero()) {
      writer.uint32(8).uint64(message.eventNonce);
    }
    if (!message.eventHeight.isZero()) {
      writer.uint32(16).uint64(message.eventHeight);
    }
    if (message.attestationId.length !== 0) {
      writer.uint32(26).bytes(message.attestationId);
    }
    if (message.ethereumSender !== "") {
      writer.uint32(34).string(message.ethereumSender);
    }
    if (message.cosmosReceiver !== "") {
      writer.uint32(42).string(message.cosmosReceiver);
    }
    if (message.tokenContract !== "") {
      writer.uint32(50).string(message.tokenContract);
    }
    if (message.amount !== "") {
      writer.uint32(58).string(message.amount);
    }
    if (message.orchestratorAddress !== "") {
      writer.uint32(66).string(message.orchestratorAddress);
    }
    if (message.data !== "") {
      writer.uint32(74).string(message.data);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseEventDepositClaim();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.eventNonce = reader.uint64();
          break;
        case 2:
          message.eventHeight = reader.uint64();
          break;
        case 3:
          message.attestationId = reader.bytes();
          break;
        case 4:
          message.ethereumSender = reader.string();
          break;
        case 5:
          message.cosmosReceiver = reader.string();
          break;
        case 6:
          message.tokenContract = reader.string();
          break;
        case 7:
          message.amount = reader.string();
          break;
        case 8:
          message.orchestratorAddress = reader.string();
          break;
        case 9:
          message.data = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$attestationId3, _object$ethereumSende, _object$cosmosReceive, _object$tokenContract, _object$amount2, _object$orchestratorA5, _object$data;
    var message = createBaseEventDepositClaim();
    message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? _helpers.Long.fromValue(object.eventNonce) : _helpers.Long.UZERO;
    message.eventHeight = object.eventHeight !== undefined && object.eventHeight !== null ? _helpers.Long.fromValue(object.eventHeight) : _helpers.Long.UZERO;
    message.attestationId = (_object$attestationId3 = object.attestationId) !== null && _object$attestationId3 !== void 0 ? _object$attestationId3 : new Uint8Array();
    message.ethereumSender = (_object$ethereumSende = object.ethereumSender) !== null && _object$ethereumSende !== void 0 ? _object$ethereumSende : "";
    message.cosmosReceiver = (_object$cosmosReceive = object.cosmosReceiver) !== null && _object$cosmosReceive !== void 0 ? _object$cosmosReceive : "";
    message.tokenContract = (_object$tokenContract = object.tokenContract) !== null && _object$tokenContract !== void 0 ? _object$tokenContract : "";
    message.amount = (_object$amount2 = object.amount) !== null && _object$amount2 !== void 0 ? _object$amount2 : "";
    message.orchestratorAddress = (_object$orchestratorA5 = object.orchestratorAddress) !== null && _object$orchestratorA5 !== void 0 ? _object$orchestratorA5 : "";
    message.data = (_object$data = object.data) !== null && _object$data !== void 0 ? _object$data : "";
    return message;
  }
};
exports.EventDepositClaim = EventDepositClaim;
function createBaseEventWithdrawClaim() {
  return {
    eventNonce: _helpers.Long.UZERO,
    eventHeight: _helpers.Long.UZERO,
    attestationId: new Uint8Array(),
    batchNonce: _helpers.Long.UZERO,
    tokenContract: "",
    orchestratorAddress: ""
  };
}
var EventWithdrawClaim = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (!message.eventNonce.isZero()) {
      writer.uint32(8).uint64(message.eventNonce);
    }
    if (!message.eventHeight.isZero()) {
      writer.uint32(16).uint64(message.eventHeight);
    }
    if (message.attestationId.length !== 0) {
      writer.uint32(26).bytes(message.attestationId);
    }
    if (!message.batchNonce.isZero()) {
      writer.uint32(32).uint64(message.batchNonce);
    }
    if (message.tokenContract !== "") {
      writer.uint32(42).string(message.tokenContract);
    }
    if (message.orchestratorAddress !== "") {
      writer.uint32(50).string(message.orchestratorAddress);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseEventWithdrawClaim();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.eventNonce = reader.uint64();
          break;
        case 2:
          message.eventHeight = reader.uint64();
          break;
        case 3:
          message.attestationId = reader.bytes();
          break;
        case 4:
          message.batchNonce = reader.uint64();
          break;
        case 5:
          message.tokenContract = reader.string();
          break;
        case 6:
          message.orchestratorAddress = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$attestationId4, _object$tokenContract2, _object$orchestratorA6;
    var message = createBaseEventWithdrawClaim();
    message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? _helpers.Long.fromValue(object.eventNonce) : _helpers.Long.UZERO;
    message.eventHeight = object.eventHeight !== undefined && object.eventHeight !== null ? _helpers.Long.fromValue(object.eventHeight) : _helpers.Long.UZERO;
    message.attestationId = (_object$attestationId4 = object.attestationId) !== null && _object$attestationId4 !== void 0 ? _object$attestationId4 : new Uint8Array();
    message.batchNonce = object.batchNonce !== undefined && object.batchNonce !== null ? _helpers.Long.fromValue(object.batchNonce) : _helpers.Long.UZERO;
    message.tokenContract = (_object$tokenContract2 = object.tokenContract) !== null && _object$tokenContract2 !== void 0 ? _object$tokenContract2 : "";
    message.orchestratorAddress = (_object$orchestratorA6 = object.orchestratorAddress) !== null && _object$orchestratorA6 !== void 0 ? _object$orchestratorA6 : "";
    return message;
  }
};
exports.EventWithdrawClaim = EventWithdrawClaim;
function createBaseEventERC20DeployedClaim() {
  return {
    eventNonce: _helpers.Long.UZERO,
    eventHeight: _helpers.Long.UZERO,
    attestationId: new Uint8Array(),
    cosmosDenom: "",
    tokenContract: "",
    name: "",
    symbol: "",
    decimals: _helpers.Long.UZERO,
    orchestratorAddress: ""
  };
}
var EventERC20DeployedClaim = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (!message.eventNonce.isZero()) {
      writer.uint32(8).uint64(message.eventNonce);
    }
    if (!message.eventHeight.isZero()) {
      writer.uint32(16).uint64(message.eventHeight);
    }
    if (message.attestationId.length !== 0) {
      writer.uint32(26).bytes(message.attestationId);
    }
    if (message.cosmosDenom !== "") {
      writer.uint32(34).string(message.cosmosDenom);
    }
    if (message.tokenContract !== "") {
      writer.uint32(42).string(message.tokenContract);
    }
    if (message.name !== "") {
      writer.uint32(50).string(message.name);
    }
    if (message.symbol !== "") {
      writer.uint32(58).string(message.symbol);
    }
    if (!message.decimals.isZero()) {
      writer.uint32(64).uint64(message.decimals);
    }
    if (message.orchestratorAddress !== "") {
      writer.uint32(74).string(message.orchestratorAddress);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseEventERC20DeployedClaim();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.eventNonce = reader.uint64();
          break;
        case 2:
          message.eventHeight = reader.uint64();
          break;
        case 3:
          message.attestationId = reader.bytes();
          break;
        case 4:
          message.cosmosDenom = reader.string();
          break;
        case 5:
          message.tokenContract = reader.string();
          break;
        case 6:
          message.name = reader.string();
          break;
        case 7:
          message.symbol = reader.string();
          break;
        case 8:
          message.decimals = reader.uint64();
          break;
        case 9:
          message.orchestratorAddress = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$attestationId5, _object$cosmosDenom, _object$tokenContract3, _object$name, _object$symbol, _object$orchestratorA7;
    var message = createBaseEventERC20DeployedClaim();
    message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? _helpers.Long.fromValue(object.eventNonce) : _helpers.Long.UZERO;
    message.eventHeight = object.eventHeight !== undefined && object.eventHeight !== null ? _helpers.Long.fromValue(object.eventHeight) : _helpers.Long.UZERO;
    message.attestationId = (_object$attestationId5 = object.attestationId) !== null && _object$attestationId5 !== void 0 ? _object$attestationId5 : new Uint8Array();
    message.cosmosDenom = (_object$cosmosDenom = object.cosmosDenom) !== null && _object$cosmosDenom !== void 0 ? _object$cosmosDenom : "";
    message.tokenContract = (_object$tokenContract3 = object.tokenContract) !== null && _object$tokenContract3 !== void 0 ? _object$tokenContract3 : "";
    message.name = (_object$name = object.name) !== null && _object$name !== void 0 ? _object$name : "";
    message.symbol = (_object$symbol = object.symbol) !== null && _object$symbol !== void 0 ? _object$symbol : "";
    message.decimals = object.decimals !== undefined && object.decimals !== null ? _helpers.Long.fromValue(object.decimals) : _helpers.Long.UZERO;
    message.orchestratorAddress = (_object$orchestratorA7 = object.orchestratorAddress) !== null && _object$orchestratorA7 !== void 0 ? _object$orchestratorA7 : "";
    return message;
  }
};
exports.EventERC20DeployedClaim = EventERC20DeployedClaim;
function createBaseEventValsetUpdateClaim() {
  return {
    eventNonce: _helpers.Long.UZERO,
    eventHeight: _helpers.Long.UZERO,
    attestationId: new Uint8Array(),
    valsetNonce: _helpers.Long.UZERO,
    valsetMembers: [],
    rewardAmount: "",
    rewardToken: "",
    orchestratorAddress: ""
  };
}
var EventValsetUpdateClaim = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (!message.eventNonce.isZero()) {
      writer.uint32(8).uint64(message.eventNonce);
    }
    if (!message.eventHeight.isZero()) {
      writer.uint32(16).uint64(message.eventHeight);
    }
    if (message.attestationId.length !== 0) {
      writer.uint32(26).bytes(message.attestationId);
    }
    if (!message.valsetNonce.isZero()) {
      writer.uint32(32).uint64(message.valsetNonce);
    }
    var _iterator3 = _createForOfIteratorHelper(message.valsetMembers),
      _step3;
    try {
      for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
        var v = _step3.value;
        _types.BridgeValidator.encode(v, writer.uint32(42).fork()).ldelim();
      }
    } catch (err) {
      _iterator3.e(err);
    } finally {
      _iterator3.f();
    }
    if (message.rewardAmount !== "") {
      writer.uint32(50).string(message.rewardAmount);
    }
    if (message.rewardToken !== "") {
      writer.uint32(58).string(message.rewardToken);
    }
    if (message.orchestratorAddress !== "") {
      writer.uint32(66).string(message.orchestratorAddress);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseEventValsetUpdateClaim();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.eventNonce = reader.uint64();
          break;
        case 2:
          message.eventHeight = reader.uint64();
          break;
        case 3:
          message.attestationId = reader.bytes();
          break;
        case 4:
          message.valsetNonce = reader.uint64();
          break;
        case 5:
          message.valsetMembers.push(_types.BridgeValidator.decode(reader, reader.uint32()));
          break;
        case 6:
          message.rewardAmount = reader.string();
          break;
        case 7:
          message.rewardToken = reader.string();
          break;
        case 8:
          message.orchestratorAddress = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$attestationId6, _object$valsetMembers2, _object$rewardAmount2, _object$rewardToken2, _object$orchestratorA8;
    var message = createBaseEventValsetUpdateClaim();
    message.eventNonce = object.eventNonce !== undefined && object.eventNonce !== null ? _helpers.Long.fromValue(object.eventNonce) : _helpers.Long.UZERO;
    message.eventHeight = object.eventHeight !== undefined && object.eventHeight !== null ? _helpers.Long.fromValue(object.eventHeight) : _helpers.Long.UZERO;
    message.attestationId = (_object$attestationId6 = object.attestationId) !== null && _object$attestationId6 !== void 0 ? _object$attestationId6 : new Uint8Array();
    message.valsetNonce = object.valsetNonce !== undefined && object.valsetNonce !== null ? _helpers.Long.fromValue(object.valsetNonce) : _helpers.Long.UZERO;
    message.valsetMembers = ((_object$valsetMembers2 = object.valsetMembers) === null || _object$valsetMembers2 === void 0 ? void 0 : _object$valsetMembers2.map(function (e) {
      return _types.BridgeValidator.fromPartial(e);
    })) || [];
    message.rewardAmount = (_object$rewardAmount2 = object.rewardAmount) !== null && _object$rewardAmount2 !== void 0 ? _object$rewardAmount2 : "";
    message.rewardToken = (_object$rewardToken2 = object.rewardToken) !== null && _object$rewardToken2 !== void 0 ? _object$rewardToken2 : "";
    message.orchestratorAddress = (_object$orchestratorA8 = object.orchestratorAddress) !== null && _object$orchestratorA8 !== void 0 ? _object$orchestratorA8 : "";
    return message;
  }
};
exports.EventValsetUpdateClaim = EventValsetUpdateClaim;
function createBaseEventCancelSendToEth() {
  return {
    outgoingTxId: _helpers.Long.UZERO
  };
}
var EventCancelSendToEth = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (!message.outgoingTxId.isZero()) {
      writer.uint32(8).uint64(message.outgoingTxId);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseEventCancelSendToEth();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.outgoingTxId = reader.uint64();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseEventCancelSendToEth();
    message.outgoingTxId = object.outgoingTxId !== undefined && object.outgoingTxId !== null ? _helpers.Long.fromValue(object.outgoingTxId) : _helpers.Long.UZERO;
    return message;
  }
};
exports.EventCancelSendToEth = EventCancelSendToEth;
function createBaseEventSubmitBadSignatureEvidence() {
  return {
    badEthSignature: "",
    badEthSignatureSubject: ""
  };
}
var EventSubmitBadSignatureEvidence = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.badEthSignature !== "") {
      writer.uint32(10).string(message.badEthSignature);
    }
    if (message.badEthSignatureSubject !== "") {
      writer.uint32(18).string(message.badEthSignatureSubject);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseEventSubmitBadSignatureEvidence();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.badEthSignature = reader.string();
          break;
        case 2:
          message.badEthSignatureSubject = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$badEthSignatu, _object$badEthSignatu2;
    var message = createBaseEventSubmitBadSignatureEvidence();
    message.badEthSignature = (_object$badEthSignatu = object.badEthSignature) !== null && _object$badEthSignatu !== void 0 ? _object$badEthSignatu : "";
    message.badEthSignatureSubject = (_object$badEthSignatu2 = object.badEthSignatureSubject) !== null && _object$badEthSignatu2 !== void 0 ? _object$badEthSignatu2 : "";
    return message;
  }
};
exports.EventSubmitBadSignatureEvidence = EventSubmitBadSignatureEvidence;