"use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Transmission = exports.SetConfigProposal = exports.SetBatchConfigProposal = exports.ReportToSign = exports.Report = exports.Payee = exports.Params = exports.OracleObservationsCounts = exports.ModuleParams = exports.GasReimbursements = exports.FeedProperties = exports.FeedConfigInfo = exports.FeedConfig = exports.EventTransmitted = exports.EventOraclePaid = exports.EventNewTransmission = exports.EventNewRound = exports.EventConfigSet = exports.EventAnswerUpdated = exports.EpochAndRound = exports.ContractConfig = void 0;
var _coin = require("../../../cosmos/base/v1beta1/coin");
var _timestamp = require("../../../google/protobuf/timestamp");
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 createBaseParams() {
  return {
    linkDenom: "",
    payoutBlockInterval: _helpers.Long.UZERO,
    moduleAdmin: ""
  };
}
var Params = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.linkDenom !== "") {
      writer.uint32(10).string(message.linkDenom);
    }
    if (!message.payoutBlockInterval.isZero()) {
      writer.uint32(16).uint64(message.payoutBlockInterval);
    }
    if (message.moduleAdmin !== "") {
      writer.uint32(26).string(message.moduleAdmin);
    }
    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 = createBaseParams();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.linkDenom = reader.string();
          break;
        case 2:
          message.payoutBlockInterval = reader.uint64();
          break;
        case 3:
          message.moduleAdmin = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$linkDenom, _object$moduleAdmin;
    var message = createBaseParams();
    message.linkDenom = (_object$linkDenom = object.linkDenom) !== null && _object$linkDenom !== void 0 ? _object$linkDenom : "";
    message.payoutBlockInterval = object.payoutBlockInterval !== undefined && object.payoutBlockInterval !== null ? _helpers.Long.fromValue(object.payoutBlockInterval) : _helpers.Long.UZERO;
    message.moduleAdmin = (_object$moduleAdmin = object.moduleAdmin) !== null && _object$moduleAdmin !== void 0 ? _object$moduleAdmin : "";
    return message;
  }
};
exports.Params = Params;
function createBaseFeedConfig() {
  return {
    signers: [],
    transmitters: [],
    f: 0,
    onchainConfig: new Uint8Array(),
    offchainConfigVersion: _helpers.Long.UZERO,
    offchainConfig: new Uint8Array(),
    moduleParams: undefined
  };
}
var FeedConfig = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    var _iterator = _createForOfIteratorHelper(message.signers),
      _step;
    try {
      for (_iterator.s(); !(_step = _iterator.n()).done;) {
        var v = _step.value;
        writer.uint32(10).string(v);
      }
    } catch (err) {
      _iterator.e(err);
    } finally {
      _iterator.f();
    }
    var _iterator2 = _createForOfIteratorHelper(message.transmitters),
      _step2;
    try {
      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
        var _v = _step2.value;
        writer.uint32(18).string(_v);
      }
    } catch (err) {
      _iterator2.e(err);
    } finally {
      _iterator2.f();
    }
    if (message.f !== 0) {
      writer.uint32(24).uint32(message.f);
    }
    if (message.onchainConfig.length !== 0) {
      writer.uint32(34).bytes(message.onchainConfig);
    }
    if (!message.offchainConfigVersion.isZero()) {
      writer.uint32(40).uint64(message.offchainConfigVersion);
    }
    if (message.offchainConfig.length !== 0) {
      writer.uint32(50).bytes(message.offchainConfig);
    }
    if (message.moduleParams !== undefined) {
      ModuleParams.encode(message.moduleParams, writer.uint32(58).fork()).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 = createBaseFeedConfig();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.signers.push(reader.string());
          break;
        case 2:
          message.transmitters.push(reader.string());
          break;
        case 3:
          message.f = reader.uint32();
          break;
        case 4:
          message.onchainConfig = reader.bytes();
          break;
        case 5:
          message.offchainConfigVersion = reader.uint64();
          break;
        case 6:
          message.offchainConfig = reader.bytes();
          break;
        case 7:
          message.moduleParams = ModuleParams.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$signers, _object$transmitters, _object$f, _object$onchainConfig, _object$offchainConfi;
    var message = createBaseFeedConfig();
    message.signers = ((_object$signers = object.signers) === null || _object$signers === void 0 ? void 0 : _object$signers.map(function (e) {
      return e;
    })) || [];
    message.transmitters = ((_object$transmitters = object.transmitters) === null || _object$transmitters === void 0 ? void 0 : _object$transmitters.map(function (e) {
      return e;
    })) || [];
    message.f = (_object$f = object.f) !== null && _object$f !== void 0 ? _object$f : 0;
    message.onchainConfig = (_object$onchainConfig = object.onchainConfig) !== null && _object$onchainConfig !== void 0 ? _object$onchainConfig : new Uint8Array();
    message.offchainConfigVersion = object.offchainConfigVersion !== undefined && object.offchainConfigVersion !== null ? _helpers.Long.fromValue(object.offchainConfigVersion) : _helpers.Long.UZERO;
    message.offchainConfig = (_object$offchainConfi = object.offchainConfig) !== null && _object$offchainConfi !== void 0 ? _object$offchainConfi : new Uint8Array();
    message.moduleParams = object.moduleParams !== undefined && object.moduleParams !== null ? ModuleParams.fromPartial(object.moduleParams) : undefined;
    return message;
  }
};
exports.FeedConfig = FeedConfig;
function createBaseFeedConfigInfo() {
  return {
    latestConfigDigest: new Uint8Array(),
    f: 0,
    n: 0,
    configCount: _helpers.Long.UZERO,
    latestConfigBlockNumber: _helpers.Long.ZERO
  };
}
var FeedConfigInfo = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.latestConfigDigest.length !== 0) {
      writer.uint32(10).bytes(message.latestConfigDigest);
    }
    if (message.f !== 0) {
      writer.uint32(16).uint32(message.f);
    }
    if (message.n !== 0) {
      writer.uint32(24).uint32(message.n);
    }
    if (!message.configCount.isZero()) {
      writer.uint32(32).uint64(message.configCount);
    }
    if (!message.latestConfigBlockNumber.isZero()) {
      writer.uint32(40).int64(message.latestConfigBlockNumber);
    }
    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 = createBaseFeedConfigInfo();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.latestConfigDigest = reader.bytes();
          break;
        case 2:
          message.f = reader.uint32();
          break;
        case 3:
          message.n = reader.uint32();
          break;
        case 4:
          message.configCount = reader.uint64();
          break;
        case 5:
          message.latestConfigBlockNumber = reader.int64();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$latestConfigD, _object$f2, _object$n;
    var message = createBaseFeedConfigInfo();
    message.latestConfigDigest = (_object$latestConfigD = object.latestConfigDigest) !== null && _object$latestConfigD !== void 0 ? _object$latestConfigD : new Uint8Array();
    message.f = (_object$f2 = object.f) !== null && _object$f2 !== void 0 ? _object$f2 : 0;
    message.n = (_object$n = object.n) !== null && _object$n !== void 0 ? _object$n : 0;
    message.configCount = object.configCount !== undefined && object.configCount !== null ? _helpers.Long.fromValue(object.configCount) : _helpers.Long.UZERO;
    message.latestConfigBlockNumber = object.latestConfigBlockNumber !== undefined && object.latestConfigBlockNumber !== null ? _helpers.Long.fromValue(object.latestConfigBlockNumber) : _helpers.Long.ZERO;
    return message;
  }
};
exports.FeedConfigInfo = FeedConfigInfo;
function createBaseModuleParams() {
  return {
    feedId: "",
    minAnswer: "",
    maxAnswer: "",
    linkPerObservation: "",
    linkPerTransmission: "",
    linkDenom: "",
    uniqueReports: false,
    description: "",
    feedAdmin: "",
    billingAdmin: ""
  };
}
var ModuleParams = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.feedId !== "") {
      writer.uint32(10).string(message.feedId);
    }
    if (message.minAnswer !== "") {
      writer.uint32(18).string(message.minAnswer);
    }
    if (message.maxAnswer !== "") {
      writer.uint32(26).string(message.maxAnswer);
    }
    if (message.linkPerObservation !== "") {
      writer.uint32(34).string(message.linkPerObservation);
    }
    if (message.linkPerTransmission !== "") {
      writer.uint32(42).string(message.linkPerTransmission);
    }
    if (message.linkDenom !== "") {
      writer.uint32(50).string(message.linkDenom);
    }
    if (message.uniqueReports === true) {
      writer.uint32(56).bool(message.uniqueReports);
    }
    if (message.description !== "") {
      writer.uint32(66).string(message.description);
    }
    if (message.feedAdmin !== "") {
      writer.uint32(74).string(message.feedAdmin);
    }
    if (message.billingAdmin !== "") {
      writer.uint32(82).string(message.billingAdmin);
    }
    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 = createBaseModuleParams();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.feedId = reader.string();
          break;
        case 2:
          message.minAnswer = reader.string();
          break;
        case 3:
          message.maxAnswer = reader.string();
          break;
        case 4:
          message.linkPerObservation = reader.string();
          break;
        case 5:
          message.linkPerTransmission = reader.string();
          break;
        case 6:
          message.linkDenom = reader.string();
          break;
        case 7:
          message.uniqueReports = reader.bool();
          break;
        case 8:
          message.description = reader.string();
          break;
        case 9:
          message.feedAdmin = reader.string();
          break;
        case 10:
          message.billingAdmin = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$feedId, _object$minAnswer, _object$maxAnswer, _object$linkPerObserv, _object$linkPerTransm, _object$linkDenom2, _object$uniqueReports, _object$description, _object$feedAdmin, _object$billingAdmin;
    var message = createBaseModuleParams();
    message.feedId = (_object$feedId = object.feedId) !== null && _object$feedId !== void 0 ? _object$feedId : "";
    message.minAnswer = (_object$minAnswer = object.minAnswer) !== null && _object$minAnswer !== void 0 ? _object$minAnswer : "";
    message.maxAnswer = (_object$maxAnswer = object.maxAnswer) !== null && _object$maxAnswer !== void 0 ? _object$maxAnswer : "";
    message.linkPerObservation = (_object$linkPerObserv = object.linkPerObservation) !== null && _object$linkPerObserv !== void 0 ? _object$linkPerObserv : "";
    message.linkPerTransmission = (_object$linkPerTransm = object.linkPerTransmission) !== null && _object$linkPerTransm !== void 0 ? _object$linkPerTransm : "";
    message.linkDenom = (_object$linkDenom2 = object.linkDenom) !== null && _object$linkDenom2 !== void 0 ? _object$linkDenom2 : "";
    message.uniqueReports = (_object$uniqueReports = object.uniqueReports) !== null && _object$uniqueReports !== void 0 ? _object$uniqueReports : false;
    message.description = (_object$description = object.description) !== null && _object$description !== void 0 ? _object$description : "";
    message.feedAdmin = (_object$feedAdmin = object.feedAdmin) !== null && _object$feedAdmin !== void 0 ? _object$feedAdmin : "";
    message.billingAdmin = (_object$billingAdmin = object.billingAdmin) !== null && _object$billingAdmin !== void 0 ? _object$billingAdmin : "";
    return message;
  }
};
exports.ModuleParams = ModuleParams;
function createBaseContractConfig() {
  return {
    configCount: _helpers.Long.UZERO,
    signers: [],
    transmitters: [],
    f: 0,
    onchainConfig: new Uint8Array(),
    offchainConfigVersion: _helpers.Long.UZERO,
    offchainConfig: new Uint8Array()
  };
}
var ContractConfig = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (!message.configCount.isZero()) {
      writer.uint32(8).uint64(message.configCount);
    }
    var _iterator3 = _createForOfIteratorHelper(message.signers),
      _step3;
    try {
      for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
        var v = _step3.value;
        writer.uint32(18).string(v);
      }
    } catch (err) {
      _iterator3.e(err);
    } finally {
      _iterator3.f();
    }
    var _iterator4 = _createForOfIteratorHelper(message.transmitters),
      _step4;
    try {
      for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
        var _v2 = _step4.value;
        writer.uint32(26).string(_v2);
      }
    } catch (err) {
      _iterator4.e(err);
    } finally {
      _iterator4.f();
    }
    if (message.f !== 0) {
      writer.uint32(32).uint32(message.f);
    }
    if (message.onchainConfig.length !== 0) {
      writer.uint32(42).bytes(message.onchainConfig);
    }
    if (!message.offchainConfigVersion.isZero()) {
      writer.uint32(48).uint64(message.offchainConfigVersion);
    }
    if (message.offchainConfig.length !== 0) {
      writer.uint32(58).bytes(message.offchainConfig);
    }
    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 = createBaseContractConfig();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.configCount = reader.uint64();
          break;
        case 2:
          message.signers.push(reader.string());
          break;
        case 3:
          message.transmitters.push(reader.string());
          break;
        case 4:
          message.f = reader.uint32();
          break;
        case 5:
          message.onchainConfig = reader.bytes();
          break;
        case 6:
          message.offchainConfigVersion = reader.uint64();
          break;
        case 7:
          message.offchainConfig = reader.bytes();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$signers2, _object$transmitters2, _object$f3, _object$onchainConfig2, _object$offchainConfi2;
    var message = createBaseContractConfig();
    message.configCount = object.configCount !== undefined && object.configCount !== null ? _helpers.Long.fromValue(object.configCount) : _helpers.Long.UZERO;
    message.signers = ((_object$signers2 = object.signers) === null || _object$signers2 === void 0 ? void 0 : _object$signers2.map(function (e) {
      return e;
    })) || [];
    message.transmitters = ((_object$transmitters2 = object.transmitters) === null || _object$transmitters2 === void 0 ? void 0 : _object$transmitters2.map(function (e) {
      return e;
    })) || [];
    message.f = (_object$f3 = object.f) !== null && _object$f3 !== void 0 ? _object$f3 : 0;
    message.onchainConfig = (_object$onchainConfig2 = object.onchainConfig) !== null && _object$onchainConfig2 !== void 0 ? _object$onchainConfig2 : new Uint8Array();
    message.offchainConfigVersion = object.offchainConfigVersion !== undefined && object.offchainConfigVersion !== null ? _helpers.Long.fromValue(object.offchainConfigVersion) : _helpers.Long.UZERO;
    message.offchainConfig = (_object$offchainConfi2 = object.offchainConfig) !== null && _object$offchainConfi2 !== void 0 ? _object$offchainConfi2 : new Uint8Array();
    return message;
  }
};
exports.ContractConfig = ContractConfig;
function createBaseSetConfigProposal() {
  return {
    title: "",
    description: "",
    config: undefined
  };
}
var SetConfigProposal = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.title !== "") {
      writer.uint32(10).string(message.title);
    }
    if (message.description !== "") {
      writer.uint32(18).string(message.description);
    }
    if (message.config !== undefined) {
      FeedConfig.encode(message.config, writer.uint32(26).fork()).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 = createBaseSetConfigProposal();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.title = reader.string();
          break;
        case 2:
          message.description = reader.string();
          break;
        case 3:
          message.config = FeedConfig.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$title, _object$description2;
    var message = createBaseSetConfigProposal();
    message.title = (_object$title = object.title) !== null && _object$title !== void 0 ? _object$title : "";
    message.description = (_object$description2 = object.description) !== null && _object$description2 !== void 0 ? _object$description2 : "";
    message.config = object.config !== undefined && object.config !== null ? FeedConfig.fromPartial(object.config) : undefined;
    return message;
  }
};
exports.SetConfigProposal = SetConfigProposal;
function createBaseFeedProperties() {
  return {
    feedId: "",
    f: 0,
    onchainConfig: new Uint8Array(),
    offchainConfigVersion: _helpers.Long.UZERO,
    offchainConfig: new Uint8Array(),
    minAnswer: "",
    maxAnswer: "",
    linkPerObservation: "",
    linkPerTransmission: "",
    uniqueReports: false,
    description: ""
  };
}
var FeedProperties = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.feedId !== "") {
      writer.uint32(10).string(message.feedId);
    }
    if (message.f !== 0) {
      writer.uint32(16).uint32(message.f);
    }
    if (message.onchainConfig.length !== 0) {
      writer.uint32(26).bytes(message.onchainConfig);
    }
    if (!message.offchainConfigVersion.isZero()) {
      writer.uint32(32).uint64(message.offchainConfigVersion);
    }
    if (message.offchainConfig.length !== 0) {
      writer.uint32(42).bytes(message.offchainConfig);
    }
    if (message.minAnswer !== "") {
      writer.uint32(50).string(message.minAnswer);
    }
    if (message.maxAnswer !== "") {
      writer.uint32(58).string(message.maxAnswer);
    }
    if (message.linkPerObservation !== "") {
      writer.uint32(66).string(message.linkPerObservation);
    }
    if (message.linkPerTransmission !== "") {
      writer.uint32(74).string(message.linkPerTransmission);
    }
    if (message.uniqueReports === true) {
      writer.uint32(80).bool(message.uniqueReports);
    }
    if (message.description !== "") {
      writer.uint32(90).string(message.description);
    }
    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 = createBaseFeedProperties();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.feedId = reader.string();
          break;
        case 2:
          message.f = reader.uint32();
          break;
        case 3:
          message.onchainConfig = reader.bytes();
          break;
        case 4:
          message.offchainConfigVersion = reader.uint64();
          break;
        case 5:
          message.offchainConfig = reader.bytes();
          break;
        case 6:
          message.minAnswer = reader.string();
          break;
        case 7:
          message.maxAnswer = reader.string();
          break;
        case 8:
          message.linkPerObservation = reader.string();
          break;
        case 9:
          message.linkPerTransmission = reader.string();
          break;
        case 10:
          message.uniqueReports = reader.bool();
          break;
        case 11:
          message.description = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$feedId2, _object$f4, _object$onchainConfig3, _object$offchainConfi3, _object$minAnswer2, _object$maxAnswer2, _object$linkPerObserv2, _object$linkPerTransm2, _object$uniqueReports2, _object$description3;
    var message = createBaseFeedProperties();
    message.feedId = (_object$feedId2 = object.feedId) !== null && _object$feedId2 !== void 0 ? _object$feedId2 : "";
    message.f = (_object$f4 = object.f) !== null && _object$f4 !== void 0 ? _object$f4 : 0;
    message.onchainConfig = (_object$onchainConfig3 = object.onchainConfig) !== null && _object$onchainConfig3 !== void 0 ? _object$onchainConfig3 : new Uint8Array();
    message.offchainConfigVersion = object.offchainConfigVersion !== undefined && object.offchainConfigVersion !== null ? _helpers.Long.fromValue(object.offchainConfigVersion) : _helpers.Long.UZERO;
    message.offchainConfig = (_object$offchainConfi3 = object.offchainConfig) !== null && _object$offchainConfi3 !== void 0 ? _object$offchainConfi3 : new Uint8Array();
    message.minAnswer = (_object$minAnswer2 = object.minAnswer) !== null && _object$minAnswer2 !== void 0 ? _object$minAnswer2 : "";
    message.maxAnswer = (_object$maxAnswer2 = object.maxAnswer) !== null && _object$maxAnswer2 !== void 0 ? _object$maxAnswer2 : "";
    message.linkPerObservation = (_object$linkPerObserv2 = object.linkPerObservation) !== null && _object$linkPerObserv2 !== void 0 ? _object$linkPerObserv2 : "";
    message.linkPerTransmission = (_object$linkPerTransm2 = object.linkPerTransmission) !== null && _object$linkPerTransm2 !== void 0 ? _object$linkPerTransm2 : "";
    message.uniqueReports = (_object$uniqueReports2 = object.uniqueReports) !== null && _object$uniqueReports2 !== void 0 ? _object$uniqueReports2 : false;
    message.description = (_object$description3 = object.description) !== null && _object$description3 !== void 0 ? _object$description3 : "";
    return message;
  }
};
exports.FeedProperties = FeedProperties;
function createBaseSetBatchConfigProposal() {
  return {
    title: "",
    description: "",
    signers: [],
    transmitters: [],
    linkDenom: "",
    feedProperties: []
  };
}
var SetBatchConfigProposal = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.title !== "") {
      writer.uint32(10).string(message.title);
    }
    if (message.description !== "") {
      writer.uint32(18).string(message.description);
    }
    var _iterator5 = _createForOfIteratorHelper(message.signers),
      _step5;
    try {
      for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
        var v = _step5.value;
        writer.uint32(26).string(v);
      }
    } catch (err) {
      _iterator5.e(err);
    } finally {
      _iterator5.f();
    }
    var _iterator6 = _createForOfIteratorHelper(message.transmitters),
      _step6;
    try {
      for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
        var _v3 = _step6.value;
        writer.uint32(34).string(_v3);
      }
    } catch (err) {
      _iterator6.e(err);
    } finally {
      _iterator6.f();
    }
    if (message.linkDenom !== "") {
      writer.uint32(42).string(message.linkDenom);
    }
    var _iterator7 = _createForOfIteratorHelper(message.feedProperties),
      _step7;
    try {
      for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
        var _v4 = _step7.value;
        FeedProperties.encode(_v4, writer.uint32(50).fork()).ldelim();
      }
    } catch (err) {
      _iterator7.e(err);
    } finally {
      _iterator7.f();
    }
    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 = createBaseSetBatchConfigProposal();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.title = reader.string();
          break;
        case 2:
          message.description = reader.string();
          break;
        case 3:
          message.signers.push(reader.string());
          break;
        case 4:
          message.transmitters.push(reader.string());
          break;
        case 5:
          message.linkDenom = reader.string();
          break;
        case 6:
          message.feedProperties.push(FeedProperties.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$title2, _object$description4, _object$signers3, _object$transmitters3, _object$linkDenom3, _object$feedPropertie;
    var message = createBaseSetBatchConfigProposal();
    message.title = (_object$title2 = object.title) !== null && _object$title2 !== void 0 ? _object$title2 : "";
    message.description = (_object$description4 = object.description) !== null && _object$description4 !== void 0 ? _object$description4 : "";
    message.signers = ((_object$signers3 = object.signers) === null || _object$signers3 === void 0 ? void 0 : _object$signers3.map(function (e) {
      return e;
    })) || [];
    message.transmitters = ((_object$transmitters3 = object.transmitters) === null || _object$transmitters3 === void 0 ? void 0 : _object$transmitters3.map(function (e) {
      return e;
    })) || [];
    message.linkDenom = (_object$linkDenom3 = object.linkDenom) !== null && _object$linkDenom3 !== void 0 ? _object$linkDenom3 : "";
    message.feedProperties = ((_object$feedPropertie = object.feedProperties) === null || _object$feedPropertie === void 0 ? void 0 : _object$feedPropertie.map(function (e) {
      return FeedProperties.fromPartial(e);
    })) || [];
    return message;
  }
};
exports.SetBatchConfigProposal = SetBatchConfigProposal;
function createBaseOracleObservationsCounts() {
  return {
    counts: []
  };
}
var OracleObservationsCounts = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    writer.uint32(10).fork();
    var _iterator8 = _createForOfIteratorHelper(message.counts),
      _step8;
    try {
      for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
        var v = _step8.value;
        writer.uint32(v);
      }
    } catch (err) {
      _iterator8.e(err);
    } finally {
      _iterator8.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 = createBaseOracleObservationsCounts();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          if ((tag & 7) === 2) {
            var end2 = reader.uint32() + reader.pos;
            while (reader.pos < end2) {
              message.counts.push(reader.uint32());
            }
          } else {
            message.counts.push(reader.uint32());
          }
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$counts;
    var message = createBaseOracleObservationsCounts();
    message.counts = ((_object$counts = object.counts) === null || _object$counts === void 0 ? void 0 : _object$counts.map(function (e) {
      return e;
    })) || [];
    return message;
  }
};
exports.OracleObservationsCounts = OracleObservationsCounts;
function createBaseGasReimbursements() {
  return {
    reimbursements: []
  };
}
var GasReimbursements = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    var _iterator9 = _createForOfIteratorHelper(message.reimbursements),
      _step9;
    try {
      for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
        var v = _step9.value;
        _coin.Coin.encode(v, writer.uint32(10).fork()).ldelim();
      }
    } catch (err) {
      _iterator9.e(err);
    } finally {
      _iterator9.f();
    }
    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 = createBaseGasReimbursements();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.reimbursements.push(_coin.Coin.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$reimbursement;
    var message = createBaseGasReimbursements();
    message.reimbursements = ((_object$reimbursement = object.reimbursements) === null || _object$reimbursement === void 0 ? void 0 : _object$reimbursement.map(function (e) {
      return _coin.Coin.fromPartial(e);
    })) || [];
    return message;
  }
};
exports.GasReimbursements = GasReimbursements;
function createBasePayee() {
  return {
    transmitterAddr: "",
    paymentAddr: ""
  };
}
var Payee = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.transmitterAddr !== "") {
      writer.uint32(10).string(message.transmitterAddr);
    }
    if (message.paymentAddr !== "") {
      writer.uint32(18).string(message.paymentAddr);
    }
    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 = createBasePayee();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.transmitterAddr = reader.string();
          break;
        case 2:
          message.paymentAddr = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$transmitterAd, _object$paymentAddr;
    var message = createBasePayee();
    message.transmitterAddr = (_object$transmitterAd = object.transmitterAddr) !== null && _object$transmitterAd !== void 0 ? _object$transmitterAd : "";
    message.paymentAddr = (_object$paymentAddr = object.paymentAddr) !== null && _object$paymentAddr !== void 0 ? _object$paymentAddr : "";
    return message;
  }
};
exports.Payee = Payee;
function createBaseTransmission() {
  return {
    answer: "",
    observationsTimestamp: _helpers.Long.ZERO,
    transmissionTimestamp: _helpers.Long.ZERO
  };
}
var Transmission = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.answer !== "") {
      writer.uint32(10).string(message.answer);
    }
    if (!message.observationsTimestamp.isZero()) {
      writer.uint32(16).int64(message.observationsTimestamp);
    }
    if (!message.transmissionTimestamp.isZero()) {
      writer.uint32(24).int64(message.transmissionTimestamp);
    }
    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 = createBaseTransmission();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.answer = reader.string();
          break;
        case 2:
          message.observationsTimestamp = reader.int64();
          break;
        case 3:
          message.transmissionTimestamp = reader.int64();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$answer;
    var message = createBaseTransmission();
    message.answer = (_object$answer = object.answer) !== null && _object$answer !== void 0 ? _object$answer : "";
    message.observationsTimestamp = object.observationsTimestamp !== undefined && object.observationsTimestamp !== null ? _helpers.Long.fromValue(object.observationsTimestamp) : _helpers.Long.ZERO;
    message.transmissionTimestamp = object.transmissionTimestamp !== undefined && object.transmissionTimestamp !== null ? _helpers.Long.fromValue(object.transmissionTimestamp) : _helpers.Long.ZERO;
    return message;
  }
};
exports.Transmission = Transmission;
function createBaseEpochAndRound() {
  return {
    epoch: _helpers.Long.UZERO,
    round: _helpers.Long.UZERO
  };
}
var EpochAndRound = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (!message.epoch.isZero()) {
      writer.uint32(8).uint64(message.epoch);
    }
    if (!message.round.isZero()) {
      writer.uint32(16).uint64(message.round);
    }
    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 = createBaseEpochAndRound();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.epoch = reader.uint64();
          break;
        case 2:
          message.round = reader.uint64();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseEpochAndRound();
    message.epoch = object.epoch !== undefined && object.epoch !== null ? _helpers.Long.fromValue(object.epoch) : _helpers.Long.UZERO;
    message.round = object.round !== undefined && object.round !== null ? _helpers.Long.fromValue(object.round) : _helpers.Long.UZERO;
    return message;
  }
};
exports.EpochAndRound = EpochAndRound;
function createBaseReport() {
  return {
    observationsTimestamp: _helpers.Long.ZERO,
    observers: new Uint8Array(),
    observations: []
  };
}
var Report = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (!message.observationsTimestamp.isZero()) {
      writer.uint32(8).int64(message.observationsTimestamp);
    }
    if (message.observers.length !== 0) {
      writer.uint32(18).bytes(message.observers);
    }
    var _iterator10 = _createForOfIteratorHelper(message.observations),
      _step10;
    try {
      for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
        var v = _step10.value;
        writer.uint32(26).string(v);
      }
    } catch (err) {
      _iterator10.e(err);
    } finally {
      _iterator10.f();
    }
    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 = createBaseReport();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.observationsTimestamp = reader.int64();
          break;
        case 2:
          message.observers = reader.bytes();
          break;
        case 3:
          message.observations.push(reader.string());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$observers, _object$observations;
    var message = createBaseReport();
    message.observationsTimestamp = object.observationsTimestamp !== undefined && object.observationsTimestamp !== null ? _helpers.Long.fromValue(object.observationsTimestamp) : _helpers.Long.ZERO;
    message.observers = (_object$observers = object.observers) !== null && _object$observers !== void 0 ? _object$observers : new Uint8Array();
    message.observations = ((_object$observations = object.observations) === null || _object$observations === void 0 ? void 0 : _object$observations.map(function (e) {
      return e;
    })) || [];
    return message;
  }
};
exports.Report = Report;
function createBaseReportToSign() {
  return {
    configDigest: new Uint8Array(),
    epoch: _helpers.Long.UZERO,
    round: _helpers.Long.UZERO,
    extraHash: new Uint8Array(),
    report: new Uint8Array()
  };
}
var ReportToSign = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.configDigest.length !== 0) {
      writer.uint32(10).bytes(message.configDigest);
    }
    if (!message.epoch.isZero()) {
      writer.uint32(16).uint64(message.epoch);
    }
    if (!message.round.isZero()) {
      writer.uint32(24).uint64(message.round);
    }
    if (message.extraHash.length !== 0) {
      writer.uint32(34).bytes(message.extraHash);
    }
    if (message.report.length !== 0) {
      writer.uint32(42).bytes(message.report);
    }
    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 = createBaseReportToSign();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.configDigest = reader.bytes();
          break;
        case 2:
          message.epoch = reader.uint64();
          break;
        case 3:
          message.round = reader.uint64();
          break;
        case 4:
          message.extraHash = reader.bytes();
          break;
        case 5:
          message.report = reader.bytes();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$configDigest, _object$extraHash, _object$report;
    var message = createBaseReportToSign();
    message.configDigest = (_object$configDigest = object.configDigest) !== null && _object$configDigest !== void 0 ? _object$configDigest : new Uint8Array();
    message.epoch = object.epoch !== undefined && object.epoch !== null ? _helpers.Long.fromValue(object.epoch) : _helpers.Long.UZERO;
    message.round = object.round !== undefined && object.round !== null ? _helpers.Long.fromValue(object.round) : _helpers.Long.UZERO;
    message.extraHash = (_object$extraHash = object.extraHash) !== null && _object$extraHash !== void 0 ? _object$extraHash : new Uint8Array();
    message.report = (_object$report = object.report) !== null && _object$report !== void 0 ? _object$report : new Uint8Array();
    return message;
  }
};
exports.ReportToSign = ReportToSign;
function createBaseEventOraclePaid() {
  return {
    transmitterAddr: "",
    payeeAddr: "",
    amount: undefined
  };
}
var EventOraclePaid = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.transmitterAddr !== "") {
      writer.uint32(10).string(message.transmitterAddr);
    }
    if (message.payeeAddr !== "") {
      writer.uint32(18).string(message.payeeAddr);
    }
    if (message.amount !== undefined) {
      _coin.Coin.encode(message.amount, writer.uint32(26).fork()).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 = createBaseEventOraclePaid();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.transmitterAddr = reader.string();
          break;
        case 2:
          message.payeeAddr = reader.string();
          break;
        case 3:
          message.amount = _coin.Coin.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$transmitterAd2, _object$payeeAddr;
    var message = createBaseEventOraclePaid();
    message.transmitterAddr = (_object$transmitterAd2 = object.transmitterAddr) !== null && _object$transmitterAd2 !== void 0 ? _object$transmitterAd2 : "";
    message.payeeAddr = (_object$payeeAddr = object.payeeAddr) !== null && _object$payeeAddr !== void 0 ? _object$payeeAddr : "";
    message.amount = object.amount !== undefined && object.amount !== null ? _coin.Coin.fromPartial(object.amount) : undefined;
    return message;
  }
};
exports.EventOraclePaid = EventOraclePaid;
function createBaseEventAnswerUpdated() {
  return {
    current: "",
    roundId: "",
    updatedAt: undefined
  };
}
var EventAnswerUpdated = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.current !== "") {
      writer.uint32(10).string(message.current);
    }
    if (message.roundId !== "") {
      writer.uint32(18).string(message.roundId);
    }
    if (message.updatedAt !== undefined) {
      _timestamp.Timestamp.encode((0, _helpers.toTimestamp)(message.updatedAt), writer.uint32(26).fork()).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 = createBaseEventAnswerUpdated();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.current = reader.string();
          break;
        case 2:
          message.roundId = reader.string();
          break;
        case 3:
          message.updatedAt = (0, _helpers.fromTimestamp)(_timestamp.Timestamp.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$current, _object$roundId, _object$updatedAt;
    var message = createBaseEventAnswerUpdated();
    message.current = (_object$current = object.current) !== null && _object$current !== void 0 ? _object$current : "";
    message.roundId = (_object$roundId = object.roundId) !== null && _object$roundId !== void 0 ? _object$roundId : "";
    message.updatedAt = (_object$updatedAt = object.updatedAt) !== null && _object$updatedAt !== void 0 ? _object$updatedAt : undefined;
    return message;
  }
};
exports.EventAnswerUpdated = EventAnswerUpdated;
function createBaseEventNewRound() {
  return {
    roundId: "",
    startedBy: "",
    startedAt: undefined
  };
}
var EventNewRound = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.roundId !== "") {
      writer.uint32(10).string(message.roundId);
    }
    if (message.startedBy !== "") {
      writer.uint32(18).string(message.startedBy);
    }
    if (message.startedAt !== undefined) {
      _timestamp.Timestamp.encode((0, _helpers.toTimestamp)(message.startedAt), writer.uint32(26).fork()).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 = createBaseEventNewRound();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.roundId = reader.string();
          break;
        case 2:
          message.startedBy = reader.string();
          break;
        case 3:
          message.startedAt = (0, _helpers.fromTimestamp)(_timestamp.Timestamp.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$roundId2, _object$startedBy, _object$startedAt;
    var message = createBaseEventNewRound();
    message.roundId = (_object$roundId2 = object.roundId) !== null && _object$roundId2 !== void 0 ? _object$roundId2 : "";
    message.startedBy = (_object$startedBy = object.startedBy) !== null && _object$startedBy !== void 0 ? _object$startedBy : "";
    message.startedAt = (_object$startedAt = object.startedAt) !== null && _object$startedAt !== void 0 ? _object$startedAt : undefined;
    return message;
  }
};
exports.EventNewRound = EventNewRound;
function createBaseEventTransmitted() {
  return {
    configDigest: new Uint8Array(),
    epoch: _helpers.Long.UZERO
  };
}
var EventTransmitted = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.configDigest.length !== 0) {
      writer.uint32(10).bytes(message.configDigest);
    }
    if (!message.epoch.isZero()) {
      writer.uint32(16).uint64(message.epoch);
    }
    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 = createBaseEventTransmitted();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.configDigest = reader.bytes();
          break;
        case 2:
          message.epoch = reader.uint64();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$configDigest2;
    var message = createBaseEventTransmitted();
    message.configDigest = (_object$configDigest2 = object.configDigest) !== null && _object$configDigest2 !== void 0 ? _object$configDigest2 : new Uint8Array();
    message.epoch = object.epoch !== undefined && object.epoch !== null ? _helpers.Long.fromValue(object.epoch) : _helpers.Long.UZERO;
    return message;
  }
};
exports.EventTransmitted = EventTransmitted;
function createBaseEventNewTransmission() {
  return {
    feedId: "",
    aggregatorRoundId: 0,
    answer: "",
    transmitter: "",
    observationsTimestamp: _helpers.Long.ZERO,
    observations: [],
    observers: new Uint8Array(),
    configDigest: new Uint8Array(),
    epochAndRound: undefined
  };
}
var EventNewTransmission = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.feedId !== "") {
      writer.uint32(10).string(message.feedId);
    }
    if (message.aggregatorRoundId !== 0) {
      writer.uint32(16).uint32(message.aggregatorRoundId);
    }
    if (message.answer !== "") {
      writer.uint32(26).string(message.answer);
    }
    if (message.transmitter !== "") {
      writer.uint32(34).string(message.transmitter);
    }
    if (!message.observationsTimestamp.isZero()) {
      writer.uint32(40).int64(message.observationsTimestamp);
    }
    var _iterator11 = _createForOfIteratorHelper(message.observations),
      _step11;
    try {
      for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
        var v = _step11.value;
        writer.uint32(50).string(v);
      }
    } catch (err) {
      _iterator11.e(err);
    } finally {
      _iterator11.f();
    }
    if (message.observers.length !== 0) {
      writer.uint32(58).bytes(message.observers);
    }
    if (message.configDigest.length !== 0) {
      writer.uint32(66).bytes(message.configDigest);
    }
    if (message.epochAndRound !== undefined) {
      EpochAndRound.encode(message.epochAndRound, writer.uint32(74).fork()).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 = createBaseEventNewTransmission();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.feedId = reader.string();
          break;
        case 2:
          message.aggregatorRoundId = reader.uint32();
          break;
        case 3:
          message.answer = reader.string();
          break;
        case 4:
          message.transmitter = reader.string();
          break;
        case 5:
          message.observationsTimestamp = reader.int64();
          break;
        case 6:
          message.observations.push(reader.string());
          break;
        case 7:
          message.observers = reader.bytes();
          break;
        case 8:
          message.configDigest = reader.bytes();
          break;
        case 9:
          message.epochAndRound = EpochAndRound.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$feedId3, _object$aggregatorRou, _object$answer2, _object$transmitter, _object$observations2, _object$observers2, _object$configDigest3;
    var message = createBaseEventNewTransmission();
    message.feedId = (_object$feedId3 = object.feedId) !== null && _object$feedId3 !== void 0 ? _object$feedId3 : "";
    message.aggregatorRoundId = (_object$aggregatorRou = object.aggregatorRoundId) !== null && _object$aggregatorRou !== void 0 ? _object$aggregatorRou : 0;
    message.answer = (_object$answer2 = object.answer) !== null && _object$answer2 !== void 0 ? _object$answer2 : "";
    message.transmitter = (_object$transmitter = object.transmitter) !== null && _object$transmitter !== void 0 ? _object$transmitter : "";
    message.observationsTimestamp = object.observationsTimestamp !== undefined && object.observationsTimestamp !== null ? _helpers.Long.fromValue(object.observationsTimestamp) : _helpers.Long.ZERO;
    message.observations = ((_object$observations2 = object.observations) === null || _object$observations2 === void 0 ? void 0 : _object$observations2.map(function (e) {
      return e;
    })) || [];
    message.observers = (_object$observers2 = object.observers) !== null && _object$observers2 !== void 0 ? _object$observers2 : new Uint8Array();
    message.configDigest = (_object$configDigest3 = object.configDigest) !== null && _object$configDigest3 !== void 0 ? _object$configDigest3 : new Uint8Array();
    message.epochAndRound = object.epochAndRound !== undefined && object.epochAndRound !== null ? EpochAndRound.fromPartial(object.epochAndRound) : undefined;
    return message;
  }
};
exports.EventNewTransmission = EventNewTransmission;
function createBaseEventConfigSet() {
  return {
    configDigest: new Uint8Array(),
    previousConfigBlockNumber: _helpers.Long.ZERO,
    config: undefined,
    configInfo: undefined
  };
}
var EventConfigSet = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.configDigest.length !== 0) {
      writer.uint32(10).bytes(message.configDigest);
    }
    if (!message.previousConfigBlockNumber.isZero()) {
      writer.uint32(16).int64(message.previousConfigBlockNumber);
    }
    if (message.config !== undefined) {
      FeedConfig.encode(message.config, writer.uint32(26).fork()).ldelim();
    }
    if (message.configInfo !== undefined) {
      FeedConfigInfo.encode(message.configInfo, writer.uint32(34).fork()).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 = createBaseEventConfigSet();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.configDigest = reader.bytes();
          break;
        case 2:
          message.previousConfigBlockNumber = reader.int64();
          break;
        case 3:
          message.config = FeedConfig.decode(reader, reader.uint32());
          break;
        case 4:
          message.configInfo = FeedConfigInfo.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$configDigest4;
    var message = createBaseEventConfigSet();
    message.configDigest = (_object$configDigest4 = object.configDigest) !== null && _object$configDigest4 !== void 0 ? _object$configDigest4 : new Uint8Array();
    message.previousConfigBlockNumber = object.previousConfigBlockNumber !== undefined && object.previousConfigBlockNumber !== null ? _helpers.Long.fromValue(object.previousConfigBlockNumber) : _helpers.Long.ZERO;
    message.config = object.config !== undefined && object.config !== null ? FeedConfig.fromPartial(object.config) : undefined;
    message.configInfo = object.configInfo !== undefined && object.configInfo !== null ? FeedConfigInfo.fromPartial(object.configInfo) : undefined;
    return message;
  }
};
exports.EventConfigSet = EventConfigSet;