Package nxt.ce

Class CoinExchange

java.lang.Object
nxt.ce.CoinExchange

public final class CoinExchange extends Object
Coin exchange home
  • Field Details

  • Method Details

    • addListener

      public static boolean addListener(Listener<CoinExchange.Trade> listener, CoinExchange.Event eventType)
    • removeListener

      public static boolean removeListener(Listener<CoinExchange.Trade> listener, CoinExchange.Event eventType)
    • init

      public static void init()
    • getOrderCount

      public static int getOrderCount()
      Return the number of coin exchange orders
      Returns:
      Order count
    • getOrder

      public static CoinExchange.Order getOrder(long orderId)
      Return a coin exchange order
      Parameters:
      orderId - Order identifier
      Returns:
      Coin exchange order or null if not found
    • getOrders

      public static DbIterator<CoinExchange.Order> getOrders(long accountId, int chainId, int exchangeId, int from, int to)
      Return orders matching the supplied criteria. All orders will be returned if no search criteria are provided. The returned results will be sorted by price in descending order.
      Parameters:
      accountId - Account identifier (0 if no account criteria)
      chainId - Chain identifier (0 if no chain criteria)
      exchangeId - Exchange identifier (0 if no exchange criteria)
      from - Starting index within search results
      to - Ending index within search results
      Returns:
      Database iterator
    • getTrade

      public static CoinExchange.Trade getTrade(byte[] orderFullHash, byte[] matchFullHash)
      Return a coin exchange trade
      Parameters:
      orderFullHash - Coin exchange order full hash
      matchFullHash - Matching order full hash
      Returns:
      Coin exchange trade or null if not found
    • getTradeCount

      public static int getTradeCount()
      Return the number of coin exchange trades
      Returns:
      Trade coin
    • getTrades

      public static DbIterator<CoinExchange.Trade> getTrades(long accountId, int chainId, int exchangeId, byte[] orderFullHash, int from, int to)
      Return trades matching the supplied criteria. All trades will be returned if no search criteria are provided. The returned results will be sorted by block height in descending order.
      Parameters:
      accountId - Account identifier (0 if no account criteria)
      chainId - Chain identifier (0 if no chain criteria)
      exchangeId - Exchange identifier (0 if no exchange criteria)
      orderFullHash - Coin exchange order full hash (null or zero-length if no order criteria)
      from - Starting index within search results
      to - Ending index within search results
      Returns:
      Database iterator