// @generated by protobuf-ts 2.11.1 with parameter add_pb_suffix
// @generated from protobuf file "injective/insurance/v1beta1/insurance.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 { Timestamp } from "../../../google/protobuf/timestamp_pb";
import { OracleType } from "../../oracle/v1beta1/oracle_pb";
import { Duration } from "../../../google/protobuf/duration_pb";
/**
 * @generated from protobuf message injective.insurance.v1beta1.Params
 */
export interface Params {
    /**
     * default_redemption_notice_period_duration defines the default minimum
     * notice period duration that must pass after an underwriter sends a
     * redemption request before the underwriter can claim his tokens
     *
     * @generated from protobuf field: google.protobuf.Duration default_redemption_notice_period_duration = 1
     */
    defaultRedemptionNoticePeriodDuration?: Duration;
}
/**
 * @generated from protobuf message injective.insurance.v1beta1.InsuranceFund
 */
export interface InsuranceFund {
    /**
     * deposit denomination for the given insurance fund
     *
     * @generated from protobuf field: string deposit_denom = 1
     */
    depositDenom: string;
    /**
     * insurance fund pool token denomination for the given insurance fund
     *
     * @generated from protobuf field: string insurance_pool_token_denom = 2
     */
    insurancePoolTokenDenom: string;
    /**
     * redemption_notice_period_duration defines the minimum notice period
     * duration that must pass after an underwriter sends a redemption request
     * before the underwriter can claim his tokens
     *
     * @generated from protobuf field: google.protobuf.Duration redemption_notice_period_duration = 3
     */
    redemptionNoticePeriodDuration?: Duration;
    /**
     * balance of fund
     *
     * @generated from protobuf field: string balance = 4
     */
    balance: string;
    /**
     * total share tokens minted
     *
     * @generated from protobuf field: string total_share = 5
     */
    totalShare: string;
    /**
     * marketID of the derivative market
     *
     * @generated from protobuf field: string market_id = 6
     */
    marketId: string;
    /**
     * ticker of the derivative market
     *
     * @generated from protobuf field: string market_ticker = 7
     */
    marketTicker: string;
    /**
     * Oracle base currency of the derivative market OR the oracle symbol for the
     * binary options market.
     *
     * @generated from protobuf field: string oracle_base = 8
     */
    oracleBase: string;
    /**
     * Oracle quote currency of the derivative market OR the oracle provider for
     * the binary options market.
     *
     * @generated from protobuf field: string oracle_quote = 9
     */
    oracleQuote: string;
    /**
     * Oracle type of the binary options or derivative market
     *
     * @generated from protobuf field: injective.oracle.v1beta1.OracleType oracle_type = 10
     */
    oracleType: OracleType;
    /**
     * Expiration time of the derivative market. Should be -1 for perpetual or -2
     * for binary options markets.
     *
     * @generated from protobuf field: int64 expiry = 11
     */
    expiry: bigint;
}
/**
 * @generated from protobuf message injective.insurance.v1beta1.RedemptionSchedule
 */
export interface RedemptionSchedule {
    /**
     * id of redemption schedule
     *
     * @generated from protobuf field: uint64 id = 1
     */
    id: bigint;
    /**
     * marketId of insurance fund for the redemption
     *
     * @generated from protobuf field: string marketId = 2
     */
    marketId: string;
    /**
     * address of the redeemer
     *
     * @generated from protobuf field: string redeemer = 3
     */
    redeemer: string;
    /**
     * the time after which the redemption can be claimed
     *
     * @generated from protobuf field: google.protobuf.Timestamp claimable_redemption_time = 4
     */
    claimableRedemptionTime?: Timestamp;
    /**
     * the insurance_pool_token amount to redeem
     *
     * @generated from protobuf field: cosmos.base.v1beta1.Coin redemption_amount = 5
     */
    redemptionAmount?: Coin;
}
/**
 * @generated from protobuf message injective.insurance.v1beta1.FailedRedemptionSchedule
 */
