Adapt a org.knowm.xchange.bitcoinde.dto.marketdata.BitcoindeTrade[] object to a Trades object.

@param bitcoindeTradesWrapper Exchange specific trades
@param currencyPair (e.g. BTC/USD)
@return The XChange Trades
760162
public static Trades adaptTrades(
      BitcoindeTradesWrapper bitcoindeTradesWrapper, CurrencyPair currencyPair) {

    List<Trade> trades = new ArrayList<>();
    long lastTradeId = 0;
    for (BitcoindeTrade bitcoindeTrade : bitcoindeTradesWrapper.getTrades()) {
      final long tid = bitcoindeTrade.getTid();
      if (tid > lastTradeId) {
        lastTradeId = tid;
      }
      trades.add(
          new Trade(
              null,
              bitcoindeTrade.getAmount(),
              currencyPair,
              bitcoindeTrade.getPrice(),
              DateUtils.fromMillisUtc(bitcoindeTrade.getDate() * 1000L),
              String.valueOf(tid)));
    }
    return new Trades(trades, lastTradeId, TradeSortType.SortByID);
  }
996992
public static Trades adaptTrades(List<ANXTrade> anxTrades) {

    List<Trade> tradesList = new ArrayList<>();
    long latestTid = 0;
    for (ANXTrade anxTrade : anxTrades) {
      long tid = anxTrade.getTid();
      if (tid > latestTid) {
        latestTid = tid;
      }
      tradesList.add(adaptTrade(anxTrade));
    }
    return new Trades(tradesList, latestTid, TradeSortType.SortByID);
  }
1068003
public static Ticker adaptTicker(CryptopiaTicker cryptopiaTicker, CurrencyPair currencyPair) {
    return new Ticker.Builder()
        .currencyPair(currencyPair)
        .last(cryptopiaTicker.getLast())
        .bid(cryptopiaTicker.getBid())
        .ask(cryptopiaTicker.getAsk())
        .high(cryptopiaTicker.getHigh())
        .low(cryptopiaTicker.getLow())
        .volume(cryptopiaTicker.getVolume())
        .timestamp(new Date())
        .build();
  }
1325084
public static Ticker adaptTicker(
      BitcoinAverageTicker bitcoinAverageTicker, CurrencyPair currencyPair) {

    BigDecimal last = bitcoinAverageTicker.getLast();
    BigDecimal bid = bitcoinAverageTicker.getBid();
    BigDecimal ask = bitcoinAverageTicker.getAsk();
    Date timestamp = bitcoinAverageTicker.getTimestamp();
    BigDecimal volume = bitcoinAverageTicker.getVolume();

    return new Ticker.Builder()
        .currencyPair(currencyPair)
        .last(last)
        .bid(bid)
        .ask(ask)
        .volume(volume)
        .timestamp(timestamp)
        .build();
  }
1254915
public static BitfinexCandlestickSymbol candlesticks(final String currency, final String profitCurrency, 
    		final BitfinexCandleTimeFrame timeframe) {
    	
        final String currencyNonNull = Objects.requireNonNull(currency).toUpperCase();
        final String profitCurrencyNonNull = Objects.requireNonNull(profitCurrency).toUpperCase();
        
        return candlesticks(BitfinexCurrencyPair.of(currencyNonNull, profitCurrencyNonNull), timeframe);
    }
125756
public BitZTicker getTicker(CurrencyPair currencyPair) throws IOException {
    BitZTickerResult result = bitz.getTicker(BitZUtils.toPairString(currencyPair));
    return result.getData();
  }
1216385
@Override
  public OrderBook getOrderBook(CurrencyPair currencyPair, Object... args) throws IOException {

    String pairs = WexAdapters.getPair(currencyPair);
    WexDepthWrapper wexDepthWrapper = null;

    if (args != null && args.length > 0) {
      Object arg0 = args[0];
      if (!(arg0 instanceof Integer) || ((Integer) arg0 < 1) || ((Integer) arg0 > FULL_SIZE)) {
        throw new ExchangeException(
            "Orderbook size argument must be an Integer in the range: (1, 2000)!");
      } else {
        wexDepthWrapper = getBTCEDepth(pairs, (Integer) arg0);
      }
    } else { // default to full orderbook
      wexDepthWrapper = getBTCEDepth(pairs, FULL_SIZE);
    }

    // Adapt to XChange DTOs
    List<LimitOrder> asks =
        WexAdapters.adaptOrders(
            wexDepthWrapper.getDepth(WexAdapters.getPair(currencyPair)).getAsks(),
            currencyPair,
            "ask",
            "");
    List<LimitOrder> bids =
        WexAdapters.adaptOrders(
            wexDepthWrapper.getDepth(WexAdapters.getPair(currencyPair)).getBids(),
            currencyPair,
            "bid",
            "");

    return new OrderBook(null, asks, bids);
  }
