code: public static Trades adaptTrades(BitsoTransaction[] transactions, CurrencyPair currencyPair) {
  
      List<Trade> trades = new ArrayList<>();
      long lastTradeId = 0;
      for (BitsoTransaction tx : transactions) {
        Order.OrderType type;
        switch (tx.getSide()) {
          case "buy":
            type = Order.OrderType.ASK;
            break;
          case "sell":
            type = Order.OrderType.BID;
            break;
          default:
            type = null;
        }
        final long tradeId = tx.getTid();
        if (tradeId > lastTradeId) {
          lastTradeId = tradeId;
        }
        trades.add(
            new Trade(
                type,
                tx.getAmount(),
                currencyPair,
                tx.getPrice(),
                DateUtils.fromMillisUtc(tx.getDate() * 1000L),
                String.valueOf(tradeId)));
      }
  
      return new Trades(trades, lastTradeId, TradeSortType.SortByID);
    }
docs: Adapts a Transaction[] to a Trades Object
  
  @param transactions The Bitso transactions
  @param currencyPair (e.g. BTC/MXN)
  @return The XChange Trades