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

from . import account_info_pb2 as account__info__pb2
from . import fee_pb2 as fee__pb2
from . import get_account_info_request_pb2 as get__account__info__request__pb2
from . import get_fee_request_pb2 as get__fee__request__pb2
from . import get_latest_validated_ledger_sequence_request_pb2 as get__latest__validated__ledger__sequence__request__pb2
from . import get_transaction_status_request_pb2 as get__transaction__status__request__pb2
from . import ledger_sequence_pb2 as ledger__sequence__pb2
from . import submit_signed_transaction_request_pb2 as submit__signed__transaction__request__pb2
from . import submit_signed_transaction_response_pb2 as submit__signed__transaction__response__pb2
from . import transaction_status_pb2 as transaction__status__pb2


class XRPLedgerAPIStub(object):
  """RPCs available to interact with the XRP Ledger.
  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.GetAccountInfo = channel.unary_unary(
        '/io.xpring.XRPLedgerAPI/GetAccountInfo',
        request_serializer=get__account__info__request__pb2.GetAccountInfoRequest.SerializeToString,
        response_deserializer=account__info__pb2.AccountInfo.FromString,
        )
    self.GetFee = channel.unary_unary(
        '/io.xpring.XRPLedgerAPI/GetFee',
        request_serializer=get__fee__request__pb2.GetFeeRequest.SerializeToString,
        response_deserializer=fee__pb2.Fee.FromString,
        )
    self.SubmitSignedTransaction = channel.unary_unary(
        '/io.xpring.XRPLedgerAPI/SubmitSignedTransaction',
        request_serializer=submit__signed__transaction__request__pb2.SubmitSignedTransactionRequest.SerializeToString,
        response_deserializer=submit__signed__transaction__response__pb2.SubmitSignedTransactionResponse.FromString,
        )
    self.GetTransactionStatus = channel.unary_unary(
        '/io.xpring.XRPLedgerAPI/GetTransactionStatus',
        request_serializer=get__transaction__status__request__pb2.GetTransactionStatusRequest.SerializeToString,
        response_deserializer=transaction__status__pb2.TransactionStatus.FromString,
        )
    self.GetLatestValidatedLedgerSequence = channel.unary_unary(
        '/io.xpring.XRPLedgerAPI/GetLatestValidatedLedgerSequence',
        request_serializer=get__latest__validated__ledger__sequence__request__pb2.GetLatestValidatedLedgerSequenceRequest.SerializeToString,
        response_deserializer=ledger__sequence__pb2.LedgerSequence.FromString,
        )


class XRPLedgerAPIServicer(object):
  """RPCs available to interact with the XRP Ledger.
  """

  def GetAccountInfo(self, request, context):
    """Get account info for an account on the XRP Ledger.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetFee(self, request, context):
    """Get the fee for a transaction on the XRP Ledger.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubmitSignedTransaction(self, request, context):
    """Submit a signed transaction to the XRP Ledger.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetTransactionStatus(self, request, context):
    """Get the status of a transaction on the XRP Ledger.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetLatestValidatedLedgerSequence(self, request, context):
    """Get the latest validated ledger sequence.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_XRPLedgerAPIServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'GetAccountInfo': grpc.unary_unary_rpc_method_handler(
          servicer.GetAccountInfo,
          request_deserializer=get__account__info__request__pb2.GetAccountInfoRequest.FromString,
          response_serializer=account__info__pb2.AccountInfo.SerializeToString,
      ),
      'GetFee': grpc.unary_unary_rpc_method_handler(
          servicer.GetFee,
          request_deserializer=get__fee__request__pb2.GetFeeRequest.FromString,
          response_serializer=fee__pb2.Fee.SerializeToString,
      ),
      'SubmitSignedTransaction': grpc.unary_unary_rpc_method_handler(
          servicer.SubmitSignedTransaction,
          request_deserializer=submit__signed__transaction__request__pb2.SubmitSignedTransactionRequest.FromString,
          response_serializer=submit__signed__transaction__response__pb2.SubmitSignedTransactionResponse.SerializeToString,
      ),
      'GetTransactionStatus': grpc.unary_unary_rpc_method_handler(
          servicer.GetTransactionStatus,
          request_deserializer=get__transaction__status__request__pb2.GetTransactionStatusRequest.FromString,
          response_serializer=transaction__status__pb2.TransactionStatus.SerializeToString,
      ),
      'GetLatestValidatedLedgerSequence': grpc.unary_unary_rpc_method_handler(
          servicer.GetLatestValidatedLedgerSequence,
          request_deserializer=get__latest__validated__ledger__sequence__request__pb2.GetLatestValidatedLedgerSequenceRequest.FromString,
          response_serializer=ledger__sequence__pb2.LedgerSequence.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'io.xpring.XRPLedgerAPI', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
