import { WireType } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { PriceState } from "./oracle_pb.js";
import { OracleType } from "./oracle_pb.js";
import { ChainlinkDataStreamsPriceState } from "./oracle_pb.js";
import { PythPriceState } from "./oracle_pb.js";
import { StorkPriceState } from "./oracle_pb.js";
class SetChainlinkPriceEvent$Type extends MessageType {
  constructor() {
    super("injective.oracle.v1beta1.SetChainlinkPriceEvent", [
      {
        no: 1,
        name: "feed_id",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      { no: 2, name: "answer", kind: "scalar", T: 9, options: { "gogoproto.nullable": false, "gogoproto.customtype": "cosmossdk.io/math.LegacyDec" } },
      {
        no: 3,
        name: "timestamp",
        kind: "scalar",
        T: 4,
        L: 0
        /*LongType.BIGINT*/
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.feedId = "";
    message.answer = "";
    message.timestamp = 0n;
    if (value !== void 0)
      reflectionMergePartial(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* string feed_id */
        1:
          message.feedId = reader.string();
          break;
        case /* string answer */
        2:
          message.answer = reader.string();
          break;
        case /* uint64 timestamp */
        3:
          message.timestamp = reader.uint64().toBigInt();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.feedId !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.feedId);
    if (message.answer !== "")
      writer.tag(2, WireType.LengthDelimited).string(message.answer);
    if (message.timestamp !== 0n)
      writer.tag(3, WireType.Varint).uint64(message.timestamp);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
    return writer;
  }
}
const SetChainlinkPriceEvent = new SetChainlinkPriceEvent$Type();
class SetBandPriceEvent$Type extends MessageType {
  constructor() {
    super("injective.oracle.v1beta1.SetBandPriceEvent", [
      {
        no: 1,
        name: "relayer",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 2,
        name: "symbol",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      { no: 3, name: "price", kind: "scalar", T: 9, options: { "gogoproto.nullable": false, "gogoproto.customtype": "cosmossdk.io/math.LegacyDec" } },
      {
        no: 4,
        name: "resolve_time",
        kind: "scalar",
        T: 4,
        L: 0
        /*LongType.BIGINT*/
      },
      {
        no: 5,
        name: "request_id",
        kind: "scalar",
        T: 4,
        L: 0
        /*LongType.BIGINT*/
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.relayer = "";
    message.symbol = "";
    message.price = "";
    message.resolveTime = 0n;
    message.requestId = 0n;
    if (value !== void 0)
      reflectionMergePartial(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* string relayer */
        1:
          message.relayer = reader.string();
          break;
        case /* string symbol */
        2:
          message.symbol = reader.string();
          break;
        case /* string price */
        3:
          message.price = reader.string();
          break;
        case /* uint64 resolve_time */
        4:
          message.resolveTime = reader.uint64().toBigInt();
          break;
        case /* uint64 request_id */
        5:
          message.requestId = reader.uint64().toBigInt();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.relayer !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.relayer);
    if (message.symbol !== "")
      writer.tag(2, WireType.LengthDelimited).string(message.symbol);
    if (message.price !== "")
      writer.tag(3, WireType.LengthDelimited).string(message.price);
    if (message.resolveTime !== 0n)
      writer.tag(4, WireType.Varint).uint64(message.resolveTime);
    if (message.requestId !== 0n)
      writer.tag(5, WireType.Varint).uint64(message.requestId);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
    return writer;
  }
}
const SetBandPriceEvent = new SetBandPriceEvent$Type();
class SetBandIBCPriceEvent$Type extends MessageType {
  constructor() {
    super("injective.oracle.v1beta1.SetBandIBCPriceEvent", [
      {
        no: 1,
        name: "relayer",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 2,
        name: "symbols",
        kind: "scalar",
        repeat: 2,
        T: 9
        /*ScalarType.STRING*/
      },
      { no: 3, name: "prices", kind: "scalar", repeat: 2, T: 9, options: { "gogoproto.nullable": false, "gogoproto.customtype": "cosmossdk.io/math.LegacyDec" } },
      {
        no: 4,
        name: "resolve_time",
        kind: "scalar",
        T: 4,
        L: 0
        /*LongType.BIGINT*/
      },
      {
        no: 5,
        name: "request_id",
        kind: "scalar",
        T: 4,
        L: 0
        /*LongType.BIGINT*/
      },
      {
        no: 6,
        name: "client_id",
        kind: "scalar",
        T: 3,
        L: 0
        /*LongType.BIGINT*/
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.relayer = "";
    message.symbols = [];
    message.prices = [];
    message.resolveTime = 0n;
    message.requestId = 0n;
    message.clientId = 0n;
    if (value !== void 0)
      reflectionMergePartial(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* string relayer */
        1:
          message.relayer = reader.string();
          break;
        case /* repeated string symbols */
        2:
          message.symbols.push(reader.string());
          break;
        case /* repeated string prices */
        3:
          message.prices.push(reader.string());
          break;
        case /* uint64 resolve_time */
        4:
          message.resolveTime = reader.uint64().toBigInt();
          break;
        case /* uint64 request_id */
        5:
          message.requestId = reader.uint64().toBigInt();
          break;
        case /* int64 client_id */
        6:
          message.clientId = reader.int64().toBigInt();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.relayer !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.relayer);
    for (let i = 0; i < message.symbols.length; i++)
      writer.tag(2, WireType.LengthDelimited).string(message.symbols[i]);
    for (let i = 0; i < message.prices.length; i++)
      writer.tag(3, WireType.LengthDelimited).string(message.prices[i]);
    if (message.resolveTime !== 0n)
      writer.tag(4, WireType.Varint).uint64(message.resolveTime);
    if (message.requestId !== 0n)
      writer.tag(5, WireType.Varint).uint64(message.requestId);
    if (message.clientId !== 0n)
      writer.tag(6, WireType.Varint).int64(message.clientId);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
    return writer;
  }
}
const SetBandIBCPriceEvent = new SetBandIBCPriceEvent$Type();
class EventBandIBCAckSuccess$Type extends MessageType {
  constructor() {
    super("injective.oracle.v1beta1.EventBandIBCAckSuccess", [
      {
        no: 1,
        name: "ack_result",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 2,
        name: "client_id",
        kind: "scalar",
        T: 3,
        L: 0
        /*LongType.BIGINT*/
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.ackResult = "";
    message.clientId = 0n;
    if (value !== void 0)
      reflectionMergePartial(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* string ack_result */
        1:
          message.ackResult = reader.string();
          break;
        case /* int64 client_id */
        2:
          message.clientId = reader.int64().toBigInt();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.ackResult !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.ackResult);
    if (message.clientId !== 0n)
      writer.tag(2, WireType.Varint).int64(message.clientId);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
    return writer;
  }
}
const EventBandIBCAckSuccess = new EventBandIBCAckSuccess$Type();
class EventBandIBCAckError$Type extends MessageType {
  constructor() {
    super("injective.oracle.v1beta1.EventBandIBCAckError", [
      {
        no: 1,
        name: "ack_error",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 2,
        name: "client_id",
        kind: "scalar",
        T: 3,
        L: 0
        /*LongType.BIGINT*/
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.ackError = "";
    message.clientId = 0n;
    if (value !== void 0)
      reflectionMergePartial(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* string ack_error */
        1:
          message.ackError = reader.string();
          break;
        case /* int64 client_id */
        2:
          message.clientId = reader.int64().toBigInt();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.ackError !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.ackError);
    if (message.clientId !== 0n)
      writer.tag(2, WireType.Varint).int64(message.clientId);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
    return writer;
  }
}
const EventBandIBCAckError = new EventBandIBCAckError$Type();
class EventBandIBCResponseTimeout$Type extends MessageType {
  constructor() {
    super("injective.oracle.v1beta1.EventBandIBCResponseTimeout", [
      {
        no: 1,
        name: "client_id",
        kind: "scalar",
        T: 3,
        L: 0
        /*LongType.BIGINT*/
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.clientId = 0n;
    if (value !== void 0)
      reflectionMergePartial(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* int64 client_id */
        1:
          message.clientId = reader.int64().toBigInt();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.clientId !== 0n)
      writer.tag(1, WireType.Varint).int64(message.clientId);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
    return writer;
  }
}
const EventBandIBCResponseTimeout = new EventBandIBCResponseTimeout$Type();
class SetPriceFeedPriceEvent$Type extends MessageType {
  constructor() {
    super("injective.oracle.v1beta1.SetPriceFeedPriceEvent", [
      {
        no: 1,
        name: "relayer",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 2,
        name: "base",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 3,
        name: "quote",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      { no: 4, name: "price", kind: "scalar", T: 9, options: { "gogoproto.nullable": false, "gogoproto.customtype": "cosmossdk.io/math.LegacyDec" } }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.relayer = "";
    message.base = "";
    message.quote = "";
    message.price = "";
    if (value !== void 0)
      reflectionMergePartial(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* string relayer */
        1:
          message.relayer = reader.string();
          break;
        case /* string base */
        2:
          message.base = reader.string();
          break;
        case /* string quote */
        3:
          message.quote = reader.string();
          break;
        case /* string price */
        4:
          message.price = reader.string();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.relayer !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.relayer);
    if (message.base !== "")
      writer.tag(2, WireType.LengthDelimited).string(message.base);
    if (message.quote !== "")
      writer.tag(3, WireType.LengthDelimited).string(message.quote);
    if (message.price !== "")
      writer.tag(4, WireType.LengthDelimited).string(message.price);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
    return writer;
  }
}
const SetPriceFeedPriceEvent = new SetPriceFeedPriceEvent$Type();
class SetProviderPriceEvent$Type extends MessageType {
  constructor() {
    super("injective.oracle.v1beta1.SetProviderPriceEvent", [
      {
        no: 1,
        name: "provider",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 2,
        name: "relayer",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 3,
        name: "symbol",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      { no: 4, name: "price", kind: "scalar", T: 9, options: { "gogoproto.nullable": false, "gogoproto.customtype": "cosmossdk.io/math.LegacyDec" } }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.provider = "";
    message.relayer = "";
    message.symbol = "";
    message.price = "";
    if (value !== void 0)
      reflectionMergePartial(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* string provider */
        1:
          message.provider = reader.string();
          break;
        case /* string relayer */
        2:
          message.relayer = reader.string();
          break;
        case /* string symbol */
        3:
          message.symbol = reader.string();
          break;
        case /* string price */
        4:
          message.price = reader.string();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.provider !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.provider);
    if (message.relayer !== "")
      writer.tag(2, WireType.LengthDelimited).string(message.relayer);
    if (message.symbol !== "")
      writer.tag(3, WireType.LengthDelimited).string(message.symbol);
    if (message.price !== "")
      writer.tag(4, WireType.LengthDelimited).string(message.price);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
    return writer;
  }
}
const SetProviderPriceEvent = new SetProviderPriceEvent$Type();
class SetCoinbasePriceEvent$Type extends MessageType {
  constructor() {
    super("injective.oracle.v1beta1.SetCoinbasePriceEvent", [
      {
        no: 1,
        name: "symbol",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      { no: 2, name: "price", kind: "scalar", T: 9, options: { "gogoproto.nullable": false, "gogoproto.customtype": "cosmossdk.io/math.LegacyDec" } },
      {
        no: 3,
        name: "timestamp",
        kind: "scalar",
        T: 4,
        L: 0
        /*LongType.BIGINT*/
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.symbol = "";
    message.price = "";
    message.timestamp = 0n;
    if (value !== void 0)
      reflectionMergePartial(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* string symbol */
        1:
          message.symbol = reader.string();
          break;
        case /* string price */
        2:
          message.price = reader.string();
          break;
        case /* uint64 timestamp */
        3:
          message.timestamp = reader.uint64().toBigInt();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.symbol !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.symbol);
    if (message.price !== "")
      writer.tag(2, WireType.LengthDelimited).string(message.price);
    if (message.timestamp !== 0n)
      writer.tag(3, WireType.Varint).uint64(message.timestamp);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
    return writer;
  }
}
const SetCoinbasePriceEvent = new SetCoinbasePriceEvent$Type();
class EventSetStorkPrices$Type extends MessageType {
  constructor() {
    super("injective.oracle.v1beta1.EventSetStorkPrices", [
      { no: 1, name: "prices", kind: "message", repeat: 2, T: () => StorkPriceState }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.prices = [];
    if (value !== void 0)
      reflectionMergePartial(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* repeated injective.oracle.v1beta1.StorkPriceState prices */
        1:
          message.prices.push(StorkPriceState.internalBinaryRead(reader, reader.uint32(), options));
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    for (let i = 0; i < message.prices.length; i++)
      StorkPriceState.internalBinaryWrite(message.prices[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
    return writer;
  }
}
const EventSetStorkPrices = new EventSetStorkPrices$Type();
class EventSetPythPrices$Type extends MessageType {
  constructor() {
    super("injective.oracle.v1beta1.EventSetPythPrices", [
      { no: 1, name: "prices", kind: "message", repeat: 2, T: () => PythPriceState }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.prices = [];
    if (value !== void 0)
      reflectionMergePartial(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* repeated injective.oracle.v1beta1.PythPriceState prices */
        1:
          message.prices.push(PythPriceState.internalBinaryRead(reader, reader.uint32(), options));
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    for (let i = 0; i < message.prices.length; i++)
      PythPriceState.internalBinaryWrite(message.prices[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
    return writer;
  }
}
const EventSetPythPrices = new EventSetPythPrices$Type();
class EventSetChainlinkDataStreamsPrices$Type extends MessageType {
  constructor() {
    super("injective.oracle.v1beta1.EventSetChainlinkDataStreamsPrices", [
      { no: 1, name: "prices", kind: "message", repeat: 2, T: () => ChainlinkDataStreamsPriceState }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.prices = [];
    if (value !== void 0)
      reflectionMergePartial(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* repeated injective.oracle.v1beta1.ChainlinkDataStreamsPriceState prices */
        1:
          message.prices.push(ChainlinkDataStreamsPriceState.internalBinaryRead(reader, reader.uint32(), options));
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    for (let i = 0; i < message.prices.length; i++)
      ChainlinkDataStreamsPriceState.internalBinaryWrite(message.prices[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
    return writer;
  }
}
const EventSetChainlinkDataStreamsPrices = new EventSetChainlinkDataStreamsPrices$Type();
class EventOraclePriceUpdate$Type extends MessageType {
  constructor() {
    super("injective.oracle.v1beta1.EventOraclePriceUpdate", [
      { no: 1, name: "oracle_type", kind: "enum", T: () => ["injective.oracle.v1beta1.OracleType", OracleType] },
      {
        no: 2,
        name: "id",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      { no: 3, name: "price_state", kind: "message", T: () => PriceState, options: { "gogoproto.nullable": false } }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.oracleType = 0;
    message.id = "";
    if (value !== void 0)
      reflectionMergePartial(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* injective.oracle.v1beta1.OracleType oracle_type */
        1:
          message.oracleType = reader.int32();
          break;
        case /* string id */
        2:
          message.id = reader.string();
          break;
        case /* injective.oracle.v1beta1.PriceState price_state */
        3:
          message.priceState = PriceState.internalBinaryRead(reader, reader.uint32(), options, message.priceState);
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.oracleType !== 0)
      writer.tag(1, WireType.Varint).int32(message.oracleType);
    if (message.id !== "")
      writer.tag(2, WireType.LengthDelimited).string(message.id);
    if (message.priceState)
      PriceState.internalBinaryWrite(message.priceState, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
    return writer;
  }
}
const EventOraclePriceUpdate = new EventOraclePriceUpdate$Type();
export {
  EventBandIBCAckError,
  EventBandIBCAckSuccess,
  EventBandIBCResponseTimeout,
  EventOraclePriceUpdate,
  EventSetChainlinkDataStreamsPrices,
  EventSetPythPrices,
  EventSetStorkPrices,
  SetBandIBCPriceEvent,
  SetBandPriceEvent,
  SetChainlinkPriceEvent,
  SetCoinbasePriceEvent,
  SetPriceFeedPriceEvent,
  SetProviderPriceEvent
};
