Package org.knowm.xchange.mercadobitcoin
Class MercadoBitcoinAdapters
java.lang.Object
org.knowm.xchange.mercadobitcoin.MercadoBitcoinAdapters
Various adapters for converting from Mercado Bitcoin DTOs to XChange DTOs
- Author:
- Felipe Micaroni Lalli
-
Method Summary
Modifier and TypeMethodDescriptionstatic AccountInfo
adaptAccountInfo
(MercadoBitcoinBaseTradeApiResult<MercadoBitcoinAccountInfo> accountInfo, String userName) Adapts a MercadoBitcoinBaseTradeApiResultto an AccountInfo static String
static OrderBook
adaptOrderBook
(MercadoBitcoinOrderBook mercadoBitcoinOrderBook, CurrencyPair currencyPair) Adapts a org.knowm.xchange.mercadobitcoin.dto.marketdata.OrderBook to a OrderBook Objectstatic List<LimitOrder>
adaptOrders
(CurrencyPair currencyPair, MercadoBitcoinBaseTradeApiResult<MercadoBitcoinUserOrders> input) static Ticker
adaptTicker
(MercadoBitcoinTicker mercadoBitcoinTicker, CurrencyPair currencyPair) Adapts a MercadoBitcoinTicker to a Ticker Objectstatic Trades
adaptTrades
(MercadoBitcoinTransaction[] transactions, CurrencyPair currencyPair) Adapts a Transaction[] to a Trades Objectstatic void
checkArgument
(boolean argument, String msgPattern, Object... msgArgs) static LimitOrder
createOrder
(CurrencyPair currencyPair, List<BigDecimal> priceAndAmount, Order.OrderType orderType) static List<LimitOrder>
createOrders
(CurrencyPair currencyPair, Order.OrderType orderType, List<List<BigDecimal>> orders) static UserTrades
-
Method Details
-
adaptOrderBook
public static OrderBook adaptOrderBook(MercadoBitcoinOrderBook mercadoBitcoinOrderBook, CurrencyPair currencyPair) Adapts a org.knowm.xchange.mercadobitcoin.dto.marketdata.OrderBook to a OrderBook Object- Parameters:
currencyPair
- (e.g. BTC/BRL or LTC/BRL)- Returns:
- The XChange OrderBook
-
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
-
adaptTicker
public static Ticker adaptTicker(MercadoBitcoinTicker mercadoBitcoinTicker, CurrencyPair currencyPair) Adapts a MercadoBitcoinTicker to a Ticker Object- Parameters:
mercadoBitcoinTicker
- The exchange specific tickercurrencyPair
- (e.g. BTC/USD)- Returns:
- The ticker
-
adaptTrades
public static Trades adaptTrades(MercadoBitcoinTransaction[] transactions, CurrencyPair currencyPair) Adapts a Transaction[] to a Trades Object- Parameters:
transactions
- The Mercado Bitcoin transactionscurrencyPair
- (e.g. BTC/BRL or LTC/BRL)- Returns:
- The XChange Trades
-
adaptAccountInfo
public static AccountInfo adaptAccountInfo(MercadoBitcoinBaseTradeApiResult<MercadoBitcoinAccountInfo> accountInfo, String userName) Adapts a MercadoBitcoinBaseTradeApiResultto an AccountInfo - Parameters:
accountInfo
- The Mercado Bitcoin accountInfouserName
- The user name- Returns:
- The account info
-
adaptOrders
public static List<LimitOrder> adaptOrders(CurrencyPair currencyPair, MercadoBitcoinBaseTradeApiResult<MercadoBitcoinUserOrders> input) -
adaptCurrencyPair
-
toUserTrades
public static UserTrades toUserTrades(CurrencyPair pair, MercadoBitcoinBaseTradeApiResult<MercadoBitcoinUserOrders> orders)
-