# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: band/bandtss/v1beta1/bandtss.proto, band/bandtss/v1beta1/genesis.proto, band/bandtss/v1beta1/query.proto, band/bandtss/v1beta1/tx.proto
# plugin: python-betterproto
# This file has been @generated

from dataclasses import dataclass
from datetime import (
    datetime,
    timedelta,
)
from typing import (
    TYPE_CHECKING,
    Dict,
    List,
    Optional,
)

import betterproto
import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf
import grpclib
from betterproto.grpc.grpclib_server import ServiceBase

from ....cosmos.base import v1beta1 as __cosmos_base_v1_beta1__
from ....cosmos.base.query import v1beta1 as __cosmos_base_query_v1_beta1__
from ...tss import v1beta1 as __tss_v1_beta1__


if TYPE_CHECKING:
    import grpclib.server
    from betterproto.grpc.grpclib_client import MetadataLike
    from grpclib.metadata import Deadline


class TransitionStatus(betterproto.Enum):
    """
    TransitionStatus is an enumeration of the possible statuses of a group transition process.
    """

    UNSPECIFIED = 0
    """
    TRANSITION_STATUS_UNSPECIFIED is the status of a group transition that has not been specified.
    """

    CREATING_GROUP = 1
    """
    TRANSITION_STATUS_CREATING_GROUP is the status of a group transition that a new group
     is being created.
    """

    WAITING_SIGN = 2
    """
    TRANSITION_STATUS_WAITING_SIGN is the status of a group transition that waits members in
     a current group to sign the transition message.
    """

    WAITING_EXECUTION = 3
    """
    TRANSITION_STATUS_WAITING_EXECUTION is the status of a group transition that
     a transition process is completed, either from a forceTransition or having a current-group
     signature on a transition message, but waits for the execution time.
    """


class MemberStatusFilter(betterproto.Enum):
    """
    MemberStatusFilter defines the query options for filtering members by their active status.
    """

    UNSPECIFIED = 0
    """
    MEMBER_STATUS_FILTER_UNSPECIFIED defines a filter for unspecified active status.
    """

    ACTIVE = 1
    """MEMBER_STATUS_FILTER_ACTIVE defines a filter for active status."""

    INACTIVE = 2
    """MEMBER_STATUS_FILTER_INACTIVE defines a filter for inactive status."""


@dataclass(eq=False, repr=False)
class Member(betterproto.Message):
    """
    Member maintains member information for monitoring their liveness activity.
    """

    address: str = betterproto.string_field(1)
    """address is the address of the member."""

    group_id: int = betterproto.uint64_field(2)
    """group_id is the group ID that the member belongs to."""

    is_active: bool = betterproto.bool_field(3)
    """is_active is a flag to indicate whether a member is active or not."""

    since: datetime = betterproto.message_field(4)
    """
    since is a block timestamp when a member status is changed (from active to inactive or vice versa).
    """


@dataclass(eq=False, repr=False)
class CurrentGroup(betterproto.Message):
    """CuurentGroup is a bandtss current group information."""

    group_id: int = betterproto.uint64_field(1)
    """group_id is the ID of the current group."""

    active_time: datetime = betterproto.message_field(2)
    """
    active_time is the timestamp at which the group becomes the current group of the module.
    """


@dataclass(eq=False, repr=False)
class Signing(betterproto.Message):
    """Signing is a bandtss signing information."""

    id: int = betterproto.uint64_field(1)
    """id is the unique identifier of the bandtss signing."""

    fee_per_signer: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(2)
    """
    fee_per_signer is the tokens that will be paid per signer for this bandtss signing.
    """

    requester: str = betterproto.string_field(3)
    """requester is the address who pays the Bandtss signing."""

    current_group_signing_id: int = betterproto.uint64_field(4)
    """current_group_signing_id is a tss signing ID of a current group."""

    incoming_group_signing_id: int = betterproto.uint64_field(5)
    """
    incoming_group_signing_id is a tss signing ID of an incoming group, if any.
    """