export interface FailedRedemptionSchedule {
    /**
     * id of the failed redemption
     *
     * @generated from protobuf field: uint64 id = 1
     */
    id: bigint;
    /**
     * the original redemption schedule that failed to execute
     *
     * @generated from protobuf field: injective.insurance.v1beta1.RedemptionSchedule schedule = 2
     */
    schedule?: RedemptionSchedule;
    /**
     * the error message from the failed withdrawal attempt
     *
     * @generated from protobuf field: string err = 3
     */
    err: string;
}
// @generated message type with reflection information, may provide speed optimized methods
class Params$Type extends MessageType<Params> {
    constructor() {
        super("injective.insurance.v1beta1.Params", [
            { no: 1, name: "default_redemption_notice_period_duration", kind: "message", T: () => Duration, options: { "gogoproto.nullable": false, "gogoproto.moretags": "yaml:\"default_redemption_notice_period_duration\"", "gogoproto.stdduration": true } }
        ], { "gogoproto.equal": true, "amino.name": "insurance/Params" });
    }
    create(value?: PartialMessage<Params>): Params {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<Params>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Params): Params {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* google.protobuf.Duration default_redemption_notice_period_duration */ 1:
                    message.defaultRedemptionNoticePeriodDuration = Duration.internalBinaryRead(reader, reader.uint32(), options, message.defaultRedemptionNoticePeriodDuration);
                    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: Params, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* google.protobuf.Duration default_redemption_notice_period_duration = 1; */
        if (message.defaultRedemptionNoticePeriodDuration)
            Duration.internalBinaryWrite(message.defaultRedemptionNoticePeriodDuration, 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.Params
 */
export const Params = new Params$Type();
// @generated message type with reflection information, may provide speed optimized methods
class InsuranceFund$Type extends MessageType<InsuranceFund> {
    constructor() {
        super("injective.insurance.v1beta1.InsuranceFund", [
            { no: 1, name: "deposit_denom", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "insurance_pool_token_denom", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "redemption_notice_period_duration", kind: "message", T: () => Duration, options: { "gogoproto.nullable": false, "gogoproto.moretags": "yaml:\"redemption_notice_period_duration\"", "gogoproto.stdduration": true } },
            { no: 4, name: "balance", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "gogoproto.nullable": false, "gogoproto.customtype": "cosmossdk.io/math.Int" } },
            { no: 5, name: "total_share", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "gogoproto.nullable": false, "gogoproto.customtype": "cosmossdk.io/math.Int" } },
            { no: 6, name: "market_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 7, name: "market_ticker", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 8, name: "oracle_base", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 9, name: "oracle_quote", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 10, name: "oracle_type", kind: "enum", T: () => ["injective.oracle.v1beta1.OracleType", OracleType] },
            { no: 11, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
        ]);
    }
    create(value?: PartialMessage<InsuranceFund>): InsuranceFund {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.depositDenom = "";
        message.insurancePoolTokenDenom = "";
        message.balance = "";
        message.totalShare = "";
        message.marketId = "";
        message.marketTicker = "";
        message.oracleBase = "";
        message.oracleQuote = "";
        message.oracleType = 0;
        message.expiry = 0n;
        if (value !== undefined)
            reflectionMergePartial<InsuranceFund>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InsuranceFund): InsuranceFund {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string deposit_denom */ 1:
                    message.depositDenom = reader.string();
                    break;
                case /* string insurance_pool_token_denom */ 2:
                    message.insurancePoolTokenDenom = reader.string();
                    break;
                case /* google.protobuf.Duration redemption_notice_period_duration */ 3:
                    message.redemptionNoticePeriodDuration = Duration.internalBinaryRead(reader, reader.uint32(), options, message.redemptionNoticePeriodDuration);
                    break;
                case /* string balance */ 4:
                    message.balance = reader.string();
                    break;
                case /* string total_share */ 5:
                    message.totalShare = reader.string();
                    break;
                case /* string market_id */ 6:
                    message.marketId = reader.string();
                    break;
                case /* string market_ticker */ 7:
                    message.marketTicker = reader.string();
                    break;
                case /* string oracle_base */ 8:
                    message.oracleBase = reader.string();
                    break;
                case /* string oracle_quote */ 9:
                    message.oracleQuote = reader.string();
                    break;
                case /* injective.oracle.v1beta1.OracleType oracle_type */ 10:
                    message.oracleType = reader.int32();
                    break;
                case /* int64 expiry */ 11:
                    message.expiry = 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: InsuranceFund, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string deposit_denom = 1; */
        if (message.depositDenom !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.depositDenom);
        /* string insurance_pool_token_denom = 2; */
        if (message.insurancePoolTokenDenom !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.insurancePoolTokenDenom);
        /* google.protobuf.Duration redemption_notice_period_duration = 3; */
        if (message.redemptionNoticePeriodDuration)
            Duration.internalBinaryWrite(message.redemptionNoticePeriodDuration, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        /* string balance = 4; */
        if (message.balance !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.balance);
        /* string total_share = 5; */
        if (message.totalShare !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.totalShare);
        /* string market_id = 6; */
        if (message.marketId !== "")
            writer.tag(6, WireType.LengthDelimited).string(message.marketId);
        /* string market_ticker = 7; */
        if (message.marketTicker !== "")
            writer.tag(7, WireType.LengthDelimited).string(message.marketTicker);
        /* string oracle_base = 8; */
        if (message.oracleBase !== "")
            writer.tag(8, WireType.LengthDelimited).string(message.oracleBase);
        /* string oracle_quote = 9; */
        if (message.oracleQuote !== "")
            writer.tag(9, WireType.LengthDelimited).string(message.oracleQuote);
        /* injective.oracle.v1beta1.OracleType oracle_type = 10; */
        if (message.oracleType !== 0)
            writer.tag(10, WireType.Varint).int32(message.oracleType);
        /* int64 expiry = 11; */
        if (message.expiry !== 0n)
            writer.tag(11, WireType.Varint).int64(message.expiry);
        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.InsuranceFund
 */
export const InsuranceFund = new InsuranceFund$Type();
// @generated message type with reflection information, may provide speed optimized methods
class RedemptionSchedule$Type extends MessageType<RedemptionSchedule> {
    constructor() {
        super("injective.insurance.v1beta1.RedemptionSchedule", [
            { no: 1, name: "id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
            { no: 2, name: "marketId", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "redeemer", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "claimable_redemption_time", kind: "message", T: () => Timestamp, options: { "gogoproto.nullable": false, "gogoproto.moretags": "yaml:\"claimable_redemption_time\"", "gogoproto.stdtime": true } },
            { no: 5, name: "redemption_amount", kind: "message", T: () => Coin, options: { "gogoproto.nullable": false } }
        ]);
    }
    create(value?: PartialMessage<RedemptionSchedule>): RedemptionSchedule {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.id = 0n;
        message.marketId = "";
        message.redeemer = "";
        if (value !== undefined)
            reflectionMergePartial<RedemptionSchedule>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RedemptionSchedule): RedemptionSchedule {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* uint64 id */ 1:
                    message.id = reader.uint64().toBigInt();
                    break;
                case /* string marketId */ 2:
                    message.marketId = reader.string();
                    break;
                case /* string redeemer */ 3:
                    message.redeemer = reader.string();
                    break;
                case /* google.protobuf.Timestamp claimable_redemption_time */ 4:
                    message.claimableRedemptionTime = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.claimableRedemptionTime);
                    break;
                case /* cosmos.base.v1beta1.Coin redemption_amount */ 5:
                    message.redemptionAmount = Coin.internalBinaryRead(reader, reader.uint32(), options, message.redemptionAmount);
                    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: RedemptionSchedule, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* uint64 id = 1; */
        if (message.id !== 0n)
            writer.tag(1, WireType.Varint).uint64(message.id);
        /* string marketId = 2; */
        if (message.marketId !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.marketId);
        /* string redeemer = 3; */
        if (message.redeemer !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.redeemer);
        /* google.protobuf.Timestamp claimable_redemption_time = 4; */
        if (message.claimableRedemptionTime)
            Timestamp.internalBinaryWrite(message.claimableRedemptionTime, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* cosmos.base.v1beta1.Coin redemption_amount = 5; */
        if (message.redemptionAmount)
            Coin.internalBinaryWrite(message.redemptionAmount, writer.tag(5, 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.RedemptionSchedule
 */
export const RedemptionSchedule = new RedemptionSchedule$Type();
// @generated message type with reflection information, may provide speed optimized methods
class FailedRedemptionSchedule$Type extends MessageType<FailedRedemptionSchedule> {
    constructor() {
        super("injective.insurance.v1beta1.FailedRedemptionSchedule", [
            { no: 1, name: "id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
            { no: 2, name: "schedule", kind: "message", T: () => RedemptionSchedule, options: { "gogoproto.nullable": false } },
            { no: 3, name: "err", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<FailedRedemptionSchedule>): FailedRedemptionSchedule {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.id = 0n;
        message.err = "";
        if (value !== undefined)
            reflectionMergePartial<FailedRedemptionSchedule>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FailedRedemptionSchedule): FailedRedemptionSchedule {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* uint64 id */ 1:
                    message.id = reader.uint64().toBigInt();
                    break;
                case /* injective.insurance.v1beta1.RedemptionSchedule schedule */ 2:
                    message.schedule = RedemptionSchedule.internalBinaryRead(reader, reader.uint32(), options, message.schedule);
                    break;
                case /* string err */ 3:
                    message.err = 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: FailedRedemptionSchedule, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* uint64 id = 1; */
        if (message.id !== 0n)
            writer.tag(1, WireType.Varint).uint64(message.id);
        /* injective.insurance.v1beta1.RedemptionSchedule schedule = 2; */
        if (message.schedule)
            RedemptionSchedule.internalBinaryWrite(message.schedule, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        /* string err = 3; */
        if (message.err !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.err);
        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.FailedRedemptionSchedule
 */
export const FailedRedemptionSchedule = new FailedRedemptionSchedule$Type();
