Adapts a List of ANXOrders to a List of LimitOrders

@param anxOrders
@param currency
@param orderType
@return
546825
public static List<LimitOrder> adaptOrders(
      List<ANXOrder> anxOrders,
      String tradedCurrency,
      String currency,
      String orderType,
      String id) {

    List<LimitOrder> limitOrders = new ArrayList<>();

    for (ANXOrder anxOrder : anxOrders) {
      limitOrders.add(
          adaptOrder(
              anxOrder.getAmount(),
              anxOrder.getPrice(),
              tradedCurrency,
              currency,
              orderType,
              id,
              new Date(anxOrder.getStamp())));
    }

    return limitOrders;
  }
677267
@Nonnull
  public BitmexPrivateOrder placeOrder(@Nonnull final BitmexPlaceOrderParameters parameters)
      throws ExchangeException {
    return updateRateLimit(
        () ->
            bitmex.placeOrder(
                apiKey,
                exchange.getNonceFactory(),
                signatureCreator,
                parameters.getSymbol(),
                parameters.getSide() != null ? parameters.getSide().getCapitalized() : null,
                parameters.getOrderQuantity(),
                parameters.getSimpleOrderQuantity(),
                parameters.getDisplayQuantity(),
                parameters.getPrice(),
                parameters.getStopPrice(),
                parameters.getOrderType() != null
                    ? parameters.getOrderType().toApiParameter()
                    : null,
                parameters.getClOrdId(),
                parameters.getExecutionInstructionsAsParameter(),
                parameters.getClOrdLinkId(),
                parameters.getContingencyType() != null
                    ? parameters.getContingencyType().toApiParameter()
                    : null,
                parameters.getPegOffsetValue(),
                parameters.getPegPriceType() != null
                    ? parameters.getPegPriceType().toApiParameter()
                    : null,
                parameters.getTimeInForce() != null
                    ? parameters.getTimeInForce().toApiParameter()
                    : null,
                parameters.getText()));
  }
871434
public static Trades adaptTrades(BitstampTransaction[] transactions, CurrencyPair currencyPair) {

    List<Trade> trades = new ArrayList<>();
    long lastTradeId = 0;
    for (BitstampTransaction tx : transactions) {
      final long tradeId = tx.getTid();
      if (tradeId > lastTradeId) {
        lastTradeId = tradeId;
      }
      trades.add(adaptTrade(tx, currencyPair, 1000));
    }

    return new Trades(trades, lastTradeId, TradeSortType.SortByID);
  }
459933
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CommerceOrderNote updateCommerceOrderNote(
		CommerceOrderNote commerceOrderNote) {
		return commerceOrderNotePersistence.update(commerceOrderNote);
	}
468437
def place_limit_order(self, side: Side, amount: Number, price: Number) -> Order:
        """"""
        return self.place_order(side, OrderType.LIMIT, amount, price)
78778
public static OrderBook adaptOrderBook(EXXOrderbook exxOrderbook, CurrencyPair currencyPair) {
    List<LimitOrder> asks = new ArrayList<LimitOrder>();
    List<LimitOrder> bids = new ArrayList<LimitOrder>();

    for (BigDecimal[] exxAsk : exxOrderbook.getAsks()) {
      asks.add(new LimitOrder(OrderType.ASK, exxAsk[1], currencyPair, null, null, exxAsk[0]));
    }

    for (BigDecimal[] exxBid : exxOrderbook.getBids()) {
      bids.add(new LimitOrder(OrderType.BID, exxBid[1], currencyPair, null, null, exxBid[0]));
    }

    return new OrderBook(new Date(), asks, bids);
  }
399929
public OkCoinOrderResult getOrder(String symbol, Integer type, String... orderIds)
      throws IOException {
    if (orderIds == null || orderIds.length > 50) {
      throw new UnsupportedOperationException(
          "Can only get 1 to 50 orders. " + orderIds.length + " orders provided.");
    }
    String ids = Arrays.stream(orderIds).collect(Collectors.joining(","));

    return super.getOrder(symbol, type, ids);
  }