@dataclass(eq=False, repr=False)
class GroupTransition(betterproto.Message):
    """
    GroupTransition defines the group transition information of the current group and incoming group.
    """

    signing_id: int = betterproto.uint64_field(1)
    """signing_id is a tss signing ID of group transition signing request."""

    current_group_id: int = betterproto.uint64_field(2)
    """current_group_id is the ID of the group that will be replaced."""

    current_group_pub_key: bytes = betterproto.bytes_field(3)
    """
    current_group_pub_key is the public key pair that used for sign & verify transition group msg.
    """

    incoming_group_id: int = betterproto.uint64_field(4)
    """new_group_id is the ID of the new group that be a new key candidate."""

    incoming_group_pub_key: bytes = betterproto.bytes_field(5)
    """
    incoming_group_pub_key is the public key of the group that will be the next key of this group
    """

    status: "TransitionStatus" = betterproto.enum_field(6)
    """
    status is an enumeration of the possible statuses of a group transition process.
    """

    exec_time: datetime = betterproto.message_field(7)
    """exec_time is the time when the transition will be executed."""

    is_force_transition: bool = betterproto.bool_field(8)
    """
    is_force_transition is a flag to indicate whether the current group signs the transition message
     before the transition is executed or not.
    """


@dataclass(eq=False, repr=False)
class GroupTransitionSignatureOrder(betterproto.Message):
    """
    GroupTransitionSignatureOrder defines a general signature order for group transition.
    """

    pub_key: bytes = betterproto.bytes_field(1)
    """
    pub_key is the public key of new group that the current group needs to be signed.
    """

    transition_time: datetime = betterproto.message_field(2)
    """
    transition_time is the timestamp at which the transition is executed and the public key is active.
    """


@dataclass(eq=False, repr=False)
class GenesisState(betterproto.Message):
    """GenesisState defines the bandtss module's genesis state."""

    params: "Params" = betterproto.message_field(1)
    """params defines all the paramiters of the module."""

    members: List["Member"] = betterproto.message_field(2)
    """members is an array containing members information."""

    current_group: "CurrentGroup" = betterproto.message_field(3)
    """current_group is the current group information."""


@dataclass(eq=False, repr=False)
class Params(betterproto.Message):
    """Params defines the set of module parameters."""

    reward_percentage: int = betterproto.uint64_field(1)
    """
    reward_percentage is the percentage of block rewards allocated to active TSS members.
     The reward proportion is calculated after being allocated to oracle rewards.
    """

    inactive_penalty_duration: timedelta = betterproto.message_field(2)
    """
    inactive_penalty_duration is the duration where a member cannot activate back after being set to inactive.
    """

    min_transition_duration: timedelta = betterproto.message_field(3)
    """
    min_transition_duration is the minimum duration that the transition process waits before execution.
    """

    max_transition_duration: timedelta = betterproto.message_field(4)
    """
    max_transition_duration is the maximum duration that the transition process waits before execution.
    """

    fee_per_signer: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(5)
    """fee_per_signer is the tokens that will be paid per signer."""


@dataclass(eq=False, repr=False)
class MsgRequestSignature(betterproto.Message):
    """
    MsgRequestSignature is a request message used for initiating the signing process.
    """

    content: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(1)
    """content is the signature order of this request signature message."""

    memo: str = betterproto.string_field(2)
    """memo is the additional note of the message."""

    fee_limit: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(3)
    """fee_limit is the maximum tokens that will be paid for this request."""

    sender: str = betterproto.string_field(4)
    """sender is the requester of the signing process."""


@dataclass(eq=False, repr=False)
class MsgRequestSignatureResponse(betterproto.Message):
    """
    MsgRequestSignatureResponse is response data for MsgRequestSignature message
    """

    pass


@dataclass(eq=False, repr=False)
class MsgActivate(betterproto.Message):
    """MsgActivate is a message used to activate the status of the sender."""

    sender: str = betterproto.string_field(1)
    """
    address is the signer of this message, who must be a member of the group.
    """

    group_id: int = betterproto.uint64_field(2)
    """group_id is the group id of the member."""


@dataclass(eq=False, repr=False)
class MsgActivateResponse(betterproto.Message):
    """MsgActivateResponse is response data for MsgActivate message"""

    pass


