// @generated by protobuf-ts 2.11.1 with parameter add_pb_suffix
// @generated from protobuf file "injective/permissions/v1beta1/query.proto" (package "injective.permissions.v1beta1", syntax proto3)
// tslint:disable
import { ServiceType } from "@protobuf-ts/runtime-rpc";
import { WireType } from "@protobuf-ts/runtime";
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } 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 { GenesisState } from "./genesis_pb";
import { Coin } from "../../../cosmos/base/v1beta1/coin_pb";
import { AddressVoucher } from "../../common/vouchers/v1/vouchers_pb";
import { PolicyManagerCapability } from "./permissions_pb";
import { PolicyStatus } from "./permissions_pb";
import { RoleManager } from "./permissions_pb";
import { Namespace } from "./permissions_pb";
import { Params } from "./params_pb";
/**
 * QueryParamsRequest is the request type for the Query/Params RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryParamsRequest
 */
export interface QueryParamsRequest {
}
/**
 * QueryParamsResponse is the response type for the Query/Params RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryParamsResponse
 */
export interface QueryParamsResponse {
    /**
     * params defines the parameters of the module.
     *
     * @generated from protobuf field: injective.permissions.v1beta1.Params params = 1
     */
    params?: Params;
}
/**
 * QueryNamespaceDenomsRequest is the request type for the Query/NamespaceDenoms
 * RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryNamespaceDenomsRequest
 */
export interface QueryNamespaceDenomsRequest {
}
/**
 * QueryNamespaceDenomsResponse is the response type for the
 * Query/NamespaceDenoms RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryNamespaceDenomsResponse
 */
export interface QueryNamespaceDenomsResponse {
    /**
     * List of denoms
     *
     * @generated from protobuf field: repeated string denoms = 1
     */
    denoms: string[];
}
/**
 * QueryNamespacesRequest is the request type for the Query/Namespaces RPC
 * method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryNamespacesRequest
 */
export interface QueryNamespacesRequest {
}
/**
 * QueryNamespacesResponse is the response type for the Query/Namespaces
 * RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryNamespacesResponse
 */
export interface QueryNamespacesResponse {
    /**
     * List of namespaces
     *
     * @generated from protobuf field: repeated injective.permissions.v1beta1.Namespace namespaces = 1
     */
    namespaces: Namespace[];
}
/**
 * QueryNamespaceRequest is the request type for the
 * Query/Namespace RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryNamespaceRequest
 */
export interface QueryNamespaceRequest {
    /**
     * The token denom
     *
     * @generated from protobuf field: string denom = 1
     */
    denom: string;
}
/**
 * QueryNamespaceResponse is the response type for the
 * Query/NamespaceByDenom RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryNamespaceResponse
 */
export interface QueryNamespaceResponse {
    /**
     * The namespace details
     *
     * @generated from protobuf field: injective.permissions.v1beta1.Namespace namespace = 1
     */
    namespace?: Namespace;
}
/**
 * QueryAddressesByRoleRequest is the request type for the Query/AddressesByRole
 * RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryActorsByRoleRequest
 */
export interface QueryActorsByRoleRequest {
    /**
     * The token denom
     *
     * @generated from protobuf field: string denom = 1
     */
    denom: string;
    /**
     * The role to query actors for
     *
     * @generated from protobuf field: string role = 2
     */
    role: string;
}
/**
 * QueryAddressesByRoleResponse is the response type for the
 * Query/AddressesByRole RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryActorsByRoleResponse
 */
export interface QueryActorsByRoleResponse {
    /**
     * List of actors' Injective addresses
     *
     * @generated from protobuf field: repeated string actors = 1
     */
    actors: string[];
}
/**
 * QueryRolesByActorRequest is the request type for the
 * Query/RolesByActor RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryRolesByActorRequest
 */
export interface QueryRolesByActorRequest {
    /**
     * The token denom
     *
     * @generated from protobuf field: string denom = 1
     */
    denom: string;
    /**
     * The actor's Injective address
     *
     * @generated from protobuf field: string actor = 2
     */
    actor: string;
}
/**
 * QueryRolesByActorResponse is the response type for the
 * Query/RolesByActor RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryRolesByActorResponse
 */
