// @generated by protobuf-ts 2.11.1 with parameter add_pb_suffix
// @generated from protobuf file "injective/insurance/v1beta1/events.proto" (package "injective.insurance.v1beta1", syntax proto3)
// tslint:disable
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import { WireType } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import type { PartialMessage } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { Coin } from "../../../cosmos/base/v1beta1/coin_pb";
import { RedemptionSchedule } from "./insurance_pb";
import { InsuranceFund } from "./insurance_pb";
/**
 * @generated from protobuf message injective.insurance.v1beta1.EventInsuranceFundUpdate
 */
export interface EventInsuranceFundUpdate {
    /**
     * @generated from protobuf field: injective.insurance.v1beta1.InsuranceFund fund = 1
     */
    fund?: InsuranceFund;
}
/**
 * @generated from protobuf message injective.insurance.v1beta1.EventRequestRedemption
 */
export interface EventRequestRedemption {
    /**
     * @generated from protobuf field: injective.insurance.v1beta1.RedemptionSchedule schedule = 1
     */
    schedule?: RedemptionSchedule;
}
/**
 * @generated from protobuf message injective.insurance.v1beta1.EventWithdrawRedemption
 */
export interface EventWithdrawRedemption {
    /**
     * redemption schedule triggered withdraw
     *
     * @generated from protobuf field: injective.insurance.v1beta1.RedemptionSchedule schedule = 1
     */
    schedule?: RedemptionSchedule;
    /**
     * redeem coin amount in base_currency
     *
     * @generated from protobuf field: cosmos.base.v1beta1.Coin redeem_coin = 2
     */
    redeemCoin?: Coin;
}
/**
 * @generated from protobuf message injective.insurance.v1beta1.EventWithdrawRedemptionFailed
 */
export interface EventWithdrawRedemptionFailed {
    /**
     * redemption schedule that failed to withdraw
     *
     * @generated from protobuf field: injective.insurance.v1beta1.RedemptionSchedule schedule = 1
     */
    schedule?: RedemptionSchedule;
    /**
     * error produced while processing the redemption withdrawal
     *
     * @generated from protobuf field: string withdraw_err = 2
     */
    withdrawErr: string;
}
/**
 * @generated from protobuf message injective.insurance.v1beta1.EventUnderwrite
 */
export interface EventUnderwrite {
    /**
     * address of the underwriter
     *
     * @generated from protobuf field: string underwriter = 1
     */
    underwriter: string;
    /**
     * marketId of insurance fund for the redemption
     *
     * @generated from protobuf field: string marketId = 2
     */
    marketId: string;
    /**
     * deposit coin amount
     *
     * @generated from protobuf field: cosmos.base.v1beta1.Coin deposit = 3
     */
    deposit?: Coin;
    /**
     * share coin amount
     *
     * @generated from protobuf field: cosmos.base.v1beta1.Coin shares = 4
     */
    shares?: Coin;
}
/**
 * @generated from protobuf message injective.insurance.v1beta1.EventInsuranceWithdraw
 */
export interface EventInsuranceWithdraw {
    /**
     * @generated from protobuf field: string market_id = 1
     */
    marketId: string;
    /**
     * @generated from protobuf field: string market_ticker = 2
     */
    marketTicker: string;
    /**
     * @generated from protobuf field: cosmos.base.v1beta1.Coin withdrawal = 3
     */
    withdrawal?: Coin;
}
/**
 * @generated from protobuf message injective.insurance.v1beta1.EventSetVoucher
 */