342872
protected function getHistoricalExchangeRate(HistoricalExchangeRateQuery $exchangeQuery): ExchangeRateContract
    {
        $currencyPair = $exchangeQuery->getCurrencyPair();
        $baseCurrency = $currencyPair->getBaseCurrency();
        $date = $exchangeQuery->getDate();
        $formattedDate = $date->format('Ymd');

        $content = $this->request(self::URL.'?'.http_build_query(['date' => $formattedDate]));
        $element = StringUtil::xmlToElement($content);

        $elements = $element->xpath('./currency[cc="'.$baseCurrency.'"]');

        if (empty($elements)) {
            if ($element->xpath('./error')) {
                throw new UnsupportedDateException($date, $this);
            }

            throw new UnsupportedCurrencyPairException($currencyPair, $this);
        }

        $item = $elements[0];

        $rate = (float) str_replace(',', '.', (string) $item->rate);

        return $this->createRate($currencyPair, $rate, $date);
    }
56892
public BitZSymbolList getSymbolList(CurrencyPair... currencyPairs) throws IOException {
    List<String> symbolList = new ArrayList<>(currencyPairs.length);
    Arrays.stream(currencyPairs)
        .forEach(currencyPair -> symbolList.add(BitZUtils.toPairString(currencyPair)));
    String symbols = symbolList.stream().collect(Collectors.joining(","));
    return bitz.getSymbolList(symbols).getData();
  }
1092684
public static BitfinexCurrencyPair register(final String currency, 
			final String profitCurrency, final double minimalOrderSize) {

		final String key = buildCacheKey(currency, profitCurrency);

		final BitfinexCurrencyPair newCurrency = new BitfinexCurrencyPair(currency, profitCurrency, 
				minimalOrderSize);

		final BitfinexCurrencyPair oldCurrency = instances.putIfAbsent(key, newCurrency);

		// The currency was already registered
		if(oldCurrency != null) {
			throw new IllegalArgumentException("The currency " + key + " is already known");
		}

		return newCurrency;
	}
249989
public BitsoTrade[] getUserTrades(String[] tradesIds, String... queryParameters)
            throws BitsoAPIException, BitsoPayloadException, BitsoServerException {
        String request = "/api/v3/user_trades";

        if ((tradesIds != null && (queryParameters != null && queryParameters.length > 0))) {
            return null;
        }

        if (tradesIds != null) {
            String fundingssIdsParameters = processQueryParameters("-", tradesIds);
            request += ((fundingssIdsParameters != null) ? "/" + fundingssIdsParameters : "");
        }

        if (queryParameters != null && queryParameters.length > 0) {
            String parsedQueryParametes = processQueryParameters("&", queryParameters);
            request += ((parsedQueryParametes != null) ? "?" + parsedQueryParametes : "");
        }

        String getResponse = sendBitsoGet(request);
        JSONArray payloadJSON = (JSONArray) getJSONPayload(getResponse);
        int totalElements = payloadJSON.length();
        BitsoTrade[] trades = new BitsoTrade[totalElements];
        for (int i = 0; i < totalElements; i++) {
            trades[i] = new BitsoTrade(payloadJSON.getJSONObject(i));
        }
        return trades;
    }
898465
public static UserTrades adaptTradeHistory(CoinEggTradeView coinEggTradeView) {
    List<UserTrade> trades = new ArrayList<UserTrade>();
    Trade trade =
        new Trade.Builder()
            // .currencyPair(null)
            .id(String.valueOf(coinEggTradeView.getID()))
            .type(coinEggTradeView.getType() == Type.BUY ? OrderType.ASK : OrderType.BID)
            .price(coinEggTradeView.getPrice())
            .originalAmount(coinEggTradeView.getAmountOriginal())
            .timestamp(coinEggTradeView.getDateTime())
            .build();

    trades.add((UserTrade) UserTrade.Builder.from(trade).build());

    return new UserTrades(trades, null);
  }
889496
public Map<Currency, Map<Currency, BigDecimal>> getCurrencyCoinRate(CurrencyPair... currencyPairs)
      throws IOException {
    List<String> coinList = new ArrayList<>(currencyPairs.length);
    Arrays.stream(currencyPairs)
        .forEach(currencyPair -> coinList.add(currencyPair.base.getCurrencyCode().toLowerCase()));
    String coins = coinList.stream().collect(Collectors.joining(","));
    return bitz.getCurrencyCoinRate(coins).getData();
  }
176775
public OkCoinTradeResult trade(String symbol, String type, String price, String amount)
      throws IOException {
    OkCoinTradeResult tradeResult =
        okCoin.trade(apikey, symbol, type, price, amount, signatureCreator());
    return returnOrThrow(tradeResult);
  }
1005106
BitcointoyouPublicTrade[] getBitcointoyouPublicTrades(
      CurrencyPair currencyPair, Long tradeTimestamp, Long minTradeId) throws IOException {

    String currency = currencyPair.base.toString();

    try {
      return bitcointoyou.getTrades(currency, tradeTimestamp, minTradeId);
    } catch (BitcointoyouException e) {
      throw new ExchangeException(e.getError());
    }
  }
845072
public OkCoinTrade[] getTrades(CurrencyPair currencyPair, Long since) throws IOException {
    return okCoin.getTrades("1", OkCoinAdapters.adaptSymbol(currencyPair), since);
  }
1344468
public static String adaptCurrencyPair(CurrencyPair currencyPair) {
    return currencyPair.base.getCurrencyCode().toLowerCase()
        + currencyPair.counter.getCurrencyCode().toLowerCase();
  }