public static Trades adaptTrades(
      MercadoBitcoinTransaction[] transactions, CurrencyPair currencyPair) {

    List<Trade> trades = new ArrayList<>();
    long lastTradeId = 0;
    for (MercadoBitcoinTransaction tx : transactions) {
      final long tradeId = tx.getTid();
      if (tradeId > lastTradeId) {
        lastTradeId = tradeId;
      }
      trades.add(
          new Trade(
              toOrderType(tx.getType()),
              tx.getAmount(),
              currencyPair,
              tx.getPrice(),
              DateUtils.fromMillisUtc(tx.getDate() * 1000L),
              String.valueOf(tradeId)));
    }

    return new Trades(trades, lastTradeId, Trades.TradeSortType.SortByID);
  }
public static Trades adaptTrades ( MercadoBitcoinTransaction [ ] transactions , CurrencyPair currencyPair ) { List < Trade > trades = new ArrayList < > ( ) ; long lastTradeId = 0 ; for ( MercadoBitcoinTransaction tx : transactions ) { final long tradeId = tx . getTid ( ) ; if ( tradeId > lastTradeId ) { lastTradeId = tradeId ; } trades . add ( new Trade ( toOrderType ( tx . getType ( ) ) , tx . getAmount ( ) , currencyPair , tx . getPrice ( ) , DateUtils . fromMillisUtc ( tx . getDate ( ) * 1000L ) , String . valueOf ( tradeId ) ) ) ; } return new Trades ( trades , lastTradeId , Trades . TradeSortType . SortByID ) ; }
Adapts a Transaction[] to a Trades Object

@param transactions The Mercado Bitcoin transactions
@param currencyPair (e.g. BTC/BRL or LTC/BRL)
@return The XChange Trades