"use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.QueryParamsResponse = exports.QueryParamsRequest = exports.QueryOwedAmountResponse = exports.QueryOwedAmountRequest = exports.QueryModuleStateResponse = exports.QueryModuleStateRequest = exports.QueryLatestTransmissionDetailsResponse = exports.QueryLatestTransmissionDetailsRequest = exports.QueryLatestRoundResponse = exports.QueryLatestRoundRequest = exports.QueryFeedConfigResponse = exports.QueryFeedConfigRequest = exports.QueryFeedConfigInfoResponse = exports.QueryFeedConfigInfoRequest = void 0;
var _ocr = require("./ocr");
var _coin = require("../../../cosmos/base/v1beta1/coin");
var _genesis = require("./genesis");
var _m0 = _interopRequireWildcard(require("protobufjs/minimal"));
var _helpers = require("../../../helpers");
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 createBaseQueryParamsRequest() {
  return {};
}
var QueryParamsRequest = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseQueryParamsRequest();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseQueryParamsRequest();
    return message;
  }
};
exports.QueryParamsRequest = QueryParamsRequest;
function createBaseQueryParamsResponse() {
  return {
    params: undefined
  };
}
var QueryParamsResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.params !== undefined) {
      _ocr.Params.encode(message.params, writer.uint32(10).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 = createBaseQueryParamsResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.params = _ocr.Params.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseQueryParamsResponse();
    message.params = object.params !== undefined && object.params !== null ? _ocr.Params.fromPartial(object.params) : undefined;
    return message;
  }
};
exports.QueryParamsResponse = QueryParamsResponse;
function createBaseQueryFeedConfigRequest() {
  return {
    feedId: ""
  };
}
var QueryFeedConfigRequest = {
  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);
    }
    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 = createBaseQueryFeedConfigRequest();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.feedId = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$feedId;
    var message = createBaseQueryFeedConfigRequest();
    message.feedId = (_object$feedId = object.feedId) !== null && _object$feedId !== void 0 ? _object$feedId : "";
    return message;
  }
};
exports.QueryFeedConfigRequest = QueryFeedConfigRequest;
function createBaseQueryFeedConfigResponse() {
  return {
    feedConfigInfo: undefined,
    feedConfig: undefined
  };
}
var QueryFeedConfigResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.feedConfigInfo !== undefined) {
      _ocr.FeedConfigInfo.encode(message.feedConfigInfo, writer.uint32(10).fork()).ldelim();
    }
    if (message.feedConfig !== undefined) {
      _ocr.FeedConfig.encode(message.feedConfig, writer.uint32(18).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 = createBaseQueryFeedConfigResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.feedConfigInfo = _ocr.FeedConfigInfo.decode(reader, reader.uint32());
          break;
        case 2:
          message.feedConfig = _ocr.FeedConfig.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseQueryFeedConfigResponse();
    message.feedConfigInfo = object.feedConfigInfo !== undefined && object.feedConfigInfo !== null ? _ocr.FeedConfigInfo.fromPartial(object.feedConfigInfo) : undefined;
    message.feedConfig = object.feedConfig !== undefined && object.feedConfig !== null ? _ocr.FeedConfig.fromPartial(object.feedConfig) : undefined;
    return message;
  }
};
exports.QueryFeedConfigResponse = QueryFeedConfigResponse;
function createBaseQueryFeedConfigInfoRequest() {
  return {
    feedId: ""
  };
}
var QueryFeedConfigInfoRequest = {
  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);
    }
    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 = createBaseQueryFeedConfigInfoRequest();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.feedId = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$feedId2;
    var message = createBaseQueryFeedConfigInfoRequest();
    message.feedId = (_object$feedId2 = object.feedId) !== null && _object$feedId2 !== void 0 ? _object$feedId2 : "";
    return message;
  }
};
exports.QueryFeedConfigInfoRequest = QueryFeedConfigInfoRequest;
function createBaseQueryFeedConfigInfoResponse() {
  return {
    feedConfigInfo: undefined,
    epochAndRound: undefined
  };
}
var QueryFeedConfigInfoResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.feedConfigInfo !== undefined) {
      _ocr.FeedConfigInfo.encode(message.feedConfigInfo, writer.uint32(10).fork()).ldelim();
    }
    if (message.epochAndRound !== undefined) {
      _ocr.EpochAndRound.encode(message.epochAndRound, writer.uint32(18).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 = createBaseQueryFeedConfigInfoResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.feedConfigInfo = _ocr.FeedConfigInfo.decode(reader, reader.uint32());
          break;
        case 2:
          message.epochAndRound = _ocr.EpochAndRound.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseQueryFeedConfigInfoResponse();
    message.feedConfigInfo = object.feedConfigInfo !== undefined && object.feedConfigInfo !== null ? _ocr.FeedConfigInfo.fromPartial(object.feedConfigInfo) : undefined;
    message.epochAndRound = object.epochAndRound !== undefined && object.epochAndRound !== null ? _ocr.EpochAndRound.fromPartial(object.epochAndRound) : undefined;
    return message;
  }
};
exports.QueryFeedConfigInfoResponse = QueryFeedConfigInfoResponse;
function createBaseQueryLatestRoundRequest() {
  return {
    feedId: ""
  };
}
var QueryLatestRoundRequest = {
  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);
    }
    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 = createBaseQueryLatestRoundRequest();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.feedId = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$feedId3;
    var message = createBaseQueryLatestRoundRequest();
    message.feedId = (_object$feedId3 = object.feedId) !== null && _object$feedId3 !== void 0 ? _object$feedId3 : "";
    return message;
  }
};
exports.QueryLatestRoundRequest = QueryLatestRoundRequest;
function createBaseQueryLatestRoundResponse() {
  return {
    latestRoundId: _helpers.Long.UZERO,
    data: undefined
  };
}
var QueryLatestRoundResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (!message.latestRoundId.isZero()) {
      writer.uint32(8).uint64(message.latestRoundId);
    }
    if (message.data !== undefined) {
      _ocr.Transmission.encode(message.data, writer.uint32(18).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 = createBaseQueryLatestRoundResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.latestRoundId = reader.uint64();
          break;
        case 2:
          message.data = _ocr.Transmission.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseQueryLatestRoundResponse();
    message.latestRoundId = object.latestRoundId !== undefined && object.latestRoundId !== null ? _helpers.Long.fromValue(object.latestRoundId) : _helpers.Long.UZERO;
    message.data = object.data !== undefined && object.data !== null ? _ocr.Transmission.fromPartial(object.data) : undefined;
    return message;
  }
};
exports.QueryLatestRoundResponse = QueryLatestRoundResponse;
function createBaseQueryLatestTransmissionDetailsRequest() {
  return {
    feedId: ""
  };
}
var QueryLatestTransmissionDetailsRequest = {
  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);
    }
    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 = createBaseQueryLatestTransmissionDetailsRequest();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.feedId = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$feedId4;
    var message = createBaseQueryLatestTransmissionDetailsRequest();
    message.feedId = (_object$feedId4 = object.feedId) !== null && _object$feedId4 !== void 0 ? _object$feedId4 : "";
    return message;
  }
};
exports.QueryLatestTransmissionDetailsRequest = QueryLatestTransmissionDetailsRequest;
function createBaseQueryLatestTransmissionDetailsResponse() {
  return {
    configDigest: new Uint8Array(),
    epochAndRound: undefined,
    data: undefined
  };
}
var QueryLatestTransmissionDetailsResponse = {
  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.epochAndRound !== undefined) {
      _ocr.EpochAndRound.encode(message.epochAndRound, writer.uint32(18).fork()).ldelim();
    }
    if (message.data !== undefined) {
      _ocr.Transmission.encode(message.data, 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 = createBaseQueryLatestTransmissionDetailsResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.configDigest = reader.bytes();
          break;
        case 2:
          message.epochAndRound = _ocr.EpochAndRound.decode(reader, reader.uint32());
          break;
        case 3:
          message.data = _ocr.Transmission.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$configDigest;
    var message = createBaseQueryLatestTransmissionDetailsResponse();
    message.configDigest = (_object$configDigest = object.configDigest) !== null && _object$configDigest !== void 0 ? _object$configDigest : new Uint8Array();
    message.epochAndRound = object.epochAndRound !== undefined && object.epochAndRound !== null ? _ocr.EpochAndRound.fromPartial(object.epochAndRound) : undefined;
    message.data = object.data !== undefined && object.data !== null ? _ocr.Transmission.fromPartial(object.data) : undefined;
    return message;
  }
};
exports.QueryLatestTransmissionDetailsResponse = QueryLatestTransmissionDetailsResponse;
function createBaseQueryOwedAmountRequest() {
  return {
    transmitter: ""
  };
}
var QueryOwedAmountRequest = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.transmitter !== "") {
      writer.uint32(10).string(message.transmitter);
    }
    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 = createBaseQueryOwedAmountRequest();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.transmitter = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var _object$transmitter;
    var message = createBaseQueryOwedAmountRequest();
    message.transmitter = (_object$transmitter = object.transmitter) !== null && _object$transmitter !== void 0 ? _object$transmitter : "";
    return message;
  }
};
exports.QueryOwedAmountRequest = QueryOwedAmountRequest;
function createBaseQueryOwedAmountResponse() {
  return {
    amount: undefined
  };
}
var QueryOwedAmountResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.amount !== undefined) {
      _coin.Coin.encode(message.amount, writer.uint32(10).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 = createBaseQueryOwedAmountResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.amount = _coin.Coin.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseQueryOwedAmountResponse();
    message.amount = object.amount !== undefined && object.amount !== null ? _coin.Coin.fromPartial(object.amount) : undefined;
    return message;
  }
};
exports.QueryOwedAmountResponse = QueryOwedAmountResponse;
function createBaseQueryModuleStateRequest() {
  return {};
}
var QueryModuleStateRequest = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseQueryModuleStateRequest();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseQueryModuleStateRequest();
    return message;
  }
};
exports.QueryModuleStateRequest = QueryModuleStateRequest;
function createBaseQueryModuleStateResponse() {
  return {
    state: undefined
  };
}
var QueryModuleStateResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.state !== undefined) {
      _genesis.GenesisState.encode(message.state, writer.uint32(10).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 = createBaseQueryModuleStateResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.state = _genesis.GenesisState.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseQueryModuleStateResponse();
    message.state = object.state !== undefined && object.state !== null ? _genesis.GenesisState.fromPartial(object.state) : undefined;
    return message;
  }
};
exports.QueryModuleStateResponse = QueryModuleStateResponse;