// @generated by protobuf-ts 2.11.1 with parameter add_pb_suffix
// @generated from protobuf file "injective/permissions/v1beta1/events.proto" (package "injective.permissions.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";
/**
 * @generated from protobuf message injective.permissions.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 EventSetVoucher$Type extends MessageType<EventSetVoucher> {
    constructor() {
        super("injective.permissions.v1beta1.EventSetVoucher", [
            { no: 1, name: "addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "voucher", kind: "message", T: () => Coin, options: { "gogoproto.nullable": false } }
        ]);
    }
    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.permissions.v1beta1.EventSetVoucher
 */
export const EventSetVoucher = new EventSetVoucher$Type();
