# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from perp.v1 import tx_pb2 as perp_dot_v1_dot_tx__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.RemoveMargin = channel.unary_unary(
            '/nibiru.perp.v1.Msg/RemoveMargin',
            request_serializer=perp_dot_v1_dot_tx__pb2.MsgRemoveMargin.SerializeToString,
            response_deserializer=perp_dot_v1_dot_tx__pb2.MsgRemoveMarginResponse.FromString,
        )
        self.AddMargin = channel.unary_unary(
            '/nibiru.perp.v1.Msg/AddMargin',
            request_serializer=perp_dot_v1_dot_tx__pb2.MsgAddMargin.SerializeToString,
            response_deserializer=perp_dot_v1_dot_tx__pb2.MsgAddMarginResponse.FromString,
        )
        self.Liquidate = channel.unary_unary(
            '/nibiru.perp.v1.Msg/Liquidate',
            request_serializer=perp_dot_v1_dot_tx__pb2.MsgLiquidate.SerializeToString,
            response_deserializer=perp_dot_v1_dot_tx__pb2.MsgLiquidateResponse.FromString,
        )
        self.OpenPosition = channel.unary_unary(
            '/nibiru.perp.v1.Msg/OpenPosition',
            request_serializer=perp_dot_v1_dot_tx__pb2.MsgOpenPosition.SerializeToString,
            response_deserializer=perp_dot_v1_dot_tx__pb2.MsgOpenPositionResponse.FromString,
        )
        self.ClosePosition = channel.unary_unary(
            '/nibiru.perp.v1.Msg/ClosePosition',
            request_serializer=perp_dot_v1_dot_tx__pb2.MsgClosePosition.SerializeToString,
            response_deserializer=perp_dot_v1_dot_tx__pb2.MsgClosePositionResponse.FromString,
        )


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

    def RemoveMargin(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AddMargin(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Liquidate(self, request, context):
        """Liquidate is a transaction that allows the caller to fully or partially
        liquidate an existing position.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def OpenPosition(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ClosePosition(self, request, context):
        """Missing associated documentation comment in .proto file."""
        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 = {
        'RemoveMargin': grpc.unary_unary_rpc_method_handler(
            servicer.RemoveMargin,
            request_deserializer=perp_dot_v1_dot_tx__pb2.MsgRemoveMargin.FromString,
            response_serializer=perp_dot_v1_dot_tx__pb2.MsgRemoveMarginResponse.SerializeToString,
        ),
        'AddMargin': grpc.unary_unary_rpc_method_handler(
            servicer.AddMargin,
            request_deserializer=perp_dot_v1_dot_tx__pb2.MsgAddMargin.FromString,
            response_serializer=perp_dot_v1_dot_tx__pb2.MsgAddMarginResponse.SerializeToString,
        ),
        'Liquidate': grpc.unary_unary_rpc_method_handler(
            servicer.Liquidate,
            request_deserializer=perp_dot_v1_dot_tx__pb2.MsgLiquidate.FromString,
            response_serializer=perp_dot_v1_dot_tx__pb2.MsgLiquidateResponse.SerializeToString,
        ),
        'OpenPosition': grpc.unary_unary_rpc_method_handler(
            servicer.OpenPosition,
            request_deserializer=perp_dot_v1_dot_tx__pb2.MsgOpenPosition.FromString,
            response_serializer=perp_dot_v1_dot_tx__pb2.MsgOpenPositionResponse.SerializeToString,
        ),
        'ClosePosition': grpc.unary_unary_rpc_method_handler(
            servicer.ClosePosition,
            request_deserializer=perp_dot_v1_dot_tx__pb2.MsgClosePosition.FromString,
            response_serializer=perp_dot_v1_dot_tx__pb2.MsgClosePositionResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler('nibiru.perp.v1.Msg', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def RemoveMargin(
        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,
            '/nibiru.perp.v1.Msg/RemoveMargin',
            perp_dot_v1_dot_tx__pb2.MsgRemoveMargin.SerializeToString,
            perp_dot_v1_dot_tx__pb2.MsgRemoveMarginResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def AddMargin(
        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,
            '/nibiru.perp.v1.Msg/AddMargin',
            perp_dot_v1_dot_tx__pb2.MsgAddMargin.SerializeToString,
            perp_dot_v1_dot_tx__pb2.MsgAddMarginResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def Liquidate(
        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,
            '/nibiru.perp.v1.Msg/Liquidate',
            perp_dot_v1_dot_tx__pb2.MsgLiquidate.SerializeToString,
            perp_dot_v1_dot_tx__pb2.MsgLiquidateResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def OpenPosition(
        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,
            '/nibiru.perp.v1.Msg/OpenPosition',
            perp_dot_v1_dot_tx__pb2.MsgOpenPosition.SerializeToString,
            perp_dot_v1_dot_tx__pb2.MsgOpenPositionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def ClosePosition(
        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,
            '/nibiru.perp.v1.Msg/ClosePosition',
            perp_dot_v1_dot_tx__pb2.MsgClosePosition.SerializeToString,
            perp_dot_v1_dot_tx__pb2.MsgClosePositionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
