# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings

from v4_proto.dydxprotocol.clob import tx_pb2 as dydxprotocol_dot_clob_dot_tx__pb2

GRPC_GENERATED_VERSION = '1.64.1'
GRPC_VERSION = grpc.__version__
EXPECTED_ERROR_RELEASE = '1.65.0'
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    warnings.warn(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in dydxprotocol/clob/tx_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
        + f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
        + f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
        RuntimeWarning
    )


class MsgStub(object):
    """Msg defines the Msg service.
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.ProposedOperations = channel.unary_unary(
                '/dydxprotocol.clob.Msg/ProposedOperations',
                request_serializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgProposedOperations.SerializeToString,
                response_deserializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgProposedOperationsResponse.FromString,
                _registered_method=True)
        self.PlaceOrder = channel.unary_unary(
                '/dydxprotocol.clob.Msg/PlaceOrder',
                request_serializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgPlaceOrder.SerializeToString,
                response_deserializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgPlaceOrderResponse.FromString,
                _registered_method=True)
        self.CancelOrder = channel.unary_unary(
                '/dydxprotocol.clob.Msg/CancelOrder',
                request_serializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgCancelOrder.SerializeToString,
                response_deserializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgCancelOrderResponse.FromString,
                _registered_method=True)
        self.BatchCancel = channel.unary_unary(
                '/dydxprotocol.clob.Msg/BatchCancel',
                request_serializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgBatchCancel.SerializeToString,
                response_deserializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgBatchCancelResponse.FromString,
                _registered_method=True)
        self.CreateClobPair = channel.unary_unary(
                '/dydxprotocol.clob.Msg/CreateClobPair',
                request_serializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgCreateClobPair.SerializeToString,
                response_deserializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgCreateClobPairResponse.FromString,
                _registered_method=True)
        self.UpdateClobPair = channel.unary_unary(
                '/dydxprotocol.clob.Msg/UpdateClobPair',
                request_serializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateClobPair.SerializeToString,
                response_deserializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateClobPairResponse.FromString,
                _registered_method=True)
        self.UpdateEquityTierLimitConfiguration = channel.unary_unary(
                '/dydxprotocol.clob.Msg/UpdateEquityTierLimitConfiguration',
                request_serializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateEquityTierLimitConfiguration.SerializeToString,
                response_deserializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateEquityTierLimitConfigurationResponse.FromString,
                _registered_method=True)
        self.UpdateBlockRateLimitConfiguration = channel.unary_unary(
                '/dydxprotocol.clob.Msg/UpdateBlockRateLimitConfiguration',
                request_serializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateBlockRateLimitConfiguration.SerializeToString,
                response_deserializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateBlockRateLimitConfigurationResponse.FromString,
                _registered_method=True)
        self.UpdateLiquidationsConfig = channel.unary_unary(
                '/dydxprotocol.clob.Msg/UpdateLiquidationsConfig',
                request_serializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateLiquidationsConfig.SerializeToString,
                response_deserializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateLiquidationsConfigResponse.FromString,
                _registered_method=True)


class MsgServicer(object):
    """Msg defines the Msg service.
    """

    def ProposedOperations(self, request, context):
        """ProposedOperations is a temporary message used by block proposers
        for matching orders as part of the ABCI++ workaround.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PlaceOrder(self, request, context):
        """PlaceOrder allows accounts to place orders on the orderbook.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CancelOrder(self, request, context):
        """CancelOrder allows accounts to cancel existing orders on the orderbook.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def BatchCancel(self, request, context):
        """BatchCancel allows accounts to cancel a batch of orders on the orderbook.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CreateClobPair(self, request, context):
        """CreateClobPair creates a new clob pair.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateClobPair(self, request, context):
        """UpdateClobPair sets the status of a clob pair. Should return an error
        if the authority is not in the clob keeper's set of authorities,
        if the ClobPair id is not found in state, or if the update includes
        an unsupported status transition.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateEquityTierLimitConfiguration(self, request, context):
        """UpdateEquityTierLimitConfiguration updates the equity tier limit
        configuration in state.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateBlockRateLimitConfiguration(self, request, context):
        """UpdateBlockRateLimitConfiguration updates the block rate limit
        configuration in state.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateLiquidationsConfig(self, request, context):
        """UpdateLiquidationsConfig updates the liquidations configuration in state.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_MsgServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ProposedOperations': grpc.unary_unary_rpc_method_handler(
                    servicer.ProposedOperations,
                    request_deserializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgProposedOperations.FromString,
                    response_serializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgProposedOperationsResponse.SerializeToString,
            ),
            'PlaceOrder': grpc.unary_unary_rpc_method_handler(
                    servicer.PlaceOrder,
                    request_deserializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgPlaceOrder.FromString,
                    response_serializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgPlaceOrderResponse.SerializeToString,
            ),
            'CancelOrder': grpc.unary_unary_rpc_method_handler(
                    servicer.CancelOrder,
                    request_deserializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgCancelOrder.FromString,
                    response_serializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgCancelOrderResponse.SerializeToString,
            ),
            'BatchCancel': grpc.unary_unary_rpc_method_handler(
                    servicer.BatchCancel,
                    request_deserializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgBatchCancel.FromString,
                    response_serializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgBatchCancelResponse.SerializeToString,
            ),
            'CreateClobPair': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateClobPair,
                    request_deserializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgCreateClobPair.FromString,
                    response_serializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgCreateClobPairResponse.SerializeToString,
            ),
            'UpdateClobPair': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateClobPair,
                    request_deserializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateClobPair.FromString,
                    response_serializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateClobPairResponse.SerializeToString,
            ),
            'UpdateEquityTierLimitConfiguration': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateEquityTierLimitConfiguration,
                    request_deserializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateEquityTierLimitConfiguration.FromString,
                    response_serializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateEquityTierLimitConfigurationResponse.SerializeToString,
            ),
            'UpdateBlockRateLimitConfiguration': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateBlockRateLimitConfiguration,
                    request_deserializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateBlockRateLimitConfiguration.FromString,
                    response_serializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateBlockRateLimitConfigurationResponse.SerializeToString,
            ),
            'UpdateLiquidationsConfig': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateLiquidationsConfig,
                    request_deserializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateLiquidationsConfig.FromString,
                    response_serializer=dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateLiquidationsConfigResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'dydxprotocol.clob.Msg', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('dydxprotocol.clob.Msg', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class Msg(object):
    """Msg defines the Msg service.
    """

    @staticmethod
    def ProposedOperations(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/dydxprotocol.clob.Msg/ProposedOperations',
            dydxprotocol_dot_clob_dot_tx__pb2.MsgProposedOperations.SerializeToString,
            dydxprotocol_dot_clob_dot_tx__pb2.MsgProposedOperationsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PlaceOrder(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/dydxprotocol.clob.Msg/PlaceOrder',
            dydxprotocol_dot_clob_dot_tx__pb2.MsgPlaceOrder.SerializeToString,
            dydxprotocol_dot_clob_dot_tx__pb2.MsgPlaceOrderResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CancelOrder(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/dydxprotocol.clob.Msg/CancelOrder',
            dydxprotocol_dot_clob_dot_tx__pb2.MsgCancelOrder.SerializeToString,
            dydxprotocol_dot_clob_dot_tx__pb2.MsgCancelOrderResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def BatchCancel(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/dydxprotocol.clob.Msg/BatchCancel',
            dydxprotocol_dot_clob_dot_tx__pb2.MsgBatchCancel.SerializeToString,
            dydxprotocol_dot_clob_dot_tx__pb2.MsgBatchCancelResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CreateClobPair(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/dydxprotocol.clob.Msg/CreateClobPair',
            dydxprotocol_dot_clob_dot_tx__pb2.MsgCreateClobPair.SerializeToString,
            dydxprotocol_dot_clob_dot_tx__pb2.MsgCreateClobPairResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateClobPair(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/dydxprotocol.clob.Msg/UpdateClobPair',
            dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateClobPair.SerializeToString,
            dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateClobPairResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateEquityTierLimitConfiguration(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/dydxprotocol.clob.Msg/UpdateEquityTierLimitConfiguration',
            dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateEquityTierLimitConfiguration.SerializeToString,
            dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateEquityTierLimitConfigurationResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateBlockRateLimitConfiguration(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/dydxprotocol.clob.Msg/UpdateBlockRateLimitConfiguration',
            dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateBlockRateLimitConfiguration.SerializeToString,
            dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateBlockRateLimitConfigurationResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateLiquidationsConfig(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/dydxprotocol.clob.Msg/UpdateLiquidationsConfig',
            dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateLiquidationsConfig.SerializeToString,
            dydxprotocol_dot_clob_dot_tx__pb2.MsgUpdateLiquidationsConfigResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
