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

from utxorpc.v1alpha.watch import watch_pb2 as utxorpc_dot_v1alpha_dot_watch_dot_watch__pb2


class WatchServiceStub(object):
    """Service definition for watching transactions based on predicates.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.WatchTx = channel.unary_stream(
                '/utxorpc.v1alpha.watch.WatchService/WatchTx',
                request_serializer=utxorpc_dot_v1alpha_dot_watch_dot_watch__pb2.WatchTxRequest.SerializeToString,
                response_deserializer=utxorpc_dot_v1alpha_dot_watch_dot_watch__pb2.WatchTxResponse.FromString,
                _registered_method=True)


class WatchServiceServicer(object):
    """Service definition for watching transactions based on predicates.
    """

    def WatchTx(self, request, context):
        """Stream transactions from the chain matching the specified predicates.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_WatchServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'WatchTx': grpc.unary_stream_rpc_method_handler(
                    servicer.WatchTx,
                    request_deserializer=utxorpc_dot_v1alpha_dot_watch_dot_watch__pb2.WatchTxRequest.FromString,
                    response_serializer=utxorpc_dot_v1alpha_dot_watch_dot_watch__pb2.WatchTxResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'utxorpc.v1alpha.watch.WatchService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('utxorpc.v1alpha.watch.WatchService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class WatchService(object):
    """Service definition for watching transactions based on predicates.
    """

    @staticmethod
    def WatchTx(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_stream(
            request,
            target,
            '/utxorpc.v1alpha.watch.WatchService/WatchTx',
            utxorpc_dot_v1alpha_dot_watch_dot_watch__pb2.WatchTxRequest.SerializeToString,
            utxorpc_dot_v1alpha_dot_watch_dot_watch__pb2.WatchTxResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
