// @generated by protobuf-ts 2.11.1 with parameter add_pb_suffix
// @generated from protobuf file "injective/common/vouchers/v1/vouchers.proto" (package "injective.common.vouchers.v1", 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";
/**
 * AddressVoucher pairs a bech32 address with its outstanding voucher coin.
 *
 * @generated from protobuf message injective.common.vouchers.v1.AddressVoucher
 */
export interface AddressVoucher {
    /**
     * The bech32 address of the voucher holder.
     *
     * @generated from protobuf field: string address = 1
     */
    address: string;
    /**
     * The outstanding voucher coin.
     *
     * @generated from protobuf field: cosmos.base.v1beta1.Coin voucher = 2
     */
    voucher?: Coin;
}
// @generated message type with reflection information, may provide speed optimized methods
class AddressVoucher$Type extends MessageType<AddressVoucher> {
    constructor() {
        super("injective.common.vouchers.v1.AddressVoucher", [
            { no: 1, name: "address", 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<AddressVoucher>): AddressVoucher {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.address = "";
        if (value !== undefined)
            reflectionMergePartial<AddressVoucher>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AddressVoucher): AddressVoucher {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string address */ 1:
                    message.address = 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: AddressVoucher, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string address = 1; */
        if (message.address !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.address);
        /* 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.common.vouchers.v1.AddressVoucher
 */
export const AddressVoucher = new AddressVoucher$Type();
