Skip to content

Commit 1dfa0de

Browse files
committed
misc. compile error fixes
1 parent d6b648b commit 1dfa0de

File tree

4 files changed

+16
-38
lines changed

4 files changed

+16
-38
lines changed

xchange-bitmex/src/main/java/org/knowm/xchange/bitmex/BitmexAdapters.java

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,11 @@
11
package org.knowm.xchange.bitmex;
22

3-
import java.math.BigDecimal;
4-
import java.util.ArrayList;
5-
import java.util.Collection;
6-
import java.util.Date;
7-
import java.util.HashMap;
8-
import java.util.HashSet;
9-
import java.util.List;
10-
import java.util.Map;
11-
import java.util.Map.Entry;
12-
import java.util.Set;
13-
3+
import com.google.common.collect.BiMap;
144
import org.knowm.xchange.bitmex.dto.account.BitmexTicker;
155
import org.knowm.xchange.bitmex.dto.marketdata.BitmexDepth;
166
import org.knowm.xchange.bitmex.dto.marketdata.BitmexPublicOrder;
177
import org.knowm.xchange.bitmex.dto.marketdata.BitmexPublicTrade;
18-
import org.knowm.xchange.bitmex.dto.trade.BitmexOrder;
19-
import org.knowm.xchange.bitmex.dto.trade.BitmexOrderDescription;
20-
import org.knowm.xchange.bitmex.dto.trade.BitmexOrderResponse;
21-
import org.knowm.xchange.bitmex.dto.trade.BitmexOrderStatus;
22-
import org.knowm.xchange.bitmex.dto.trade.BitmexSide;
23-
import org.knowm.xchange.bitmex.dto.trade.BitmexTrade;
24-
import org.knowm.xchange.bitmex.dto.trade.BitmexUserTrade;
8+
import org.knowm.xchange.bitmex.dto.trade.*;
259
import org.knowm.xchange.currency.Currency;
2610
import org.knowm.xchange.currency.CurrencyPair;
2711
import org.knowm.xchange.dto.Order.OrderStatus;
@@ -41,7 +25,9 @@
4125
import org.knowm.xchange.dto.trade.UserTrade;
4226
import org.knowm.xchange.dto.trade.UserTrades;
4327

44-
import com.google.common.collect.BiMap;
28+
import java.math.BigDecimal;
29+
import java.util.*;
30+
import java.util.Map.Entry;
4531

4632
public class BitmexAdapters {
4733

@@ -223,7 +209,7 @@ public static LimitOrder adaptLimitOrder(BitmexOrder bitmexOrder, String id) {
223209
status = OrderStatus.PARTIALLY_FILLED;
224210
}
225211

226-
return new LimitOrder(type, originalAmount, pair, id, timestamp, orderDescription.getPrice(), orderDescription.getPrice(), filledAmount, status);
212+
return new LimitOrder(type, originalAmount, pair, id, timestamp, orderDescription.getPrice(), orderDescription.getPrice(), filledAmount, bitmexOrder.getFee(), status);
227213
}
228214