@dataclass(eq=False, repr=False)
class MsgUpdateParams(betterproto.Message):
    """MsgUpdateParams is the Msg/UpdateParams request type."""

    params: "Params" = betterproto.message_field(1)
    """params defines the x/tss parameters to update."""

    authority: str = betterproto.string_field(2)
    """
    authority is the address that controls the module (defaults to x/gov unless overwritten).
    """


@dataclass(eq=False, repr=False)
class MsgUpdateParamsResponse(betterproto.Message):
    """
    MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message.
    """

    pass


@dataclass(eq=False, repr=False)
class MsgTransitionGroup(betterproto.Message):
    """MsgTransitionGroup is the Msg/TransitionGroup request type."""

    members: List[str] = betterproto.string_field(1)
    """members is a list of members in this group."""

    threshold: int = betterproto.uint64_field(2)
    """
    threshold is a minimum number of members required to produce a signature.
    """

    exec_time: datetime = betterproto.message_field(3)
    """
    exec_time is the time that will be substituted in place of the group.
    """

    authority: str = betterproto.string_field(4)
    """
    authority is the address that controls the module (defaults to x/gov unless overwritten).
    """


@dataclass(eq=False, repr=False)
class MsgTransitionGroupResponse(betterproto.Message):
    """MsgTransitionGroupResponse is the Msg/TransitionGroup response type."""

    pass


@dataclass(eq=False, repr=False)
class MsgForceTransitionGroup(betterproto.Message):
    """
    MsgForceTransitionGroup is the Msg/ForceTransitionGroup request type.
    """

    incoming_group_id: int = betterproto.uint64_field(1)
    """
    incoming_group_id is the ID of the group that the module want to transition to.
    """

    exec_time: datetime = betterproto.message_field(2)
    """
    exec_time is the time that will be substituted in place of the group.
    """

    authority: str = betterproto.string_field(3)
    """
    authority is the address that controls the module (defaults to x/gov unless overwritten).
    """


@dataclass(eq=False, repr=False)
class MsgForceTransitionGroupResponse(betterproto.Message):
    """
    MsgForceTransitionGroupResponse is the Msg/ForceTransitionGroup response type.
    """

    pass


@dataclass(eq=False, repr=False)
class QueryCountsRequest(betterproto.Message):
    """QueryCountsRequest is request type for the Query/Count RPC method."""

    pass


@dataclass(eq=False, repr=False)
class QueryCountsResponse(betterproto.Message):
    """QueryCountsResponse is response type for the Query/Count RPC method."""

    signing_count: int = betterproto.uint64_field(1)
    """
    signing_count is total number of signing request submitted to bandtss module
    """


@dataclass(eq=False, repr=False)
class QueryMembersRequest(betterproto.Message):
    """
    QueryMembersRequest is the request type for the Query/Members RPC method.
    """

    status: "MemberStatusFilter" = betterproto.enum_field(1)
    """status define type of filter on member's status."""

    is_incoming_group: bool = betterproto.bool_field(2)
    """
    is_incoming_group is a flag to indicate whether user query members in the incoming group
     or the current group.
    """

    pagination: "__cosmos_base_query_v1_beta1__.PageRequest" = (
        betterproto.message_field(3)
    )
    """pagination defines pagination settings for the request."""


@dataclass(eq=False, repr=False)
class QueryMembersResponse(betterproto.Message):
    """
    QueryMembersResponse is the response type for the Query/Members RPC method.
    """

    members: List["Member"] = betterproto.message_field(1)
    """
    members are those individuals who correspond to the provided is_active status.
    """

    pagination: "__cosmos_base_query_v1_beta1__.PageResponse" = (
        betterproto.message_field(2)
    )
    """pagination defines the pagination in the response."""


@dataclass(eq=False, repr=False)
class QueryMemberRequest(betterproto.Message):
    """
    QueryMemberRequest is the request type for the Query/Member RPC method.
    """

    address: str = betterproto.string_field(1)
    """address is the member address."""


