# 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.vault import tx_pb2 as dydxprotocol_dot_vault_dot_tx__pb2

GRPC_GENERATED_VERSION = '1.75.1'
GRPC_VERSION = grpc.__version__
_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:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in dydxprotocol/vault/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}.'
    )


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.DepositToMegavault = channel.unary_unary(
                '/dydxprotocol.vault.Msg/DepositToMegavault',
                request_serializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgDepositToMegavault.SerializeToString,
                response_deserializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgDepositToMegavaultResponse.FromString,
                _registered_method=True)
        self.WithdrawFromMegavault = channel.unary_unary(
                '/dydxprotocol.vault.Msg/WithdrawFromMegavault',
                request_serializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgWithdrawFromMegavault.SerializeToString,
                response_deserializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgWithdrawFromMegavaultResponse.FromString,
                _registered_method=True)
        self.UpdateDefaultQuotingParams = channel.unary_unary(
                '/dydxprotocol.vault.Msg/UpdateDefaultQuotingParams',
                request_serializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgUpdateDefaultQuotingParams.SerializeToString,
                response_deserializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgUpdateDefaultQuotingParamsResponse.FromString,
                _registered_method=True)
        self.UpdateOperatorParams = channel.unary_unary(
                '/dydxprotocol.vault.Msg/UpdateOperatorParams',
                request_serializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgUpdateOperatorParams.SerializeToString,
                response_deserializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgUpdateOperatorParamsResponse.FromString,
                _registered_method=True)
        self.SetVaultParams = channel.unary_unary(
                '/dydxprotocol.vault.Msg/SetVaultParams',
                request_serializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgSetVaultParams.SerializeToString,
                response_deserializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgSetVaultParamsResponse.FromString,
                _registered_method=True)
        self.UnlockShares = channel.unary_unary(
                '/dydxprotocol.vault.Msg/UnlockShares',
                request_serializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgUnlockShares.SerializeToString,
                response_deserializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgUnlockSharesResponse.FromString,
                _registered_method=True)
        self.AllocateToVault = channel.unary_unary(
                '/dydxprotocol.vault.Msg/AllocateToVault',
                request_serializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgAllocateToVault.SerializeToString,
                response_deserializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgAllocateToVaultResponse.FromString,
                _registered_method=True)
        self.RetrieveFromVault = channel.unary_unary(
                '/dydxprotocol.vault.Msg/RetrieveFromVault',
                request_serializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgRetrieveFromVault.SerializeToString,
                response_deserializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgRetrieveFromVaultResponse.FromString,
                _registered_method=True)


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

    def DepositToMegavault(self, request, context):
        """DepositToMegavault deposits funds into megavault.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def WithdrawFromMegavault(self, request, context):
        """WithdrawFromMegavault withdraws shares from megavault.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateDefaultQuotingParams(self, request, context):
        """UpdateDefaultQuotingParams updates the default quoting params in state.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateOperatorParams(self, request, context):
        """UpdateOperatorParams sets the parameters regarding megavault operator.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetVaultParams(self, request, context):
        """SetVaultParams sets the parameters of a specific vault.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UnlockShares(self, request, context):
        """UnlockShares unlocks an owner's shares that are due to unlock by the block
        height that this transaction is included in.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AllocateToVault(self, request, context):
        """AllocateToVault allocates funds from main vault to a vault.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RetrieveFromVault(self, request, context):
        """RetrieveFromVault retrieves funds from a vault to main vault.
        """
        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 = {
            'DepositToMegavault': grpc.unary_unary_rpc_method_handler(
                    servicer.DepositToMegavault,
                    request_deserializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgDepositToMegavault.FromString,
                    response_serializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgDepositToMegavaultResponse.SerializeToString,
            ),
            'WithdrawFromMegavault': grpc.unary_unary_rpc_method_handler(
                    servicer.WithdrawFromMegavault,
                    request_deserializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgWithdrawFromMegavault.FromString,
                    response_serializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgWithdrawFromMegavaultResponse.SerializeToString,
            ),
            'UpdateDefaultQuotingParams': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateDefaultQuotingParams,
                    request_deserializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgUpdateDefaultQuotingParams.FromString,
                    response_serializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgUpdateDefaultQuotingParamsResponse.SerializeToString,
            ),
            'UpdateOperatorParams': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateOperatorParams,
                    request_deserializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgUpdateOperatorParams.FromString,
                    response_serializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgUpdateOperatorParamsResponse.SerializeToString,
            ),
            'SetVaultParams': grpc.unary_unary_rpc_method_handler(
                    servicer.SetVaultParams,
                    request_deserializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgSetVaultParams.FromString,
                    response_serializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgSetVaultParamsResponse.SerializeToString,
            ),
            'UnlockShares': grpc.unary_unary_rpc_method_handler(
                    servicer.UnlockShares,
                    request_deserializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgUnlockShares.FromString,
                    response_serializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgUnlockSharesResponse.SerializeToString,
            ),
            'AllocateToVault': grpc.unary_unary_rpc_method_handler(
                    servicer.AllocateToVault,
                    request_deserializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgAllocateToVault.FromString,
                    response_serializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgAllocateToVaultResponse.SerializeToString,
            ),
            'RetrieveFromVault': grpc.unary_unary_rpc_method_handler(
                    servicer.RetrieveFromVault,
                    request_deserializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgRetrieveFromVault.FromString,
                    response_serializer=dydxprotocol_dot_vault_dot_tx__pb2.MsgRetrieveFromVaultResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'dydxprotocol.vault.Msg', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('dydxprotocol.vault.Msg', rpc_method_handlers)


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

    @staticmethod
    def DepositToMegavault(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.vault.Msg/DepositToMegavault',
            dydxprotocol_dot_vault_dot_tx__pb2.MsgDepositToMegavault.SerializeToString,
            dydxprotocol_dot_vault_dot_tx__pb2.MsgDepositToMegavaultResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def WithdrawFromMegavault(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.vault.Msg/WithdrawFromMegavault',
            dydxprotocol_dot_vault_dot_tx__pb2.MsgWithdrawFromMegavault.SerializeToString,
            dydxprotocol_dot_vault_dot_tx__pb2.MsgWithdrawFromMegavaultResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateDefaultQuotingParams(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.vault.Msg/UpdateDefaultQuotingParams',
            dydxprotocol_dot_vault_dot_tx__pb2.MsgUpdateDefaultQuotingParams.SerializeToString,
            dydxprotocol_dot_vault_dot_tx__pb2.MsgUpdateDefaultQuotingParamsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateOperatorParams(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.vault.Msg/UpdateOperatorParams',
            dydxprotocol_dot_vault_dot_tx__pb2.MsgUpdateOperatorParams.SerializeToString,
            dydxprotocol_dot_vault_dot_tx__pb2.MsgUpdateOperatorParamsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SetVaultParams(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.vault.Msg/SetVaultParams',
            dydxprotocol_dot_vault_dot_tx__pb2.MsgSetVaultParams.SerializeToString,
            dydxprotocol_dot_vault_dot_tx__pb2.MsgSetVaultParamsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UnlockShares(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.vault.Msg/UnlockShares',
            dydxprotocol_dot_vault_dot_tx__pb2.MsgUnlockShares.SerializeToString,
            dydxprotocol_dot_vault_dot_tx__pb2.MsgUnlockSharesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def AllocateToVault(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.vault.Msg/AllocateToVault',
            dydxprotocol_dot_vault_dot_tx__pb2.MsgAllocateToVault.SerializeToString,
            dydxprotocol_dot_vault_dot_tx__pb2.MsgAllocateToVaultResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def RetrieveFromVault(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.vault.Msg/RetrieveFromVault',
            dydxprotocol_dot_vault_dot_tx__pb2.MsgRetrieveFromVault.SerializeToString,
            dydxprotocol_dot_vault_dot_tx__pb2.MsgRetrieveFromVaultResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
