Class CexIOAdapters

java.lang.Object
org.knowm.xchange.cexio.CexIOAdapters

public class CexIOAdapters
extends Object
Author: brox Since: 2/6/14
  • Constructor Details

    • CexIOAdapters

      public CexIOAdapters()
  • Method Details

    • adaptTrade

      public static Trade adaptTrade​(CexIOTrade trade, CurrencyPair currencyPair)
      Adapts a CexIOTrade to a Trade Object
      Parameters:
      trade - CexIO trade object
      currencyPair - trade currencies
      Returns:
      The XChange Trade
    • adaptTrades

      public static Trades adaptTrades​(CexIOTrade[] cexioTrades, CurrencyPair currencyPair)
      Adapts a CexIOTrade[] to a Trades Object
      Parameters:
      cexioTrades - The CexIO trade data returned by API
      currencyPair - trade currencies
      Returns:
      The trades
    • adaptTicker

      public static Ticker adaptTicker​(CexIOTicker ticker)
      Adapts a CexIOTicker to a Ticker Object
      Parameters:
      ticker - The exchange specific ticker
      Returns:
      The ticker
    • adaptTicker

      public static Ticker adaptTicker​(CexIOTicker ticker, CurrencyPair currencyPair)
      Adapts a CexIOTicker to a Ticker Object
      Parameters:
      ticker - The exchange specific ticker
      currencyPair - The currency pair (e.g. BTC/USD)
      Returns:
      The ticker
    • adaptOrderBook

      public static OrderBook adaptOrderBook​(CexIODepth depth, CurrencyPair currencyPair)
      Adapts Cex.IO Depth to OrderBook Object
      Parameters:
      depth - Cex.IO order book
      currencyPair - The currency pair (e.g. BTC/USD)
      Returns:
      The XChange OrderBook
    • adaptWallet

      public static Wallet adaptWallet​(CexIOBalanceInfo cexIOBalanceInfo)
      Adapts CexIOBalanceInfo to Wallet
      Parameters:
      cexIOBalanceInfo - CexIOBalanceInfo balance
      Returns:
      The account info
    • adaptBalance

      public static Balance adaptBalance​(Currency currency, CexIOBalance balance)
    • createOrders

      public static List<LimitOrder> createOrders​(CurrencyPair currencyPair, Order.OrderType orderType, List<List<BigDecimal>> orders)
    • createOrder

      public static LimitOrder createOrder​(CurrencyPair currencyPair, List<BigDecimal> priceAndAmount, Order.OrderType orderType)
    • checkArgument

      public static void checkArgument​(boolean argument, String msgPattern, Object... msgArgs)
    • adaptOpenOrders

      public static OpenOrders adaptOpenOrders​(List<CexIOOrder> cexIOOrderList)
    • adaptArchivedOrder

      public static UserTrade adaptArchivedOrder​(CexIOArchivedOrder cexIOArchivedOrder)
    • adaptOrder

      public static Order adaptOrder​(CexIOOpenOrder cexIOOrder)
    • adaptOrder

      public static LimitOrder adaptOrder​(CexIOFullOrder cexIOOrder)
    • adaptPositionStatus

      public static Order.OrderStatus adaptPositionStatus​(CexioPosition cexioPosition)
      CexIO position status is not documented, testing API we can infer that they are similar to order status adaptOrderStatus(CexIOOpenOrder)
      Parameters:
      cexioPosition - cex raw order
      Returns:
      OrderStatus
    • adaptDynamicTradingFees

      public static Map<CurrencyPair,​Fee> adaptDynamicTradingFees​(Map<CurrencyPair,​CexIOFeeInfo.FeeDetails> fees)