@dataclass(eq=False, repr=False)
class QueryMemberResponse(betterproto.Message):
    """
    QueryMemberResponse is the response type for the Query/Member RPC method.
    """

    current_group_member: "Member" = betterproto.message_field(1)
    """current_group_member is the member detail."""

    incoming_group_member: "Member" = betterproto.message_field(2)
    """incoming_group_member is the member detail."""


@dataclass(eq=False, repr=False)
class QueryCurrentGroupRequest(betterproto.Message):
    """
    QueryCurrentGroupRequest is the request type for the Query/CurrentGroup RPC method.
    """

    pass


@dataclass(eq=False, repr=False)
class QueryCurrentGroupResponse(betterproto.Message):
    """
    QueryCurrentGroupResponse is the response type for the Query/CurrentGroup RPC method.
    """

    group_id: int = betterproto.uint64_field(1)
    """group_id is the ID of the current group."""

    size: int = betterproto.uint64_field(2)
    """size is the number of members in the group."""

    threshold: int = betterproto.uint64_field(3)
    """
    threshold is the minimum number of members needed to generate a valid signature.
    """

    pub_key: bytes = betterproto.bytes_field(4)
    """pub_key is the public key generated by the group."""

    status: "__tss_v1_beta1__.GroupStatus" = betterproto.enum_field(5)
    """status is the status of the current group."""

    active_time: datetime = betterproto.message_field(6)
    """
    active_time is the timestamp at which the group becomes the current group of the module.
    """


@dataclass(eq=False, repr=False)
class QueryIncomingGroupRequest(betterproto.Message):
    """
    QueryIncomingGroupRequest is the request type for the Query/IncomingGroup RPC method.
    """

    pass


@dataclass(eq=False, repr=False)
class QueryIncomingGroupResponse(betterproto.Message):
    """
    QueryIncomingGroupResponse is the response type for the Query/IncomingGroup RPC method.
    """

    group_id: int = betterproto.uint64_field(1)
    """group_id is the ID of the incoming group."""

    size: int = betterproto.uint64_field(2)
    """size is the number of members in the group."""

    threshold: int = betterproto.uint64_field(3)
    """
    threshold is the minimum number of members needed to generate a valid signature.
    """

    pub_key: bytes = betterproto.bytes_field(4)
    """pub_key is the public key generated by the group."""

    status: "__tss_v1_beta1__.GroupStatus" = betterproto.enum_field(5)
    """status is the status of the incoming group."""


@dataclass(eq=False, repr=False)
class QuerySigningRequest(betterproto.Message):
    """
    QuerySingingRequest is the request type for the Query/Signing RPC method.
    """

    signing_id: int = betterproto.uint64_field(1)
    """signing_id is the ID of the signing request."""


@dataclass(eq=False, repr=False)
class QuerySigningResponse(betterproto.Message):
    """
    QuerySigningResponse is the response type for the Query/Signing RPC method.
    """

    fee_per_signer: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(1)
    """
    fee_per_signer is the tokens that will be paid per signer for this bandtss signing.
    """

    requester: str = betterproto.string_field(2)
    """requester is the address of requester who paid for bandtss signing."""

    current_group_signing_result: "__tss_v1_beta1__.SigningResult" = (
        betterproto.message_field(3)
    )
    """
    current_group_signing_result is the signing result from the current group.
    """

    incoming_group_signing_result: "__tss_v1_beta1__.SigningResult" = (
        betterproto.message_field(4)
    )
    """
    incoming_group_signing_result is the signing result from the incoming group.
    """


@dataclass(eq=False, repr=False)
class QueryGroupTransitionRequest(betterproto.Message):
    """
    QueryGroupTransitionRequest is the request type for the Query/GroupTransition RPC method.
    """

    pass


@dataclass(eq=False, repr=False)
class QueryGroupTransitionResponse(betterproto.Message):
    """
    QueryGroupTransitionResponse is the response type for the Query/GroupTransition RPC method.
    """

    group_transition: "GroupTransition" = betterproto.message_field(1)
    """group_transition is the group transition information."""


@dataclass(eq=False, repr=False)
class QueryParamsRequest(betterproto.Message):
    """QueryParamsRequest is request type for the Query/Params RPC method."""

    pass


