# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from signrpc import signer_pb2 as signrpc_dot_signer__pb2


class SignerStub(object):
  # missing associated documentation comment in .proto file
  pass

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

    Args:
      channel: A grpc.Channel.
    """
    self.SignOutputRaw = channel.unary_unary(
        '/signrpc.Signer/SignOutputRaw',
        request_serializer=signrpc_dot_signer__pb2.SignReq.SerializeToString,
        response_deserializer=signrpc_dot_signer__pb2.SignResp.FromString,
        )
    self.ComputeInputScript = channel.unary_unary(
        '/signrpc.Signer/ComputeInputScript',
        request_serializer=signrpc_dot_signer__pb2.SignReq.SerializeToString,
        response_deserializer=signrpc_dot_signer__pb2.InputScriptResp.FromString,
        )


class SignerServicer(object):
  # missing associated documentation comment in .proto file
  pass

  def SignOutputRaw(self, request, context):
    """*
    SignOutputRaw is a method that can be used to generated a signature for a
    set of inputs/outputs to a transaction. Each request specifies details
    concerning how the outputs should be signed, which keys they should be
    signed with, and also any optional tweaks. The return value is a fixed
    64-byte signature (the same format as we use on the wire in Lightning). 

    If we are  unable to sign using the specified keys, then an error will be
    returned.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def ComputeInputScript(self, request, context):
    """*
    ComputeInputScript generates a complete InputIndex for the passed
    transaction with the signature as defined within the passed SignDescriptor.
    This method should be capable of generating the proper input script for
    both regular p2wkh output and p2wkh outputs nested within a regular p2sh
    output.

    Note that when using this method to sign inputs belonging to the wallet,
    the only items of the SignDescriptor that need to be populated are pkScript
    in the TxOut field, the value in that same field, and finally the input
    index.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_SignerServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'SignOutputRaw': grpc.unary_unary_rpc_method_handler(
          servicer.SignOutputRaw,
          request_deserializer=signrpc_dot_signer__pb2.SignReq.FromString,
          response_serializer=signrpc_dot_signer__pb2.SignResp.SerializeToString,
      ),
      'ComputeInputScript': grpc.unary_unary_rpc_method_handler(
          servicer.ComputeInputScript,
          request_deserializer=signrpc_dot_signer__pb2.SignReq.FromString,
          response_serializer=signrpc_dot_signer__pb2.InputScriptResp.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'signrpc.Signer', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