export interface QueryRolesByActorResponse {
    /**
     * List of roles
     *
     * @generated from protobuf field: repeated string roles = 1
     */
    roles: string[];
}
/**
 * QueryRoleManagersRequest is the request type for the Query/RoleManagers
 * RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryRoleManagersRequest
 */
export interface QueryRoleManagersRequest {
    /**
     * The token denom
     *
     * @generated from protobuf field: string denom = 1
     */
    denom: string;
}
/**
 * QueryRoleManagersResponse is the response type for the
 * Query/RoleManagers RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryRoleManagersResponse
 */
export interface QueryRoleManagersResponse {
    /**
     * List of role managers
     *
     * @generated from protobuf field: repeated injective.permissions.v1beta1.RoleManager role_managers = 1
     */
    roleManagers: RoleManager[];
}
/**
 * QueryRoleManagerRequest is the request type for the Query/RoleManager
 * RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryRoleManagerRequest
 */
export interface QueryRoleManagerRequest {
    /**
     * The token denom
     *
     * @generated from protobuf field: string denom = 1
     */
    denom: string;
    /**
     * The manager Injective address
     *
     * @generated from protobuf field: string manager = 2
     */
    manager: string;
}
/**
 * QueryRoleManagerResponse is the response type for the
 * Query/RoleManager RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryRoleManagerResponse
 */
export interface QueryRoleManagerResponse {
    /**
     * The role manager details
     *
     * @generated from protobuf field: injective.permissions.v1beta1.RoleManager role_manager = 1
     */
    roleManager?: RoleManager;
}
/**
 * QueryPolicyStatusesRequest is the request type for the Query/PolicyStatuses
 * RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryPolicyStatusesRequest
 */
export interface QueryPolicyStatusesRequest {
    /**
     * The token denom
     *
     * @generated from protobuf field: string denom = 1
     */
    denom: string;
}
/**
 * QueryRoleManagerResponse is the response type for the
 * Query/RoleManager RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryPolicyStatusesResponse
 */
export interface QueryPolicyStatusesResponse {
    /**
     * List of policy statuses
     *
     * @generated from protobuf field: repeated injective.permissions.v1beta1.PolicyStatus policy_statuses = 1
     */
    policyStatuses: PolicyStatus[];
}
/**
 * QueryPolicyManagerCapabilitiesRequest is the request type for the
 * Query/PolicyManagerCapabilities RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryPolicyManagerCapabilitiesRequest
 */
export interface QueryPolicyManagerCapabilitiesRequest {
    /**
     * The token denom
     *
     * @generated from protobuf field: string denom = 1
     */
    denom: string;
}
/**
 * QueryPolicyManagerCapabilitiesResponse is the response type for the
 * Query/PolicyManagerCapabilities RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryPolicyManagerCapabilitiesResponse
 */
export interface QueryPolicyManagerCapabilitiesResponse {
    /**
     * List of policy manager capabilities
     *
     * @generated from protobuf field: repeated injective.permissions.v1beta1.PolicyManagerCapability policy_manager_capabilities = 1
     */
    policyManagerCapabilities: PolicyManagerCapability[];
}
/**
 * @generated from protobuf message injective.permissions.v1beta1.QueryVouchersRequest
 */
export interface QueryVouchersRequest {
    /**
     * The token denom
     *
     * @generated from protobuf field: string denom = 1
     */
    denom: string;
}
/**
 * @generated from protobuf message injective.permissions.v1beta1.QueryVouchersResponse
 */
export interface QueryVouchersResponse {
    /**
     * List of outstanding vouchers matching the request filter.
     *
     * @generated from protobuf field: repeated injective.common.vouchers.v1.AddressVoucher vouchers = 1
     */
    vouchers: AddressVoucher[];
}
/**
 * @generated from protobuf message injective.permissions.v1beta1.QueryVoucherRequest
 */
export interface QueryVoucherRequest {
    /**
     * The token denom
     *
     * @generated from protobuf field: string denom = 1
     */
    denom: string;
    /**
     * The Injective address of the receiver
     *
     * @generated from protobuf field: string address = 2
     */
    address: string;
}
/**
 * @generated from protobuf message injective.permissions.v1beta1.QueryVoucherResponse
 */
export interface QueryVoucherResponse {
    /**
     * The voucher amount
     *
     * @generated from protobuf field: cosmos.base.v1beta1.Coin voucher = 1
     */
    voucher?: Coin;
}
/**
 * QueryModuleStateRequest is the request type for the
 * Query/PermissionsModuleState RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryModuleStateRequest
 */