229215
public static UserTrades adaptTradesHistory(Map<String, BitmexTrade> bitmexTrades) {

xchange-core/src/main/java/org/knowm/xchange/dto/Order.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ public Order(OrderType type, BigDecimal originalAmount, CurrencyPair currencyPai
167167
* @param timestamp the absolute time for this order according to the exchange's server, null if not provided
168168
* @param averagePrice the averagePrice of fill belonging to the order
169169
* @param cumulativeAmount the amount that has been filled
170+
* @param fee the fee associated with this order
170171
* @param status the status of the order at the exchange
171172
*/
172173
public Order(OrderType type, BigDecimal originalAmount, CurrencyPair currencyPair, String id, Date timestamp, BigDecimal averagePrice,
@@ -179,8 +180,8 @@ public Order(OrderType type, BigDecimal originalAmount, CurrencyPair currencyPai
179180
this.timestamp = timestamp;
180181
this.averagePrice = averagePrice;
181182
this.cumulativeAmount = cumulativeAmount;
182-
this.status = status;
183183
this.fee = fee;
184+
this.status = status;
184185
}
185186

186187
/**

xchange-core/src/main/java/org/knowm/xchange/dto/trade/StopOrder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public StopOrder(OrderType type, BigDecimal originalAmount, CurrencyPair currenc
4949
public StopOrder(OrderType type, BigDecimal originalAmount, BigDecimal cumulativeAmount, CurrencyPair currencyPair, String id, Date timestamp,
5050
BigDecimal stopPrice) {
5151

52-
super(type, originalAmount, currencyPair, id, timestamp, BigDecimal.ZERO, cumulativeAmount, OrderStatus.PENDING_NEW);
52+
super(type, originalAmount, currencyPair, id, timestamp, BigDecimal.ZERO, cumulativeAmount, BigDecimal.ZERO, OrderStatus.PENDING_NEW);
5353
this.stopPrice = stopPrice;
5454
}
5555

@@ -67,7 +67,7 @@ public StopOrder(OrderType type, BigDecimal originalAmount, BigDecimal cumulativ
6767
public StopOrder(OrderType type, BigDecimal originalAmount, CurrencyPair currencyPair, String id, Date timestamp, BigDecimal stopPrice,
6868
BigDecimal averagePrice, BigDecimal cumulativeAmount, OrderStatus status) {
6969

70-
super(type, originalAmount, currencyPair, id, timestamp, averagePrice, cumulativeAmount, status);
70+
super(type, originalAmount, currencyPair, id, timestamp, averagePrice, cumulativeAmount, BigDecimal.ZERO, status);
7171
this.stopPrice = stopPrice;
7272
}
7373

xchange-kucoin/src/main/java/org/knowm/xchange/kucoin/service/KucoinTradeService.java

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,24 @@
11
package org.knowm.xchange.kucoin.service;
22

3-
import java.io.IOException;
4-
import java.util.Collection;
5-
63
import org.knowm.xchange.Exchange;
74
import org.knowm.xchange.currency.CurrencyPair;
85
import org.knowm.xchange.dto.Order;
9-
import org.knowm.xchange.exceptions.NotYetImplementedForExchangeException;
10-
import org.knowm.xchange.dto.trade.LimitOrder;
11-
import org.knowm.xchange.dto.trade.MarketOrder;
12-
import org.knowm.xchange.dto.trade.OpenOrders;
13-
import org.knowm.xchange.dto.trade.UserTrades;
6+
import org.knowm.xchange.dto.trade.*;
147
import org.knowm.xchange.exceptions.ExchangeException;
158
import org.knowm.xchange.exceptions.NotAvailableFromExchangeException;
9+
import org.knowm.xchange.exceptions.NotYetImplementedForExchangeException;
1610
import org.knowm.xchange.kucoin.dto.KucoinAdapters;
1711
import org.knowm.xchange.kucoin.dto.KucoinResponse;
1812
import org.knowm.xchange.kucoin.dto.trading.KucoinDealtOrdersInfo;
1913
import org.knowm.xchange.service.trade.TradeService;
20-
import org.knowm.xchange.service.trade.params.CancelOrderByCurrencyPair;
21-
import org.knowm.xchange.service.trade.params.CancelOrderByIdParams;
22-
import org.knowm.xchange.service.trade.params.CancelOrderByOrderTypeParams;
23-
import org.knowm.xchange.service.trade.params.CancelOrderParams;
24-
import org.knowm.xchange.service.trade.params.TradeHistoryParamCurrencyPair;
25-
import org.knowm.xchange.service.trade.params.TradeHistoryParamPaging;
26-
import org.knowm.xchange.service.trade.params.TradeHistoryParams;
14+
import org.knowm.xchange.service.trade.params.*;
2715
import org.knowm.xchange.service.trade.params.orders.DefaultOpenOrdersParamCurrencyPair;
2816
import org.knowm.xchange.service.trade.params.orders.OpenOrdersParamCurrencyPair;
2917
import org.knowm.xchange.service.trade.params.orders.OpenOrdersParams;
3018

19+
import java.io.IOException;
20+
import java.util.Collection;
21+
3122
public class KucoinTradeService extends KucoinTradeServiceRaw implements TradeService {
3223

3324
public KucoinTradeService(Exchange exchange) {

0 commit comments

Comments
 (0)