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

from . import xurpc_pb2 as xurpc__pb2


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

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

    Args:
      channel: A grpc.Channel.
    """
    self.AddCurrency = channel.unary_unary(
        '/xudrpc.Xud/AddCurrency',
        request_serializer=xurpc__pb2.AddCurrencyRequest.SerializeToString,
        response_deserializer=xurpc__pb2.AddCurrencyResponse.FromString,
        )
    self.AddPair = channel.unary_unary(
        '/xudrpc.Xud/AddPair',
        request_serializer=xurpc__pb2.AddPairRequest.SerializeToString,
        response_deserializer=xurpc__pb2.AddPairResponse.FromString,
        )
    self.RemoveOrder = channel.unary_unary(
        '/xudrpc.Xud/RemoveOrder',
        request_serializer=xurpc__pb2.RemoveOrderRequest.SerializeToString,
        response_deserializer=xurpc__pb2.RemoveOrderResponse.FromString,
        )
    self.ChannelBalance = channel.unary_unary(
        '/xudrpc.Xud/ChannelBalance',
        request_serializer=xurpc__pb2.ChannelBalanceRequest.SerializeToString,
        response_deserializer=xurpc__pb2.ChannelBalanceResponse.FromString,
        )
    self.Connect = channel.unary_unary(
        '/xudrpc.Xud/Connect',
        request_serializer=xurpc__pb2.ConnectRequest.SerializeToString,
        response_deserializer=xurpc__pb2.ConnectResponse.FromString,
        )
    self.Ban = channel.unary_unary(
        '/xudrpc.Xud/Ban',
        request_serializer=xurpc__pb2.BanRequest.SerializeToString,
        response_deserializer=xurpc__pb2.BanResponse.FromString,
        )
    self.Unban = channel.unary_unary(
        '/xudrpc.Xud/Unban',
        request_serializer=xurpc__pb2.UnbanRequest.SerializeToString,
        response_deserializer=xurpc__pb2.UnbanResponse.FromString,
        )
    self.GetInfo = channel.unary_unary(
        '/xudrpc.Xud/GetInfo',
        request_serializer=xurpc__pb2.GetInfoRequest.SerializeToString,
        response_deserializer=xurpc__pb2.GetInfoResponse.FromString,
        )
    self.GetNodeInfo = channel.unary_unary(
        '/xudrpc.Xud/GetNodeInfo',
        request_serializer=xurpc__pb2.GetNodeInfoRequest.SerializeToString,
        response_deserializer=xurpc__pb2.GetNodeInfoResponse.FromString,
        )
    self.ListOrders = channel.unary_unary(
        '/xudrpc.Xud/ListOrders',
        request_serializer=xurpc__pb2.ListOrdersRequest.SerializeToString,
        response_deserializer=xurpc__pb2.ListOrdersResponse.FromString,
        )
    self.ListCurrencies = channel.unary_unary(
        '/xudrpc.Xud/ListCurrencies',
        request_serializer=xurpc__pb2.ListCurrenciesRequest.SerializeToString,
        response_deserializer=xurpc__pb2.ListCurrenciesResponse.FromString,
        )
    self.ListPairs = channel.unary_unary(
        '/xudrpc.Xud/ListPairs',
        request_serializer=xurpc__pb2.ListPairsRequest.SerializeToString,
        response_deserializer=xurpc__pb2.ListPairsResponse.FromString,
        )
    self.ListPeers = channel.unary_unary(
        '/xudrpc.Xud/ListPeers',
        request_serializer=xurpc__pb2.ListPeersRequest.SerializeToString,
        response_deserializer=xurpc__pb2.ListPeersResponse.FromString,
        )
    self.PlaceOrder = channel.unary_stream(
        '/xudrpc.Xud/PlaceOrder',
        request_serializer=xurpc__pb2.PlaceOrderRequest.SerializeToString,
        response_deserializer=xurpc__pb2.PlaceOrderEvent.FromString,
        )
    self.PlaceOrderSync = channel.unary_unary(
        '/xudrpc.Xud/PlaceOrderSync',
        request_serializer=xurpc__pb2.PlaceOrderRequest.SerializeToString,
        response_deserializer=xurpc__pb2.PlaceOrderResponse.FromString,
        )
    self.ExecuteSwap = channel.unary_unary(
        '/xudrpc.Xud/ExecuteSwap',
        request_serializer=xurpc__pb2.ExecuteSwapRequest.SerializeToString,
        response_deserializer=xurpc__pb2.SwapSuccess.FromString,
        )
    self.RemoveCurrency = channel.unary_unary(
        '/xudrpc.Xud/RemoveCurrency',
        request_serializer=xurpc__pb2.RemoveCurrencyRequest.SerializeToString,
        response_deserializer=xurpc__pb2.RemoveCurrencyResponse.FromString,
        )
    self.RemovePair = channel.unary_unary(
        '/xudrpc.Xud/RemovePair',
        request_serializer=xurpc__pb2.RemovePairRequest.SerializeToString,
        response_deserializer=xurpc__pb2.RemovePairResponse.FromString,
        )
    self.Shutdown = channel.unary_unary(
        '/xudrpc.Xud/Shutdown',
        request_serializer=xurpc__pb2.ShutdownRequest.SerializeToString,
        response_deserializer=xurpc__pb2.ShutdownResponse.FromString,
        )
    self.SubscribeAddedOrders = channel.unary_stream(
        '/xudrpc.Xud/SubscribeAddedOrders',
        request_serializer=xurpc__pb2.SubscribeAddedOrdersRequest.SerializeToString,
        response_deserializer=xurpc__pb2.Order.FromString,
        )
    self.SubscribeRemovedOrders = channel.unary_stream(
        '/xudrpc.Xud/SubscribeRemovedOrders',
        request_serializer=xurpc__pb2.SubscribeRemovedOrdersRequest.SerializeToString,
        response_deserializer=xurpc__pb2.OrderRemoval.FromString,
        )
    self.SubscribeSwaps = channel.unary_stream(
        '/xudrpc.Xud/SubscribeSwaps',
        request_serializer=xurpc__pb2.SubscribeSwapsRequest.SerializeToString,
        response_deserializer=xurpc__pb2.SwapSuccess.FromString,
        )
    self.SubscribeSwapFailures = channel.unary_stream(
        '/xudrpc.Xud/SubscribeSwapFailures',
        request_serializer=xurpc__pb2.SubscribeSwapsRequest.SerializeToString,
        response_deserializer=xurpc__pb2.SwapFailure.FromString,
        )


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

  def AddCurrency(self, request, context):
    """Adds a currency to the list of supported currencies. Once added, the currency may be used for
    new trading pairs. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def AddPair(self, request, context):
    """Adds a trading pair to the list of supported trading pairs. The newly supported pair is
    advertised to peers so they may begin sending orders for it. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def RemoveOrder(self, request, context):
    """Removes an order from the order book by its local id. This should be called when an order is
    canceled or filled outside of xud. Removed orders become immediately unavailable for swaps,
    and peers are notified that the order is no longer valid. Any portion of the order that is
    on hold due to ongoing swaps will not be removed until after the swap attempts complete. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def ChannelBalance(self, request, context):
    """Gets the total balance available across all payment channels for one or all currencies. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Connect(self, request, context):
    """Attempts to connect to a node. Once connected, the node is added to the list of peers and
    becomes available for swaps and trading. A handshake exchanges information about the peer's
    supported trading and swap clients. Orders will be shared with the peer upon connection and
    upon new order placements.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Ban(self, request, context):
    """Bans a node and immediately disconnects from it. This can be used to prevent any connections
    to a specific node.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Unban(self, request, context):
    """Removes a ban from a node manually and, optionally, attempts to connect to it. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetInfo(self, request, context):
    """Gets general information about this node. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetNodeInfo(self, request, context):
    """Gets general information about a node. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def ListOrders(self, request, context):
    """Gets orders from the order book. This call returns the state of the order book at a given point
    in time, although it is not guaranteed to still be vaild by the time a response is received
    and processed by a client. It accepts an optional trading pair id parameter. If specified, only
    orders for that particular trading pair are returned. Otherwise, all orders are returned. Orders
    are separated into buys and sells for each trading pair, but unsorted. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def ListCurrencies(self, request, context):
    """Gets a list of this node's supported currencies. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def ListPairs(self, request, context):
    """Gets a list of this nodes suported trading pairs. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def ListPeers(self, request, context):
    """Gets a list of connected peers. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def PlaceOrder(self, request, context):
    """Adds an order to the order book.
    If price is zero or unspecified a market order will get added. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def PlaceOrderSync(self, request, context):
    """The synchronous non-streaming version of PlaceOrder. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def ExecuteSwap(self, request, context):
    """Execute a swap on a maker peer order 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def RemoveCurrency(self, request, context):
    """Removes a currency from the list of supported currencies. Only currencies that are not in use
    for any currently supported trading pairs may be removed. Once removed, the currency can no
    longer be used for any supported trading pairs. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def RemovePair(self, request, context):
    """Removes a trading pair from the list of currently supported trading pair. This call will
    effectively cancel any standing orders for that trading pair. Peers are informed when a pair
    is no longer supported so that they will know to stop sending orders for it. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Shutdown(self, request, context):
    """Begin gracefully shutting down xud. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeAddedOrders(self, request, context):
    """Subscribes to orders being added to the order book. This call, together with SubscribeRemovedOrders,
    allows the client to maintain an up-to-date view of the order book. For example, an exchange that
    wants to show its users a real time list of the orders available to them would subscribe to this
    streaming call to be alerted of new orders as they become available for trading. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeRemovedOrders(self, request, context):
    """Subscribes to orders being removed - either in full or in part - from the order book. This call,
    together with SubscribeAddedOrders, allows the client to maintain an up-to-date view of the order
    book. For example, an exchange that wants to show its users a real time list of the orders available
    to them would subscribe to this streaming call to be alerted when part or all of an existing order
    is no longer available for trading. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeSwaps(self, request, context):
    """Subscribes to completed swaps. By default, only swaps that are initiated by a remote peer are
    transmitted unless a flag is set to include swaps initiated by the local node. This call allows
    the client to get real-time notifications when its orders are filled by a peer. It can be used
    for tracking order executions, updating balances, and informing a trader when one of their orders
    is settled through the Exchange Union network. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeSwapFailures(self, request, context):
    """Subscribes to failed swaps. By default, only swaps that are initiated by a remote peer are
    transmitted unless a flag is set to include swaps initiated by the local node. This call allows
    the client to get real-time notifications when swap attempts are failing. It can be used for
    status monitoring, debugging, and testing purposes. 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_XudServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'AddCurrency': grpc.unary_unary_rpc_method_handler(
          servicer.AddCurrency,
          request_deserializer=xurpc__pb2.AddCurrencyRequest.FromString,
          response_serializer=xurpc__pb2.AddCurrencyResponse.SerializeToString,
      ),
      'AddPair': grpc.unary_unary_rpc_method_handler(
          servicer.AddPair,
          request_deserializer=xurpc__pb2.AddPairRequest.FromString,
          response_serializer=xurpc__pb2.AddPairResponse.SerializeToString,
      ),
      'RemoveOrder': grpc.unary_unary_rpc_method_handler(
          servicer.RemoveOrder,
          request_deserializer=xurpc__pb2.RemoveOrderRequest.FromString,
          response_serializer=xurpc__pb2.RemoveOrderResponse.SerializeToString,
      ),
      'ChannelBalance': grpc.unary_unary_rpc_method_handler(
          servicer.ChannelBalance,
          request_deserializer=xurpc__pb2.ChannelBalanceRequest.FromString,
          response_serializer=xurpc__pb2.ChannelBalanceResponse.SerializeToString,
      ),
      'Connect': grpc.unary_unary_rpc_method_handler(
          servicer.Connect,
          request_deserializer=xurpc__pb2.ConnectRequest.FromString,
          response_serializer=xurpc__pb2.ConnectResponse.SerializeToString,
      ),
      'Ban': grpc.unary_unary_rpc_method_handler(
          servicer.Ban,
          request_deserializer=xurpc__pb2.BanRequest.FromString,
          response_serializer=xurpc__pb2.BanResponse.SerializeToString,
      ),
      'Unban': grpc.unary_unary_rpc_method_handler(
          servicer.Unban,
          request_deserializer=xurpc__pb2.UnbanRequest.FromString,
          response_serializer=xurpc__pb2.UnbanResponse.SerializeToString,
      ),
      'GetInfo': grpc.unary_unary_rpc_method_handler(
          servicer.GetInfo,
          request_deserializer=xurpc__pb2.GetInfoRequest.FromString,
          response_serializer=xurpc__pb2.GetInfoResponse.SerializeToString,
      ),
      'GetNodeInfo': grpc.unary_unary_rpc_method_handler(
          servicer.GetNodeInfo,
          request_deserializer=xurpc__pb2.GetNodeInfoRequest.FromString,
          response_serializer=xurpc__pb2.GetNodeInfoResponse.SerializeToString,
      ),
      'ListOrders': grpc.unary_unary_rpc_method_handler(
          servicer.ListOrders,
          request_deserializer=xurpc__pb2.ListOrdersRequest.FromString,
          response_serializer=xurpc__pb2.ListOrdersResponse.SerializeToString,
      ),
      'ListCurrencies': grpc.unary_unary_rpc_method_handler(
          servicer.ListCurrencies,
          request_deserializer=xurpc__pb2.ListCurrenciesRequest.FromString,
          response_serializer=xurpc__pb2.ListCurrenciesResponse.SerializeToString,
      ),
      'ListPairs': grpc.unary_unary_rpc_method_handler(
          servicer.ListPairs,
          request_deserializer=xurpc__pb2.ListPairsRequest.FromString,
          response_serializer=xurpc__pb2.ListPairsResponse.SerializeToString,
      ),
      'ListPeers': grpc.unary_unary_rpc_method_handler(
          servicer.ListPeers,
          request_deserializer=xurpc__pb2.ListPeersRequest.FromString,
          response_serializer=xurpc__pb2.ListPeersResponse.SerializeToString,
      ),
      'PlaceOrder': grpc.unary_stream_rpc_method_handler(
          servicer.PlaceOrder,
          request_deserializer=xurpc__pb2.PlaceOrderRequest.FromString,
          response_serializer=xurpc__pb2.PlaceOrderEvent.SerializeToString,
      ),
      'PlaceOrderSync': grpc.unary_unary_rpc_method_handler(
          servicer.PlaceOrderSync,
          request_deserializer=xurpc__pb2.PlaceOrderRequest.FromString,
          response_serializer=xurpc__pb2.PlaceOrderResponse.SerializeToString,
      ),
      'ExecuteSwap': grpc.unary_unary_rpc_method_handler(
          servicer.ExecuteSwap,
          request_deserializer=xurpc__pb2.ExecuteSwapRequest.FromString,
          response_serializer=xurpc__pb2.SwapSuccess.SerializeToString,
      ),
      'RemoveCurrency': grpc.unary_unary_rpc_method_handler(
          servicer.RemoveCurrency,
          request_deserializer=xurpc__pb2.RemoveCurrencyRequest.FromString,
          response_serializer=xurpc__pb2.RemoveCurrencyResponse.SerializeToString,
      ),
      'RemovePair': grpc.unary_unary_rpc_method_handler(
          servicer.RemovePair,
          request_deserializer=xurpc__pb2.RemovePairRequest.FromString,
          response_serializer=xurpc__pb2.RemovePairResponse.SerializeToString,
      ),
      'Shutdown': grpc.unary_unary_rpc_method_handler(
          servicer.Shutdown,
          request_deserializer=xurpc__pb2.ShutdownRequest.FromString,
          response_serializer=xurpc__pb2.ShutdownResponse.SerializeToString,
      ),
      'SubscribeAddedOrders': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeAddedOrders,
          request_deserializer=xurpc__pb2.SubscribeAddedOrdersRequest.FromString,
          response_serializer=xurpc__pb2.Order.SerializeToString,
      ),
      'SubscribeRemovedOrders': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeRemovedOrders,
          request_deserializer=xurpc__pb2.SubscribeRemovedOrdersRequest.FromString,
          response_serializer=xurpc__pb2.OrderRemoval.SerializeToString,
      ),
      'SubscribeSwaps': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeSwaps,
          request_deserializer=xurpc__pb2.SubscribeSwapsRequest.FromString,
          response_serializer=xurpc__pb2.SwapSuccess.SerializeToString,
      ),
      'SubscribeSwapFailures': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeSwapFailures,
          request_deserializer=xurpc__pb2.SubscribeSwapsRequest.FromString,
          response_serializer=xurpc__pb2.SwapFailure.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'xudrpc.Xud', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