387578
public static LimitOrder adaptOrder(
      BigDecimal originalAmount,
      BigDecimal price,
      String tradedCurrency,
      String transactionCurrency,
      String orderTypeString,
      String id,
      Date timestamp) {

    // place a limit order
    OrderType orderType = adaptSide(orderTypeString);
    CurrencyPair currencyPair = adaptCurrencyPair(tradedCurrency, transactionCurrency);

    LimitOrder limitOrder =
        new LimitOrder(orderType, originalAmount, currencyPair, id, timestamp, price);

    return limitOrder;
  }
121922
public static OrderBook adaptOrderBook(
      BTCTurkOrderBook btcTurkOrderBook, CurrencyPair currencyPair) {
    List<LimitOrder> asks =
        createOrders(currencyPair, Order.OrderType.ASK, btcTurkOrderBook.getAsks());
    List<LimitOrder> bids =
        createOrders(currencyPair, Order.OrderType.BID, btcTurkOrderBook.getBids());
    return new OrderBook(btcTurkOrderBook.getTimestamp(), asks, bids);
  }
765110
@Override
	public AppEngineGetList<E> sort(Order<?, ?>... orders) {
		if (orders == null) {
			throw new IllegalArgumentException("'orders' must not be [" + orders + "]");
		}
		
		this.orders = Arrays.asList(orders);
		return this;
	}
1008650
private static UserTrade adaptTrade(LimitOrder order) {
    BigDecimal feeAmount =
        order
            .getCumulativeAmount()
            .multiply(order.getLimitPrice())
            .multiply(fee)
            .setScale(8, RoundingMode.DOWN);
    return new UserTrade(
        order.getType(),
        order.getCumulativeAmount(),
        order.getCurrencyPair(),
        order.getLimitPrice(),
        order.getTimestamp(),
        null, // Trade id
        order.getId(), // Original order id
        feeAmount,
        order.getCurrencyPair().counter);
  }
1330271
public static LimitOrder adaptOrder(
      BigDecimal amount,
      BigDecimal price,
      CurrencyPair currencyPair,
      OrderType orderType,
      String id) {

    return new LimitOrder(orderType, amount, currencyPair, id, null, price);
  }
189318
@Override
  public OrderBook getOrderBook(CurrencyPair currencyPair, Object... args) throws IOException {

    String marketName = DSXAdapters.currencyPairToMarketName(currencyPair);

    String accountType = null;
    try {
      if (args != null) {
        accountType = (String) args[0];
      }
    } catch (ArrayIndexOutOfBoundsException e) {
      // ignore, can happen if no argument given.
    }

    DSXOrderbookWrapper dsxOrderbookWrapper = getDSXOrderbook(marketName, accountType);
    DSXOrderbook orderbook = dsxOrderbookWrapper.getOrderbook(marketName);

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

    return new OrderBook(null, asks, bids);
  }
634629
public static BitfinexOrderBookSymbol rawOrderBook(final BitfinexCurrencyPair currencyPair) {
        return new BitfinexOrderBookSymbol(currencyPair, BitfinexOrderBookSymbol.Precision.R0, null, null);
    }
730774
@Override
  public String placeMarketOrder(MarketOrder marketOrder) throws IOException {
    WexExchangeInfo wexExchangeInfo = ((WexExchange) exchange).getWexExchangeInfo();
    LimitOrder order = WexAdapters.createLimitOrder(marketOrder, wexExchangeInfo);
    return placeLimitOrder(order);
  }
132323
public void update(LimitOrder limitOrder) {

    update(getOrders(limitOrder.getType()), limitOrder);
    updateDate(limitOrder.getTimestamp());
  }
1203164
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CommerceOrder addCommerceOrder(CommerceOrder commerceOrder) {
		commerceOrder.setNew(true);

		return commerceOrderPersistence.update(commerceOrder);
	}