Skip to content

Commit

Permalink
added support for returning order trades
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCookieLab committed Apr 10, 2018
1 parent 80aa90d commit 4db415b
Show file tree
Hide file tree
Showing 8 changed files with 213 additions and 180 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ PoloniexExchangeService service = new PoloniexExchangeService(apiKey, apiSecret)
List<PoloniexTradeHistory> UsdtBtcTradeHistory = service.returnTradeHistory("USDT_BTC");
```

### Return order trades
```java
String apiKey = "foo";
String apiSecret = "bar";
PoloniexExchangeService service = new PoloniexExchangeService(apiKey, apiSecret);
String orderNumber = "12345678";
List<PoloniexOrderTrade> orderTrades = service.returnOrderTrades(orderNumber);
```

### Buy
```java
String apiKey = "foo";
Expand Down
24 changes: 13 additions & 11 deletions src/main/java/com/cf/ExchangeService.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.cf;


import com.cf.data.model.poloniex.PoloniexActiveLoanTypes;
import com.cf.data.model.poloniex.PoloniexChartData;
import com.cf.data.model.poloniex.PoloniexCompleteBalance;
import com.cf.data.model.poloniex.PoloniexFeeInfo;
import com.cf.data.model.poloniex.PoloniexOpenOrder;
import com.cf.data.model.poloniex.PoloniexOrderResult;
import com.cf.data.model.poloniex.PoloniexOrderTrade;
import com.cf.data.model.poloniex.PoloniexTicker;
import com.cf.data.model.poloniex.PoloniexTradeHistory;
import java.math.BigDecimal;
Expand All @@ -17,8 +17,8 @@
*
* @author David
*/
public interface ExchangeService
{
public interface ExchangeService {

public final static String USDT_BTC_CURRENCY_PAIR = "USDT_BTC";
public final static String USDT_ETH_CURRENCY_PAIR = "USDT_ETH";
public final static String BTC_CURRENCY_TYPE = "BTC";
Expand All @@ -29,9 +29,9 @@ public interface ExchangeService
public final static Long TWO_HOUR_TIME_PERIOD = 7_200L;
public final static Long DAILY_TIME_PERIOD = 86_400L;
public final static Long LONG_LONG_AGO = 1_439_000_000L;

public List<PoloniexChartData> returnChartData(String currencyPair, Long periodInSeconds, Long startEpochInSeconds);

public Map<String, PoloniexTicker> returnTicker();

public PoloniexTicker returnTicker(String currencyName);
Expand All @@ -43,19 +43,21 @@ public interface ExchangeService
public PoloniexCompleteBalance returnCurrencyBalance(String currencyName);

public PoloniexFeeInfo returnFeeInfo();

public List<PoloniexOpenOrder> returnOpenOrders(String currencyName);

public List<PoloniexTradeHistory> returnTradeHistory(String currencyPair);


public List<PoloniexOrderTrade> returnOrderTrades(String orderNumber);

public boolean cancelOrder(String orderNumber);

public PoloniexOrderResult moveOrder(String orderNumber, BigDecimal rate, Boolean immediateOrCancel, Boolean postOnly);

public PoloniexOrderResult sell(String currencyPair, BigDecimal sellPrice, BigDecimal amount, boolean fillOrKill, boolean immediateOrCancel, boolean postOnly);

public PoloniexOrderResult buy(String currencyPair, BigDecimal buyPrice, BigDecimal amount, boolean fillOrKill, boolean immediateOrCancel, boolean postOnly);

public PoloniexActiveLoanTypes returnActiveLoans();
public PoloniexActiveLoanTypes returnActiveLoans();

}
2 changes: 2 additions & 0 deletions src/main/java/com/cf/TradingAPIClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public interface TradingAPIClient
public String returnOpenOrders(String currencyPair);

public String returnTradeHistory(String currencyPair);

public String returnOrderTrades(String orderNumber);

public String cancelOrder(String orderNumber);

Expand Down
Loading

0 comments on commit 4db415b

Please sign in to comment.