export interface EventSetVoucher {
    /**
     * The bech32 address of the voucher holder.
     *
     * @generated from protobuf field: string addr = 1
     */
    addr: string;
    /**
     * The new voucher amount. A zero coin signals voucher deletion.
     *
     * @generated from protobuf field: cosmos.base.v1beta1.Coin voucher = 2
     */
    voucher?: Coin;
}
// @generated message type with reflection information, may provide speed optimized methods
class EventInsuranceFundUpdate$Type extends MessageType<EventInsuranceFundUpdate> {
    constructor() {
        super("injective.insurance.v1beta1.EventInsuranceFundUpdate", [
            { no: 1, name: "fund", kind: "message", T: () => InsuranceFund }
        ]);
    }
    create(value?: PartialMessage<EventInsuranceFundUpdate>): EventInsuranceFundUpdate {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<EventInsuranceFundUpdate>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EventInsuranceFundUpdate): EventInsuranceFundUpdate {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* injective.insurance.v1beta1.InsuranceFund fund */ 1:
                    message.fund = InsuranceFund.internalBinaryRead(reader, reader.uint32(), options, message.fund);
                    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: EventInsuranceFundUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* injective.insurance.v1beta1.InsuranceFund fund = 1; */
        if (message.fund)
            InsuranceFund.internalBinaryWrite(message.fund, 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;
    }
}
/**
 * @generated MessageType for protobuf message injective.insurance.v1beta1.EventInsuranceFundUpdate
 */
export const EventInsuranceFundUpdate = new EventInsuranceFundUpdate$Type();
// @generated message type with reflection information, may provide speed optimized methods
class EventRequestRedemption$Type extends MessageType<EventRequestRedemption> {
    constructor() {
        super("injective.insurance.v1beta1.EventRequestRedemption", [
            { no: 1, name: "schedule", kind: "message", T: () => RedemptionSchedule }
        ]);
    }
    create(value?: PartialMessage<EventRequestRedemption>): EventRequestRedemption {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<EventRequestRedemption>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EventRequestRedemption): EventRequestRedemption {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* injective.insurance.v1beta1.RedemptionSchedule schedule */ 1:
                    message.schedule = RedemptionSchedule.internalBinaryRead(reader, reader.uint32(), options, message.schedule);
                    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: EventRequestRedemption, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* injective.insurance.v1beta1.RedemptionSchedule schedule = 1; */
        if (message.schedule)
            RedemptionSchedule.internalBinaryWrite(message.schedule, 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;
    }
}
/**
 * @generated MessageType for protobuf message injective.insurance.v1beta1.EventRequestRedemption
 */
export const EventRequestRedemption = new EventRequestRedemption$Type();
// @generated message type with reflection information, may provide speed optimized methods
class EventWithdrawRedemption$Type extends MessageType<EventWithdrawRedemption> {
    constructor() {
        super("injective.insurance.v1beta1.EventWithdrawRedemption", [
            { no: 1, name: "schedule", kind: "message", T: () => RedemptionSchedule },
            { no: 2, name: "redeem_coin", kind: "message", T: () => Coin, options: { "gogoproto.nullable": false } }
        ]);
    }
    create(value?: PartialMessage<EventWithdrawRedemption>): EventWithdrawRedemption {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<EventWithdrawRedemption>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EventWithdrawRedemption): EventWithdrawRedemption {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* injective.insurance.v1beta1.RedemptionSchedule schedule */ 1:
                    message.schedule = RedemptionSchedule.internalBinaryRead(reader, reader.uint32(), options, message.schedule);
                    break;
                case /* cosmos.base.v1beta1.Coin redeem_coin */ 2:
                    message.redeemCoin = Coin.internalBinaryRead(reader, reader.uint32(), options, message.redeemCoin);
                    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: EventWithdrawRedemption, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* injective.insurance.v1beta1.RedemptionSchedule schedule = 1; */
        if (message.schedule)
            RedemptionSchedule.internalBinaryWrite(message.schedule, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* cosmos.base.v1beta1.Coin redeem_coin = 2; */
        if (message.redeemCoin)
            Coin.internalBinaryWrite(message.redeemCoin, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message injective.insurance.v1beta1.EventWithdrawRedemption
 */
export const EventWithdrawRedemption = new EventWithdrawRedemption$Type();
// @generated message type with reflection information, may provide speed optimized methods
class EventWithdrawRedemptionFailed$Type extends MessageType<EventWithdrawRedemptionFailed> {
    constructor() {
        super("injective.insurance.v1beta1.EventWithdrawRedemptionFailed", [
            { no: 1, name: "schedule", kind: "message", T: () => RedemptionSchedule },
            { no: 2, name: "withdraw_err", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<EventWithdrawRedemptionFailed>): EventWithdrawRedemptionFailed {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.withdrawErr = "";
        if (value !== undefined)
            reflectionMergePartial<EventWithdrawRedemptionFailed>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EventWithdrawRedemptionFailed): EventWithdrawRedemptionFailed {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* injective.insurance.v1beta1.RedemptionSchedule schedule */ 1:
                    message.schedule = RedemptionSchedule.internalBinaryRead(reader, reader.uint32(), options, message.schedule);
                    break;
                case /* string withdraw_err */ 2:
                    message.withdrawErr = 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: EventWithdrawRedemptionFailed, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* injective.insurance.v1beta1.RedemptionSchedule schedule = 1; */
        if (message.schedule)
            RedemptionSchedule.internalBinaryWrite(message.schedule, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* string withdraw_err = 2; */
        if (message.withdrawErr !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.withdrawErr);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message injective.insurance.v1beta1.EventWithdrawRedemptionFailed
 */
export const EventWithdrawRedemptionFailed = new EventWithdrawRedemptionFailed$Type();
// @generated message type with reflection information, may provide speed optimized methods
class EventUnderwrite$Type extends MessageType<EventUnderwrite> {
    constructor() {
        super("injective.insurance.v1beta1.EventUnderwrite", [
            { no: 1, name: "underwriter", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "marketId", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "deposit", kind: "message", T: () => Coin, options: { "gogoproto.nullable": false } },
            { no: 4, name: "shares", kind: "message", T: () => Coin, options: { "gogoproto.nullable": false } }
        ]);
    }
    create(value?: PartialMessage<EventUnderwrite>): EventUnderwrite {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.underwriter = "";
        message.marketId = "";
        if (value !== undefined)
            reflectionMergePartial<EventUnderwrite>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EventUnderwrite): EventUnderwrite {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string underwriter */ 1:
                    message.underwriter = reader.string();
                    break;
                case /* string marketId */ 2:
                    message.marketId = reader.string();
                    break;
                case /* cosmos.base.v1beta1.Coin deposit */ 3:
                    message.deposit = Coin.internalBinaryRead(reader, reader.uint32(), options, message.deposit);
                    break;
                case /* cosmos.base.v1beta1.Coin shares */ 4:
                    message.shares = Coin.internalBinaryRead(reader, reader.uint32(), options, message.shares);
                    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: EventUnderwrite, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string underwriter = 1; */
        if (message.underwriter !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.underwriter);
        /* string marketId = 2; */
        if (message.marketId !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.marketId);
        /* cosmos.base.v1beta1.Coin deposit = 3; */
        if (message.deposit)
            Coin.internalBinaryWrite(message.deposit, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        /* cosmos.base.v1beta1.Coin shares = 4; */
        if (message.shares)
            Coin.internalBinaryWrite(message.shares, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message injective.insurance.v1beta1.EventUnderwrite
 */
export const EventUnderwrite = new EventUnderwrite$Type();
// @generated message type with reflection information, may provide speed optimized methods
class EventInsuranceWithdraw$Type extends MessageType<EventInsuranceWithdraw> {
    constructor() {
        super("injective.insurance.v1beta1.EventInsuranceWithdraw", [
            { no: 1, name: "market_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "market_ticker", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "withdrawal", kind: "message", T: () => Coin, options: { "gogoproto.nullable": false } }
        ]);
    }
    create(value?: PartialMessage<EventInsuranceWithdraw>): EventInsuranceWithdraw {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.marketId = "";
        message.marketTicker = "";
        if (value !== undefined)
            reflectionMergePartial<EventInsuranceWithdraw>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EventInsuranceWithdraw): EventInsuranceWithdraw {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string market_id */ 1:
                    message.marketId = reader.string();
                    break;
                case /* string market_ticker */ 2:
                    message.marketTicker = reader.string();
                    break;
                case /* cosmos.base.v1beta1.Coin withdrawal */ 3:
                    message.withdrawal = Coin.internalBinaryRead(reader, reader.uint32(), options, message.withdrawal);
                    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: EventInsuranceWithdraw, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string market_id = 1; */
        if (message.marketId !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.marketId);
        /* string market_ticker = 2; */
        if (message.marketTicker !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.marketTicker);
        /* cosmos.base.v1beta1.Coin withdrawal = 3; */
        if (message.withdrawal)
            Coin.internalBinaryWrite(message.withdrawal, 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;
    }
}
/**
 * @generated MessageType for protobuf message injective.insurance.v1beta1.EventInsuranceWithdraw
 */
export const EventInsuranceWithdraw = new EventInsuranceWithdraw$Type();
// @generated message type with reflection information, may provide speed optimized methods
class EventSetVoucher$Type extends MessageType<EventSetVoucher> {
    constructor() {
        super("injective.insurance.v1beta1.EventSetVoucher", [
            { no: 1, name: "addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "voucher", kind: "message", T: () => Coin, options: { "gogoproto.nullable": false, "gogoproto.customtype": "github.com/cosmos/cosmos-sdk/types.Coin" } }
        ]);
    }
    create(value?: PartialMessage<EventSetVoucher>): EventSetVoucher {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.addr = "";
        if (value !== undefined)
            reflectionMergePartial<EventSetVoucher>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EventSetVoucher): EventSetVoucher {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string addr */ 1:
                    message.addr = reader.string();
                    break;
                case /* cosmos.base.v1beta1.Coin voucher */ 2:
                    message.voucher = Coin.internalBinaryRead(reader, reader.uint32(), options, message.voucher);
                    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: EventSetVoucher, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string addr = 1; */
        if (message.addr !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.addr);
        /* cosmos.base.v1beta1.Coin voucher = 2; */
        if (message.voucher)
            Coin.internalBinaryWrite(message.voucher, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message injective.insurance.v1beta1.EventSetVoucher
 */
export const EventSetVoucher = new EventSetVoucher$Type();
