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

from v4_proto.dydxprotocol.sending import transfer_pb2 as dydxprotocol_dot_sending_dot_transfer__pb2
from v4_proto.dydxprotocol.sending import tx_pb2 as dydxprotocol_dot_sending_dot_tx__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.CreateTransfer = channel.unary_unary(
                '/dydxprotocol.sending.Msg/CreateTransfer',
                request_serializer=dydxprotocol_dot_sending_dot_tx__pb2.MsgCreateTransfer.SerializeToString,
                response_deserializer=dydxprotocol_dot_sending_dot_tx__pb2.MsgCreateTransferResponse.FromString,
                )
        self.DepositToSubaccount = channel.unary_unary(
                '/dydxprotocol.sending.Msg/DepositToSubaccount',
                request_serializer=dydxprotocol_dot_sending_dot_transfer__pb2.MsgDepositToSubaccount.SerializeToString,
                response_deserializer=dydxprotocol_dot_sending_dot_tx__pb2.MsgDepositToSubaccountResponse.FromString,
                )
        self.WithdrawFromSubaccount = channel.unary_unary(
                '/dydxprotocol.sending.Msg/WithdrawFromSubaccount',
                request_serializer=dydxprotocol_dot_sending_dot_transfer__pb2.MsgWithdrawFromSubaccount.SerializeToString,
                response_deserializer=dydxprotocol_dot_sending_dot_tx__pb2.MsgWithdrawFromSubaccountResponse.FromString,
                )
        self.SendFromModuleToAccount = channel.unary_unary(
                '/dydxprotocol.sending.Msg/SendFromModuleToAccount',
                request_serializer=dydxprotocol_dot_sending_dot_transfer__pb2.MsgSendFromModuleToAccount.SerializeToString,
                response_deserializer=dydxprotocol_dot_sending_dot_tx__pb2.MsgSendFromModuleToAccountResponse.FromString,
                )


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

    def CreateTransfer(self, request, context):
        """CreateTransfer initiates a new transfer between subaccounts.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DepositToSubaccount(self, request, context):
        """DepositToSubaccount initiates a new transfer from an `x/bank` account
        to an `x/subaccounts` subaccount.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def WithdrawFromSubaccount(self, request, context):
        """WithdrawFromSubaccount initiates a new transfer from an `x/subaccounts`
        subaccount to an `x/bank` account.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SendFromModuleToAccount(self, request, context):
        """SendFromModuleToAccount initiates a new transfer from a module to an
        `x/bank` account (should only be executed by governance).
        """
        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 = {
            'CreateTransfer': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateTransfer,
                    request_deserializer=dydxprotocol_dot_sending_dot_tx__pb2.MsgCreateTransfer.FromString,
                    response_serializer=dydxprotocol_dot_sending_dot_tx__pb2.MsgCreateTransferResponse.SerializeToString,
            ),
            'DepositToSubaccount': grpc.unary_unary_rpc_method_handler(
                    servicer.DepositToSubaccount,
                    request_deserializer=dydxprotocol_dot_sending_dot_transfer__pb2.MsgDepositToSubaccount.FromString,
                    response_serializer=dydxprotocol_dot_sending_dot_tx__pb2.MsgDepositToSubaccountResponse.SerializeToString,
            ),
            'WithdrawFromSubaccount': grpc.unary_unary_rpc_method_handler(
                    servicer.WithdrawFromSubaccount,
                    request_deserializer=dydxprotocol_dot_sending_dot_transfer__pb2.MsgWithdrawFromSubaccount.FromString,
                    response_serializer=dydxprotocol_dot_sending_dot_tx__pb2.MsgWithdrawFromSubaccountResponse.SerializeToString,
            ),
            'SendFromModuleToAccount': grpc.unary_unary_rpc_method_handler(
                    servicer.SendFromModuleToAccount,
                    request_deserializer=dydxprotocol_dot_sending_dot_transfer__pb2.MsgSendFromModuleToAccount.FromString,
                    response_serializer=dydxprotocol_dot_sending_dot_tx__pb2.MsgSendFromModuleToAccountResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'dydxprotocol.sending.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 Msg service.
    """

    @staticmethod
    def CreateTransfer(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.sending.Msg/CreateTransfer',
            dydxprotocol_dot_sending_dot_tx__pb2.MsgCreateTransfer.SerializeToString,
            dydxprotocol_dot_sending_dot_tx__pb2.MsgCreateTransferResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DepositToSubaccount(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.sending.Msg/DepositToSubaccount',
            dydxprotocol_dot_sending_dot_transfer__pb2.MsgDepositToSubaccount.SerializeToString,
            dydxprotocol_dot_sending_dot_tx__pb2.MsgDepositToSubaccountResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def WithdrawFromSubaccount(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.sending.Msg/WithdrawFromSubaccount',
            dydxprotocol_dot_sending_dot_transfer__pb2.MsgWithdrawFromSubaccount.SerializeToString,
            dydxprotocol_dot_sending_dot_tx__pb2.MsgWithdrawFromSubaccountResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SendFromModuleToAccount(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.sending.Msg/SendFromModuleToAccount',
            dydxprotocol_dot_sending_dot_transfer__pb2.MsgSendFromModuleToAccount.SerializeToString,
            dydxprotocol_dot_sending_dot_tx__pb2.MsgSendFromModuleToAccountResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