@dataclass(eq=False, repr=False)
class QueryParamsResponse(betterproto.Message):
    """
    QueryParamsResponse is response type for the Query/Params RPC method.
    """

    params: "Params" = betterproto.message_field(1)
    """Params is the parameters of the module."""


class MsgStub(betterproto.ServiceStub):
    async def request_signature(
        self,
        msg_request_signature: "MsgRequestSignature",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "MsgRequestSignatureResponse":
        return await self._unary_unary(
            "/band.bandtss.v1beta1.Msg/RequestSignature",
            msg_request_signature,
            MsgRequestSignatureResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def activate(
        self,
        msg_activate: "MsgActivate",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "MsgActivateResponse":
        return await self._unary_unary(
            "/band.bandtss.v1beta1.Msg/Activate",
            msg_activate,
            MsgActivateResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def update_params(
        self,
        msg_update_params: "MsgUpdateParams",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "MsgUpdateParamsResponse":
        return await self._unary_unary(
            "/band.bandtss.v1beta1.Msg/UpdateParams",
            msg_update_params,
            MsgUpdateParamsResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def transition_group(
        self,
        msg_transition_group: "MsgTransitionGroup",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "MsgTransitionGroupResponse":
        return await self._unary_unary(
            "/band.bandtss.v1beta1.Msg/TransitionGroup",
            msg_transition_group,
            MsgTransitionGroupResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def force_transition_group(
        self,
        msg_force_transition_group: "MsgForceTransitionGroup",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "MsgForceTransitionGroupResponse":
        return await self._unary_unary(
            "/band.bandtss.v1beta1.Msg/ForceTransitionGroup",
            msg_force_transition_group,
            MsgForceTransitionGroupResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )


class QueryStub(betterproto.ServiceStub):
    async def counts(
        self,
        query_counts_request: "QueryCountsRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "QueryCountsResponse":
        return await self._unary_unary(
            "/band.bandtss.v1beta1.Query/Counts",
            query_counts_request,
            QueryCountsResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def members(
        self,
        query_members_request: "QueryMembersRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "QueryMembersResponse":
        return await self._unary_unary(
            "/band.bandtss.v1beta1.Query/Members",
            query_members_request,
            QueryMembersResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def member(
        self,
        query_member_request: "QueryMemberRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "QueryMemberResponse":
        return await self._unary_unary(
            "/band.bandtss.v1beta1.Query/Member",
            query_member_request,
            QueryMemberResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def current_group(
        self,
        query_current_group_request: "QueryCurrentGroupRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "QueryCurrentGroupResponse":
        return await self._unary_unary(
            "/band.bandtss.v1beta1.Query/CurrentGroup",
            query_current_group_request,
            QueryCurrentGroupResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def incoming_group(
        self,
        query_incoming_group_request: "QueryIncomingGroupRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "QueryIncomingGroupResponse":
        return await self._unary_unary(
            "/band.bandtss.v1beta1.Query/IncomingGroup",
            query_incoming_group_request,
            QueryIncomingGroupResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def signing(
        self,
        query_signing_request: "QuerySigningRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "QuerySigningResponse":
        return await self._unary_unary(
            "/band.bandtss.v1beta1.Query/Signing",
            query_signing_request,
            QuerySigningResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def group_transition(
        self,
        query_group_transition_request: "QueryGroupTransitionRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "QueryGroupTransitionResponse":
        return await self._unary_unary(
            "/band.bandtss.v1beta1.Query/GroupTransition",
            query_group_transition_request,
            QueryGroupTransitionResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )

    async def params(
        self,
        query_params_request: "QueryParamsRequest",
        *,
        timeout: Optional[float] = None,
        deadline: Optional["Deadline"] = None,
        metadata: Optional["MetadataLike"] = None
    ) -> "QueryParamsResponse":
        return await self._unary_unary(
            "/band.bandtss.v1beta1.Query/Params",
            query_params_request,
            QueryParamsResponse,
            timeout=timeout,
            deadline=deadline,
            metadata=metadata,
        )


class MsgBase(ServiceBase):

    async def request_signature(
        self, msg_request_signature: "MsgRequestSignature"
    ) -> "MsgRequestSignatureResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def activate(self, msg_activate: "MsgActivate") -> "MsgActivateResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def update_params(
        self, msg_update_params: "MsgUpdateParams"
    ) -> "MsgUpdateParamsResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def transition_group(
        self, msg_transition_group: "MsgTransitionGroup"
    ) -> "MsgTransitionGroupResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def force_transition_group(
        self, msg_force_transition_group: "MsgForceTransitionGroup"
    ) -> "MsgForceTransitionGroupResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def __rpc_request_signature(
        self,
        stream: "grpclib.server.Stream[MsgRequestSignature, MsgRequestSignatureResponse]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.request_signature(request)
        await stream.send_message(response)

    async def __rpc_activate(
        self, stream: "grpclib.server.Stream[MsgActivate, MsgActivateResponse]"
    ) -> None:
        request = await stream.recv_message()
        response = await self.activate(request)
        await stream.send_message(response)

    async def __rpc_update_params(
        self, stream: "grpclib.server.Stream[MsgUpdateParams, MsgUpdateParamsResponse]"
    ) -> None:
        request = await stream.recv_message()
        response = await self.update_params(request)
        await stream.send_message(response)

    async def __rpc_transition_group(
        self,
        stream: "grpclib.server.Stream[MsgTransitionGroup, MsgTransitionGroupResponse]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.transition_group(request)
        await stream.send_message(response)

    async def __rpc_force_transition_group(
        self,
        stream: "grpclib.server.Stream[MsgForceTransitionGroup, MsgForceTransitionGroupResponse]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.force_transition_group(request)
        await stream.send_message(response)

    def __mapping__(self) -> Dict[str, grpclib.const.Handler]:
        return {
            "/band.bandtss.v1beta1.Msg/RequestSignature": grpclib.const.Handler(
                self.__rpc_request_signature,
                grpclib.const.Cardinality.UNARY_UNARY,
                MsgRequestSignature,
                MsgRequestSignatureResponse,
            ),
            "/band.bandtss.v1beta1.Msg/Activate": grpclib.const.Handler(
                self.__rpc_activate,
                grpclib.const.Cardinality.UNARY_UNARY,
                MsgActivate,
                MsgActivateResponse,
            ),
            "/band.bandtss.v1beta1.Msg/UpdateParams": grpclib.const.Handler(
                self.__rpc_update_params,
                grpclib.const.Cardinality.UNARY_UNARY,
                MsgUpdateParams,
                MsgUpdateParamsResponse,
            ),
            "/band.bandtss.v1beta1.Msg/TransitionGroup": grpclib.const.Handler(
                self.__rpc_transition_group,
                grpclib.const.Cardinality.UNARY_UNARY,
                MsgTransitionGroup,
                MsgTransitionGroupResponse,
            ),
            "/band.bandtss.v1beta1.Msg/ForceTransitionGroup": grpclib.const.Handler(
                self.__rpc_force_transition_group,
                grpclib.const.Cardinality.UNARY_UNARY,
                MsgForceTransitionGroup,
                MsgForceTransitionGroupResponse,
            ),
        }


class QueryBase(ServiceBase):

    async def counts(
        self, query_counts_request: "QueryCountsRequest"
    ) -> "QueryCountsResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def members(
        self, query_members_request: "QueryMembersRequest"
    ) -> "QueryMembersResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def member(
        self, query_member_request: "QueryMemberRequest"
    ) -> "QueryMemberResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def current_group(
        self, query_current_group_request: "QueryCurrentGroupRequest"
    ) -> "QueryCurrentGroupResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def incoming_group(
        self, query_incoming_group_request: "QueryIncomingGroupRequest"
    ) -> "QueryIncomingGroupResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def signing(
        self, query_signing_request: "QuerySigningRequest"
    ) -> "QuerySigningResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def group_transition(
        self, query_group_transition_request: "QueryGroupTransitionRequest"
    ) -> "QueryGroupTransitionResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def params(
        self, query_params_request: "QueryParamsRequest"
    ) -> "QueryParamsResponse":
        raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)

    async def __rpc_counts(
        self, stream: "grpclib.server.Stream[QueryCountsRequest, QueryCountsResponse]"
    ) -> None:
        request = await stream.recv_message()
        response = await self.counts(request)
        await stream.send_message(response)

    async def __rpc_members(
        self, stream: "grpclib.server.Stream[QueryMembersRequest, QueryMembersResponse]"
    ) -> None:
        request = await stream.recv_message()
        response = await self.members(request)
        await stream.send_message(response)

    async def __rpc_member(
        self, stream: "grpclib.server.Stream[QueryMemberRequest, QueryMemberResponse]"
    ) -> None:
        request = await stream.recv_message()
        response = await self.member(request)
        await stream.send_message(response)

    async def __rpc_current_group(
        self,
        stream: "grpclib.server.Stream[QueryCurrentGroupRequest, QueryCurrentGroupResponse]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.current_group(request)
        await stream.send_message(response)

    async def __rpc_incoming_group(
        self,
        stream: "grpclib.server.Stream[QueryIncomingGroupRequest, QueryIncomingGroupResponse]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.incoming_group(request)
        await stream.send_message(response)

    async def __rpc_signing(
        self, stream: "grpclib.server.Stream[QuerySigningRequest, QuerySigningResponse]"
    ) -> None:
        request = await stream.recv_message()
        response = await self.signing(request)
        await stream.send_message(response)

    async def __rpc_group_transition(
        self,
        stream: "grpclib.server.Stream[QueryGroupTransitionRequest, QueryGroupTransitionResponse]",
    ) -> None:
        request = await stream.recv_message()
        response = await self.group_transition(request)
        await stream.send_message(response)

    async def __rpc_params(
        self, stream: "grpclib.server.Stream[QueryParamsRequest, QueryParamsResponse]"
    ) -> None:
        request = await stream.recv_message()
        response = await self.params(request)
        await stream.send_message(response)

    def __mapping__(self) -> Dict[str, grpclib.const.Handler]:
        return {
            "/band.bandtss.v1beta1.Query/Counts": grpclib.const.Handler(
                self.__rpc_counts,
                grpclib.const.Cardinality.UNARY_UNARY,
                QueryCountsRequest,
                QueryCountsResponse,
            ),
            "/band.bandtss.v1beta1.Query/Members": grpclib.const.Handler(
                self.__rpc_members,
                grpclib.const.Cardinality.UNARY_UNARY,
                QueryMembersRequest,
                QueryMembersResponse,
            ),
            "/band.bandtss.v1beta1.Query/Member": grpclib.const.Handler(
                self.__rpc_member,
                grpclib.const.Cardinality.UNARY_UNARY,
                QueryMemberRequest,
                QueryMemberResponse,
            ),
            "/band.bandtss.v1beta1.Query/CurrentGroup": grpclib.const.Handler(
                self.__rpc_current_group,
                grpclib.const.Cardinality.UNARY_UNARY,
                QueryCurrentGroupRequest,
                QueryCurrentGroupResponse,
            ),
            "/band.bandtss.v1beta1.Query/IncomingGroup": grpclib.const.Handler(
                self.__rpc_incoming_group,
                grpclib.const.Cardinality.UNARY_UNARY,
                QueryIncomingGroupRequest,
                QueryIncomingGroupResponse,
            ),
            "/band.bandtss.v1beta1.Query/Signing": grpclib.const.Handler(
                self.__rpc_signing,
                grpclib.const.Cardinality.UNARY_UNARY,
                QuerySigningRequest,
                QuerySigningResponse,
            ),
            "/band.bandtss.v1beta1.Query/GroupTransition": grpclib.const.Handler(
                self.__rpc_group_transition,
                grpclib.const.Cardinality.UNARY_UNARY,
                QueryGroupTransitionRequest,
                QueryGroupTransitionResponse,
            ),
            "/band.bandtss.v1beta1.Query/Params": grpclib.const.Handler(
                self.__rpc_params,
                grpclib.const.Cardinality.UNARY_UNARY,
                QueryParamsRequest,
                QueryParamsResponse,
            ),
        }