export interface QueryModuleStateRequest {
}
/**
 * QueryModuleStateResponse is the response type for the
 * Query/PermissionsModuleState RPC method.
 *
 * @generated from protobuf message injective.permissions.v1beta1.QueryModuleStateResponse
 */
export interface QueryModuleStateResponse {
    /**
     * The module state
     *
     * @generated from protobuf field: injective.permissions.v1beta1.GenesisState state = 1
     */
    state?: GenesisState;
}
// @generated message type with reflection information, may provide speed optimized methods
class QueryParamsRequest$Type extends MessageType<QueryParamsRequest> {
    constructor() {
        super("injective.permissions.v1beta1.QueryParamsRequest", []);
    }
    create(value?: PartialMessage<QueryParamsRequest>): QueryParamsRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<QueryParamsRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryParamsRequest): QueryParamsRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                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: QueryParamsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        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.QueryParamsRequest
 */
export const QueryParamsRequest = new QueryParamsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryParamsResponse$Type extends MessageType<QueryParamsResponse> {
    constructor() {
        super("injective.permissions.v1beta1.QueryParamsResponse", [
            { no: 1, name: "params", kind: "message", T: () => Params, options: { "gogoproto.nullable": false } }
        ]);
    }
    create(value?: PartialMessage<QueryParamsResponse>): QueryParamsResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<QueryParamsResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryParamsResponse): QueryParamsResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* injective.permissions.v1beta1.Params params */ 1:
                    message.params = Params.internalBinaryRead(reader, reader.uint32(), options, message.params);
                    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: QueryParamsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* injective.permissions.v1beta1.Params params = 1; */
        if (message.params)
            Params.internalBinaryWrite(message.params, 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.permissions.v1beta1.QueryParamsResponse
 */
export const QueryParamsResponse = new QueryParamsResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryNamespaceDenomsRequest$Type extends MessageType<QueryNamespaceDenomsRequest> {
    constructor() {
        super("injective.permissions.v1beta1.QueryNamespaceDenomsRequest", []);
    }
    create(value?: PartialMessage<QueryNamespaceDenomsRequest>): QueryNamespaceDenomsRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<QueryNamespaceDenomsRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryNamespaceDenomsRequest): QueryNamespaceDenomsRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                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: QueryNamespaceDenomsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        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.QueryNamespaceDenomsRequest
 */
export const QueryNamespaceDenomsRequest = new QueryNamespaceDenomsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryNamespaceDenomsResponse$Type extends MessageType<QueryNamespaceDenomsResponse> {
    constructor() {
        super("injective.permissions.v1beta1.QueryNamespaceDenomsResponse", [
            { no: 1, name: "denoms", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<QueryNamespaceDenomsResponse>): QueryNamespaceDenomsResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.denoms = [];
        if (value !== undefined)
            reflectionMergePartial<QueryNamespaceDenomsResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryNamespaceDenomsResponse): QueryNamespaceDenomsResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated string denoms */ 1:
                    message.denoms.push(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: QueryNamespaceDenomsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated string denoms = 1; */
        for (let i = 0; i < message.denoms.length; i++)
            writer.tag(1, WireType.LengthDelimited).string(message.denoms[i]);
        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.QueryNamespaceDenomsResponse
 */
export const QueryNamespaceDenomsResponse = new QueryNamespaceDenomsResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryNamespacesRequest$Type extends MessageType<QueryNamespacesRequest> {
    constructor() {
        super("injective.permissions.v1beta1.QueryNamespacesRequest", []);
    }
    create(value?: PartialMessage<QueryNamespacesRequest>): QueryNamespacesRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<QueryNamespacesRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryNamespacesRequest): QueryNamespacesRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                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: QueryNamespacesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        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.QueryNamespacesRequest
 */
export const QueryNamespacesRequest = new QueryNamespacesRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryNamespacesResponse$Type extends MessageType<QueryNamespacesResponse> {
    constructor() {
        super("injective.permissions.v1beta1.QueryNamespacesResponse", [
            { no: 1, name: "namespaces", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Namespace }
        ]);
    }
    create(value?: PartialMessage<QueryNamespacesResponse>): QueryNamespacesResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.namespaces = [];
        if (value !== undefined)
            reflectionMergePartial<QueryNamespacesResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryNamespacesResponse): QueryNamespacesResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated injective.permissions.v1beta1.Namespace namespaces */ 1:
                    message.namespaces.push(Namespace.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: QueryNamespacesResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated injective.permissions.v1beta1.Namespace namespaces = 1; */
        for (let i = 0; i < message.namespaces.length; i++)
            Namespace.internalBinaryWrite(message.namespaces[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;
    }
}
/**
 * @generated MessageType for protobuf message injective.permissions.v1beta1.QueryNamespacesResponse
 */
export const QueryNamespacesResponse = new QueryNamespacesResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryNamespaceRequest$Type extends MessageType<QueryNamespaceRequest> {
    constructor() {
        super("injective.permissions.v1beta1.QueryNamespaceRequest", [
            { no: 1, name: "denom", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<QueryNamespaceRequest>): QueryNamespaceRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.denom = "";
        if (value !== undefined)
            reflectionMergePartial<QueryNamespaceRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryNamespaceRequest): QueryNamespaceRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string denom */ 1:
                    message.denom = 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: QueryNamespaceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string denom = 1; */
        if (message.denom !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.denom);
        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.QueryNamespaceRequest
 */
export const QueryNamespaceRequest = new QueryNamespaceRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryNamespaceResponse$Type extends MessageType<QueryNamespaceResponse> {
    constructor() {
        super("injective.permissions.v1beta1.QueryNamespaceResponse", [
            { no: 1, name: "namespace", kind: "message", T: () => Namespace }
        ]);
    }
    create(value?: PartialMessage<QueryNamespaceResponse>): QueryNamespaceResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<QueryNamespaceResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryNamespaceResponse): QueryNamespaceResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* injective.permissions.v1beta1.Namespace namespace */ 1:
                    message.namespace = Namespace.internalBinaryRead(reader, reader.uint32(), options, message.namespace);
                    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: QueryNamespaceResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* injective.permissions.v1beta1.Namespace namespace = 1; */
        if (message.namespace)
            Namespace.internalBinaryWrite(message.namespace, 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.permissions.v1beta1.QueryNamespaceResponse
 */
export const QueryNamespaceResponse = new QueryNamespaceResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryActorsByRoleRequest$Type extends MessageType<QueryActorsByRoleRequest> {
    constructor() {
        super("injective.permissions.v1beta1.QueryActorsByRoleRequest", [
            { no: 1, name: "denom", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "role", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<QueryActorsByRoleRequest>): QueryActorsByRoleRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.denom = "";
        message.role = "";
        if (value !== undefined)
            reflectionMergePartial<QueryActorsByRoleRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryActorsByRoleRequest): QueryActorsByRoleRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string denom */ 1:
                    message.denom = reader.string();
                    break;
                case /* string role */ 2:
                    message.role = 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: QueryActorsByRoleRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string denom = 1; */
        if (message.denom !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.denom);
        /* string role = 2; */
        if (message.role !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.role);
        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.QueryActorsByRoleRequest
 */
export const QueryActorsByRoleRequest = new QueryActorsByRoleRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryActorsByRoleResponse$Type extends MessageType<QueryActorsByRoleResponse> {
    constructor() {
        super("injective.permissions.v1beta1.QueryActorsByRoleResponse", [
            { no: 1, name: "actors", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<QueryActorsByRoleResponse>): QueryActorsByRoleResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.actors = [];
        if (value !== undefined)
            reflectionMergePartial<QueryActorsByRoleResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryActorsByRoleResponse): QueryActorsByRoleResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated string actors */ 1:
                    message.actors.push(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: QueryActorsByRoleResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated string actors = 1; */
        for (let i = 0; i < message.actors.length; i++)
            writer.tag(1, WireType.LengthDelimited).string(message.actors[i]);
        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.QueryActorsByRoleResponse
 */
export const QueryActorsByRoleResponse = new QueryActorsByRoleResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryRolesByActorRequest$Type extends MessageType<QueryRolesByActorRequest> {
    constructor() {
        super("injective.permissions.v1beta1.QueryRolesByActorRequest", [
            { no: 1, name: "denom", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "actor", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<QueryRolesByActorRequest>): QueryRolesByActorRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.denom = "";
        message.actor = "";
        if (value !== undefined)
            reflectionMergePartial<QueryRolesByActorRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryRolesByActorRequest): QueryRolesByActorRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string denom */ 1:
                    message.denom = reader.string();
                    break;
                case /* string actor */ 2:
                    message.actor = 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: QueryRolesByActorRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string denom = 1; */
        if (message.denom !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.denom);
        /* string actor = 2; */
        if (message.actor !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.actor);
        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.QueryRolesByActorRequest
 */
export const QueryRolesByActorRequest = new QueryRolesByActorRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryRolesByActorResponse$Type extends MessageType<QueryRolesByActorResponse> {
    constructor() {
        super("injective.permissions.v1beta1.QueryRolesByActorResponse", [
            { no: 1, name: "roles", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<QueryRolesByActorResponse>): QueryRolesByActorResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.roles = [];
        if (value !== undefined)
            reflectionMergePartial<QueryRolesByActorResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryRolesByActorResponse): QueryRolesByActorResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated string roles */ 1:
                    message.roles.push(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: QueryRolesByActorResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated string roles = 1; */
        for (let i = 0; i < message.roles.length; i++)
            writer.tag(1, WireType.LengthDelimited).string(message.roles[i]);
        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.QueryRolesByActorResponse
 */
export const QueryRolesByActorResponse = new QueryRolesByActorResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryRoleManagersRequest$Type extends MessageType<QueryRoleManagersRequest> {
    constructor() {
        super("injective.permissions.v1beta1.QueryRoleManagersRequest", [
            { no: 1, name: "denom", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<QueryRoleManagersRequest>): QueryRoleManagersRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.denom = "";
        if (value !== undefined)
            reflectionMergePartial<QueryRoleManagersRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryRoleManagersRequest): QueryRoleManagersRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string denom */ 1:
                    message.denom = 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: QueryRoleManagersRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string denom = 1; */
        if (message.denom !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.denom);
        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.QueryRoleManagersRequest
 */
export const QueryRoleManagersRequest = new QueryRoleManagersRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryRoleManagersResponse$Type extends MessageType<QueryRoleManagersResponse> {
    constructor() {
        super("injective.permissions.v1beta1.QueryRoleManagersResponse", [
            { no: 1, name: "role_managers", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => RoleManager }
        ]);
    }
    create(value?: PartialMessage<QueryRoleManagersResponse>): QueryRoleManagersResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.roleManagers = [];
        if (value !== undefined)
            reflectionMergePartial<QueryRoleManagersResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryRoleManagersResponse): QueryRoleManagersResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated injective.permissions.v1beta1.RoleManager role_managers */ 1:
                    message.roleManagers.push(RoleManager.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: QueryRoleManagersResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated injective.permissions.v1beta1.RoleManager role_managers = 1; */
        for (let i = 0; i < message.roleManagers.length; i++)
            RoleManager.internalBinaryWrite(message.roleManagers[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;
    }
}
/**
 * @generated MessageType for protobuf message injective.permissions.v1beta1.QueryRoleManagersResponse
 */
export const QueryRoleManagersResponse = new QueryRoleManagersResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryRoleManagerRequest$Type extends MessageType<QueryRoleManagerRequest> {
    constructor() {
        super("injective.permissions.v1beta1.QueryRoleManagerRequest", [
            { no: 1, name: "denom", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "manager", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<QueryRoleManagerRequest>): QueryRoleManagerRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.denom = "";
        message.manager = "";
        if (value !== undefined)
            reflectionMergePartial<QueryRoleManagerRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryRoleManagerRequest): QueryRoleManagerRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string denom */ 1:
                    message.denom = reader.string();
                    break;
                case /* string manager */ 2:
                    message.manager = 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: QueryRoleManagerRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string denom = 1; */
        if (message.denom !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.denom);
        /* string manager = 2; */
        if (message.manager !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.manager);
        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.QueryRoleManagerRequest
 */
export const QueryRoleManagerRequest = new QueryRoleManagerRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryRoleManagerResponse$Type extends MessageType<QueryRoleManagerResponse> {
    constructor() {
        super("injective.permissions.v1beta1.QueryRoleManagerResponse", [
            { no: 1, name: "role_manager", kind: "message", T: () => RoleManager }
        ]);
    }
    create(value?: PartialMessage<QueryRoleManagerResponse>): QueryRoleManagerResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<QueryRoleManagerResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryRoleManagerResponse): QueryRoleManagerResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* injective.permissions.v1beta1.RoleManager role_manager */ 1:
                    message.roleManager = RoleManager.internalBinaryRead(reader, reader.uint32(), options, message.roleManager);
                    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: QueryRoleManagerResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* injective.permissions.v1beta1.RoleManager role_manager = 1; */
        if (message.roleManager)
            RoleManager.internalBinaryWrite(message.roleManager, 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.permissions.v1beta1.QueryRoleManagerResponse
 */
export const QueryRoleManagerResponse = new QueryRoleManagerResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryPolicyStatusesRequest$Type extends MessageType<QueryPolicyStatusesRequest> {
    constructor() {
        super("injective.permissions.v1beta1.QueryPolicyStatusesRequest", [
            { no: 1, name: "denom", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<QueryPolicyStatusesRequest>): QueryPolicyStatusesRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.denom = "";
        if (value !== undefined)
            reflectionMergePartial<QueryPolicyStatusesRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryPolicyStatusesRequest): QueryPolicyStatusesRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string denom */ 1:
                    message.denom = 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: QueryPolicyStatusesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string denom = 1; */
        if (message.denom !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.denom);
        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.QueryPolicyStatusesRequest
 */
export const QueryPolicyStatusesRequest = new QueryPolicyStatusesRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryPolicyStatusesResponse$Type extends MessageType<QueryPolicyStatusesResponse> {
    constructor() {
        super("injective.permissions.v1beta1.QueryPolicyStatusesResponse", [
            { no: 1, name: "policy_statuses", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => PolicyStatus }
        ]);
    }
    create(value?: PartialMessage<QueryPolicyStatusesResponse>): QueryPolicyStatusesResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.policyStatuses = [];
        if (value !== undefined)
            reflectionMergePartial<QueryPolicyStatusesResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryPolicyStatusesResponse): QueryPolicyStatusesResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated injective.permissions.v1beta1.PolicyStatus policy_statuses */ 1:
                    message.policyStatuses.push(PolicyStatus.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: QueryPolicyStatusesResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated injective.permissions.v1beta1.PolicyStatus policy_statuses = 1; */
        for (let i = 0; i < message.policyStatuses.length; i++)
            PolicyStatus.internalBinaryWrite(message.policyStatuses[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;
    }
}
/**
 * @generated MessageType for protobuf message injective.permissions.v1beta1.QueryPolicyStatusesResponse
 */
export const QueryPolicyStatusesResponse = new QueryPolicyStatusesResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryPolicyManagerCapabilitiesRequest$Type extends MessageType<QueryPolicyManagerCapabilitiesRequest> {
    constructor() {
        super("injective.permissions.v1beta1.QueryPolicyManagerCapabilitiesRequest", [
            { no: 1, name: "denom", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<QueryPolicyManagerCapabilitiesRequest>): QueryPolicyManagerCapabilitiesRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.denom = "";
        if (value !== undefined)
            reflectionMergePartial<QueryPolicyManagerCapabilitiesRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryPolicyManagerCapabilitiesRequest): QueryPolicyManagerCapabilitiesRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string denom */ 1:
                    message.denom = 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: QueryPolicyManagerCapabilitiesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string denom = 1; */
        if (message.denom !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.denom);
        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.QueryPolicyManagerCapabilitiesRequest
 */
export const QueryPolicyManagerCapabilitiesRequest = new QueryPolicyManagerCapabilitiesRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryPolicyManagerCapabilitiesResponse$Type extends MessageType<QueryPolicyManagerCapabilitiesResponse> {
    constructor() {
        super("injective.permissions.v1beta1.QueryPolicyManagerCapabilitiesResponse", [
            { no: 1, name: "policy_manager_capabilities", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => PolicyManagerCapability }
        ]);
    }
    create(value?: PartialMessage<QueryPolicyManagerCapabilitiesResponse>): QueryPolicyManagerCapabilitiesResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.policyManagerCapabilities = [];
        if (value !== undefined)
            reflectionMergePartial<QueryPolicyManagerCapabilitiesResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryPolicyManagerCapabilitiesResponse): QueryPolicyManagerCapabilitiesResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated injective.permissions.v1beta1.PolicyManagerCapability policy_manager_capabilities */ 1:
                    message.policyManagerCapabilities.push(PolicyManagerCapability.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: QueryPolicyManagerCapabilitiesResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated injective.permissions.v1beta1.PolicyManagerCapability policy_manager_capabilities = 1; */
        for (let i = 0; i < message.policyManagerCapabilities.length; i++)
            PolicyManagerCapability.internalBinaryWrite(message.policyManagerCapabilities[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;
    }
}
/**
 * @generated MessageType for protobuf message injective.permissions.v1beta1.QueryPolicyManagerCapabilitiesResponse
 */
export const QueryPolicyManagerCapabilitiesResponse = new QueryPolicyManagerCapabilitiesResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryVouchersRequest$Type extends MessageType<QueryVouchersRequest> {
    constructor() {
        super("injective.permissions.v1beta1.QueryVouchersRequest", [
            { no: 1, name: "denom", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<QueryVouchersRequest>): QueryVouchersRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.denom = "";
        if (value !== undefined)
            reflectionMergePartial<QueryVouchersRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryVouchersRequest): QueryVouchersRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string denom */ 1:
                    message.denom = 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: QueryVouchersRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string denom = 1; */
        if (message.denom !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.denom);
        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.QueryVouchersRequest
 */
export const QueryVouchersRequest = new QueryVouchersRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryVouchersResponse$Type extends MessageType<QueryVouchersResponse> {
    constructor() {
        super("injective.permissions.v1beta1.QueryVouchersResponse", [
            { no: 1, name: "vouchers", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => AddressVoucher, options: { "gogoproto.nullable": false } }
        ]);
    }
    create(value?: PartialMessage<QueryVouchersResponse>): QueryVouchersResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.vouchers = [];
        if (value !== undefined)
            reflectionMergePartial<QueryVouchersResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryVouchersResponse): QueryVouchersResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated injective.common.vouchers.v1.AddressVoucher vouchers */ 1:
                    message.vouchers.push(AddressVoucher.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: QueryVouchersResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated injective.common.vouchers.v1.AddressVoucher vouchers = 1; */
        for (let i = 0; i < message.vouchers.length; i++)
            AddressVoucher.internalBinaryWrite(message.vouchers[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;
    }
}
/**
 * @generated MessageType for protobuf message injective.permissions.v1beta1.QueryVouchersResponse
 */
export const QueryVouchersResponse = new QueryVouchersResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryVoucherRequest$Type extends MessageType<QueryVoucherRequest> {
    constructor() {
        super("injective.permissions.v1beta1.QueryVoucherRequest", [
            { no: 1, name: "denom", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<QueryVoucherRequest>): QueryVoucherRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.denom = "";
        message.address = "";
        if (value !== undefined)
            reflectionMergePartial<QueryVoucherRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryVoucherRequest): QueryVoucherRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string denom */ 1:
                    message.denom = reader.string();
                    break;
                case /* string address */ 2:
                    message.address = 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: QueryVoucherRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string denom = 1; */
        if (message.denom !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.denom);
        /* string address = 2; */
        if (message.address !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.address);
        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.QueryVoucherRequest
 */
export const QueryVoucherRequest = new QueryVoucherRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryVoucherResponse$Type extends MessageType<QueryVoucherResponse> {
    constructor() {
        super("injective.permissions.v1beta1.QueryVoucherResponse", [
            { no: 1, name: "voucher", kind: "message", T: () => Coin, options: { "gogoproto.nullable": false, "gogoproto.customtype": "github.com/cosmos/cosmos-sdk/types.Coin" } }
        ]);
    }
    create(value?: PartialMessage<QueryVoucherResponse>): QueryVoucherResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<QueryVoucherResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryVoucherResponse): QueryVoucherResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* cosmos.base.v1beta1.Coin voucher */ 1:
                    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: QueryVoucherResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* cosmos.base.v1beta1.Coin voucher = 1; */
        if (message.voucher)
            Coin.internalBinaryWrite(message.voucher, 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.permissions.v1beta1.QueryVoucherResponse
 */
export const QueryVoucherResponse = new QueryVoucherResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryModuleStateRequest$Type extends MessageType<QueryModuleStateRequest> {
    constructor() {
        super("injective.permissions.v1beta1.QueryModuleStateRequest", []);
    }
    create(value?: PartialMessage<QueryModuleStateRequest>): QueryModuleStateRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<QueryModuleStateRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryModuleStateRequest): QueryModuleStateRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                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: QueryModuleStateRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        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.QueryModuleStateRequest
 */
export const QueryModuleStateRequest = new QueryModuleStateRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class QueryModuleStateResponse$Type extends MessageType<QueryModuleStateResponse> {
    constructor() {
        super("injective.permissions.v1beta1.QueryModuleStateResponse", [
            { no: 1, name: "state", kind: "message", T: () => GenesisState }
        ]);
    }
    create(value?: PartialMessage<QueryModuleStateResponse>): QueryModuleStateResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<QueryModuleStateResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryModuleStateResponse): QueryModuleStateResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* injective.permissions.v1beta1.GenesisState state */ 1:
                    message.state = GenesisState.internalBinaryRead(reader, reader.uint32(), options, message.state);
                    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: QueryModuleStateResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* injective.permissions.v1beta1.GenesisState state = 1; */
        if (message.state)
            GenesisState.internalBinaryWrite(message.state, 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.permissions.v1beta1.QueryModuleStateResponse
 */
export const QueryModuleStateResponse = new QueryModuleStateResponse$Type();
/**
 * @generated ServiceType for protobuf service injective.permissions.v1beta1.Query
 */
export const Query = new ServiceType("injective.permissions.v1beta1.Query", [
    { name: "Params", options: { "google.api.http": { get: "/injective/permissions/v1beta1/params" } }, I: QueryParamsRequest, O: QueryParamsResponse },
    { name: "NamespaceDenoms", options: { "google.api.http": { get: "/injective/permissions/v1beta1/namespace_denoms" } }, I: QueryNamespaceDenomsRequest, O: QueryNamespaceDenomsResponse },
    { name: "Namespaces", options: { "google.api.http": { get: "/injective/permissions/v1beta1/namespaces" } }, I: QueryNamespacesRequest, O: QueryNamespacesResponse },
    { name: "Namespace", options: { "google.api.http": { get: "/injective/permissions/v1beta1/namespace/{denom}" } }, I: QueryNamespaceRequest, O: QueryNamespaceResponse },
    { name: "RolesByActor", options: { "google.api.http": { get: "/injective/permissions/v1beta1/roles_by_actor/{denom}/{actor}" } }, I: QueryRolesByActorRequest, O: QueryRolesByActorResponse },
    { name: "ActorsByRole", options: { "google.api.http": { get: "/injective/permissions/v1beta1/actors_by_role/{denom}/{role}" } }, I: QueryActorsByRoleRequest, O: QueryActorsByRoleResponse },
    { name: "RoleManagers", options: { "google.api.http": { get: "/injective/permissions/v1beta1/role_managers/{denom}" } }, I: QueryRoleManagersRequest, O: QueryRoleManagersResponse },
    { name: "RoleManager", options: { "google.api.http": { get: "/injective/permissions/v1beta1/role_manager/{denom}/{manager}" } }, I: QueryRoleManagerRequest, O: QueryRoleManagerResponse },
    { name: "PolicyStatuses", options: { "google.api.http": { get: "/injective/permissions/v1beta1/policy_statuses/{denom}" } }, I: QueryPolicyStatusesRequest, O: QueryPolicyStatusesResponse },
    { name: "PolicyManagerCapabilities", options: { "google.api.http": { get: "/injective/permissions/v1beta1/policy_manager_capabilities/{denom}" } }, I: QueryPolicyManagerCapabilitiesRequest, O: QueryPolicyManagerCapabilitiesResponse },
    { name: "Vouchers", options: { "google.api.http": { get: "/injective/permissions/v1beta1/vouchers" } }, I: QueryVouchersRequest, O: QueryVouchersResponse },
    { name: "Voucher", options: { "google.api.http": { get: "/injective/permissions/v1beta1/voucher" } }, I: QueryVoucherRequest, O: QueryVoucherResponse },
    { name: "PermissionsModuleState", options: { "google.api.http": { get: "/injective/permissions/v1beta1/module_state" } }, I: QueryModuleStateRequest, O: QueryModuleStateResponse }
]);
