package org.knowm.xchange.deribit.v2.service;

import java.io.IOException;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.knowm.xchange.deribit.v2.DeribitExchange;
import org.knowm.xchange.deribit.v2.dto.trade.AdvancedOptions;
import org.knowm.xchange.deribit.v2.dto.trade.Order;
import org.knowm.xchange.deribit.v2.dto.trade.OrderPlacement;
import org.knowm.xchange.deribit.v2.dto.trade.OrderType;
import org.knowm.xchange.deribit.v2.dto.trade.SettlementType;
import org.knowm.xchange.deribit.v2.dto.trade.TimeInForce;
import org.knowm.xchange.deribit.v2.dto.trade.Trigger;
import org.knowm.xchange.deribit.v2.dto.trade.UserSettlements;
import org.knowm.xchange.deribit.v2.dto.trade.UserTrades;

public class DeribitTradeServiceRaw extends DeribitBaseService {

  public DeribitTradeServiceRaw(DeribitExchange exchange) {
    super(exchange);
  }

  public OrderPlacement buy(
      String instrumentName,
      BigDecimal amount,
      OrderType type,
      String label,
      BigDecimal price,
      TimeInForce timeInForce,
      BigDecimal maxShow,
      Boolean postOnly,
      Boolean reduceOnly,
      BigDecimal stopPrice,
      Trigger trigger,
      AdvancedOptions advanced)
      throws IOException {
    return deribitAuthenticated
        .buy(
            instrumentName,
            amount,
            type,
            label,
            price,
            timeInForce,
            maxShow,
            postOnly,
            reduceOnly,
            stopPrice,
            trigger,
            advanced,
            deribitAuth)
        .getResult();
  }

  public OrderPlacement sell(
      String instrumentName,
      BigDecimal amount,
      OrderType type,
      String label,
      BigDecimal price,
      TimeInForce timeInForce,
      BigDecimal maxShow,
      Boolean postOnly,
      Boolean reduceOnly,
      BigDecimal stopPrice,
      Trigger trigger,
      AdvancedOptions advanced)
      throws IOException {
    return deribitAuthenticated
        .sell(
            instrumentName,
            amount,
            type,
            label,
            price,
            timeInForce,
            maxShow,
            postOnly,
            reduceOnly,
            stopPrice,
            trigger,
            advanced,
            deribitAuth)
        .getResult();
  }

  public Order cancel(String orderId) throws IOException {
    return deribitAuthenticated.cancel(orderId, deribitAuth).getResult();
  }

  public List<Order> getOpenOrdersByInstrument(String instrumentName, String type)
      throws IOException {
    return deribitAuthenticated
        .getOpenOrdersByInstrument(instrumentName, type, deribitAuth)
        .getResult();
  }

  public UserTrades getUserTradesByInstrument(
      String instrumentName,
      Integer startSeq,
      Integer endSeq,
      Integer count,
      Boolean includeOld,
      String sorting)
      throws IOException {
    return deribitAuthenticated
        .getUserTradesByInstrument(
            instrumentName, startSeq, endSeq, count, includeOld, sorting, deribitAuth)
        .getResult();
  }

  public UserTrades getUserTradesByInstrumentAndTime(
      String instrumentName,
      Date startTimestsamp,
      Date endTimestamp,
      Integer count,
      Boolean includeOld,
      String sorting)
      throws IOException {
    return deribitAuthenticated
        .getUserTradesByInstrumentAndTime(
            instrumentName,
            startTimestsamp.getTime(),
            endTimestamp.getTime(),
            count,
            includeOld,
            sorting,
            deribitAuth)
        .getResult();
  }

  public UserSettlements getUserSettlementsByInstrument(
      String instrumentName, SettlementType type, Integer count) throws IOException {
    return deribitAuthenticated
        .getSettlementHistoryByInstrument(instrumentName, type, count, deribitAuth)
        .getResult();
  }
}

@@ -2327,32 +2327,736 @@
 tResult();%0A  %7D%0A%0A
+  @GET%0A%09@Path(%22edit%22)%0A%09DeribitResponse%3COrderPlacement%3E edit(%0A%09%09%09@QueryParam(%22order_id%22) String orderID,%0A%09%09%09@QueryParam(%22amount%22) BigDecimal amount, %0A%09%09%09@QueryParam(%22price%22) BigDecimal price,%0A%09%09%09// @QueryParam(%22post_only%22) Boolean postOnly,%0A%09%09%09// @QueryParam(%22reduce_only%22) Boolean reduceOnly,%0A%09%09%09// @QueryParam(%22reject_post_only%22) Boolean reducePostOnly,%0A%09%09%09// @QueryParam(%22advanced%22) AdvancedOptions advanced,%0A%09%09%09// @QueryParam(%22stop_price%22) BigDecimal stopPrice,%0A%09%09%09// @QueryParam(%22mp%22) Boolean mp,%0A%09%09%09// here is/was a bug! on the website it says mmp, but if you tipe in mmp, you get a%0A%09%09%09// bad request 400.%0A%09%09%09@HeaderParam(%22Authorization%22) ParamsDigest auth) throws DeribitException, IOException;%0A  %0A
   public Order c

Update DeribitTradeServiceRaw.java