diff --git a/.gitignore b/.gitignore index cad77b6f3..c4d55bb2a 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ cmake-build-debug/ # IntelliJ /out/ +.idea # mpeltonen/sbt-idea plugin .idea_modules/ @@ -90,4 +91,6 @@ fabric.properties # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* +# Maven +target/ # End of https://www.gitignore.io/api/java,intellij diff --git a/README.md b/README.md index 14d284d08..5b1223b3b 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ binance-java-api is a lightweight Java library for interacting with the [Binance ## Features * Support for synchronous and asynchronous REST requests to all [General](https://www.binance.com/restapipub.html#user-content-general-endpoints), [Market Data](https://www.binance.com/restapipub.html#user-content-market-data-endpoints), [Account](https://www.binance.com/restapipub.html#user-content-account-endpoints) endpoints, and [User](https://www.binance.com/restapipub.html#user-content-user-data-stream-endpoints) stream endpoints. -* Support for User Data, Trade, and Depth event streaming using [Binance WebSocket API](https://www.binance.com/restapipub.html#wss-endpoint). +* Support for User Data, Trade, Kline, and Depth event streaming using [Binance WebSocket API](https://www.binance.com/restapipub.html#wss-endpoint). ## Installation 1. Install library into your Maven's local repository by running `mvn install` @@ -147,6 +147,19 @@ AssetBalance[asset=ETH,free=0.10000000,locked=0.00000000] ``` +#### Get list of trades for an account and a symbol +```java +List myTrades = client.getMyTrades("NEOETH"); +System.out.println(myTrades); +``` +
+ View Response + + ```java +[Trade[id=123,price=0.00000100,qty=1000.00000000,commission=0.00172100,commissionAsset=ETH,time=1507927870561,buyer=false,maker=false,bestMatch=true,symbol=,orderId=11289], Trade[id=123,price=0.00001000,qty=3.00000000,commission=0.00000003,commissionAsset=ETH,time=1507927874215,buyer=false,maker=false,bestMatch=true,symbol=,orderId=123]] +``` +
+ #### Get account open orders for a symbol ```java List openOrders = client.getOpenOrders(new OrderRequest("LINKETH")); @@ -239,6 +252,19 @@ DepositHistory[depositList=[Deposit[amount=0.100000000000000000,asset=ETH,insert ``` +#### Get deposit address +```java +DepositAddress depositAddress = client.getDepositAddress("ETH"); +System.out.println(depositAddress); +``` +
+ View Response + + ```java +DepositAddress[address=0x99...,success=true,addressTag=,asset=ETH] +``` +
+ ### User stream endpoints #### Start user data stream, keepalive, and close data stream diff --git a/src/main/java/com/binance/api/client/BinanceApiAsyncRestClient.java b/src/main/java/com/binance/api/client/BinanceApiAsyncRestClient.java index 13adc4488..3a77e85c9 100644 --- a/src/main/java/com/binance/api/client/BinanceApiAsyncRestClient.java +++ b/src/main/java/com/binance/api/client/BinanceApiAsyncRestClient.java @@ -1,10 +1,12 @@ package com.binance.api.client; import com.binance.api.client.domain.account.Account; +import com.binance.api.client.domain.account.DepositAddress; import com.binance.api.client.domain.account.DepositHistory; import com.binance.api.client.domain.account.NewOrder; import com.binance.api.client.domain.account.NewOrderResponse; import com.binance.api.client.domain.account.Order; +import com.binance.api.client.domain.account.Trade; import com.binance.api.client.domain.account.WithdrawHistory; import com.binance.api.client.domain.account.request.AllOrdersRequest; import com.binance.api.client.domain.account.request.CancelOrderRequest; @@ -175,6 +177,33 @@ public interface BinanceApiAsyncRestClient { */ void getAccount(BinanceApiCallback callback); + /** + * Get trades for a specific account and symbol. + * + * @param symbol symbol to get trades from + * @param limit default 500; max 500 + * @param fromId TradeId to fetch from. Default gets most recent trades. + * @param callback the callback that handles the response with a list of trades + */ + void getMyTrades(String symbol, Integer limit, Long fromId, Long recvWindow, Long timestamp, BinanceApiCallback> callback); + + /** + * Get trades for a specific account and symbol. + * + * @param symbol symbol to get trades from + * @param limit default 500; max 500 + * @param callback the callback that handles the response with a list of trades + */ + void getMyTrades(String symbol, Integer limit, BinanceApiCallback> callback); + + /** + * Get trades for a specific account and symbol. + * + * @param symbol symbol to get trades from + * @param callback the callback that handles the response with a list of trades + */ + void getMyTrades(String symbol, BinanceApiCallback> callback); + /** * Submit a withdraw request. * @@ -201,6 +230,13 @@ public interface BinanceApiAsyncRestClient { */ void getWithdrawHistory(String asset, BinanceApiCallback callback); + /** + * Fetch deposit address. + * + * @param callback the callback that handles the response and returns the deposit address + */ + void getDepositAddress(String asset, BinanceApiCallback callback); + // User stream endpoints /** diff --git a/src/main/java/com/binance/api/client/BinanceApiRestClient.java b/src/main/java/com/binance/api/client/BinanceApiRestClient.java index 67213d2bc..df4749a2e 100644 --- a/src/main/java/com/binance/api/client/BinanceApiRestClient.java +++ b/src/main/java/com/binance/api/client/BinanceApiRestClient.java @@ -1,10 +1,12 @@ package com.binance.api.client; import com.binance.api.client.domain.account.Account; +import com.binance.api.client.domain.account.DepositAddress; import com.binance.api.client.domain.account.DepositHistory; import com.binance.api.client.domain.account.NewOrder; import com.binance.api.client.domain.account.NewOrderResponse; import com.binance.api.client.domain.account.Order; +import com.binance.api.client.domain.account.Trade; import com.binance.api.client.domain.account.WithdrawHistory; import com.binance.api.client.domain.account.request.AllOrdersRequest; import com.binance.api.client.domain.account.request.CancelOrderRequest; @@ -17,8 +19,6 @@ import com.binance.api.client.domain.market.OrderBook; import com.binance.api.client.domain.market.TickerPrice; import com.binance.api.client.domain.market.TickerStatistics; -import retrofit2.Call; -import retrofit2.http.Query; import java.util.List; @@ -166,6 +166,33 @@ public interface BinanceApiRestClient { */ Account getAccount(); + /** + * Get trades for a specific account and symbol. + * + * @param symbol symbol to get trades from + * @param limit default 500; max 500 + * @param fromId TradeId to fetch from. Default gets most recent trades. + * @return a list of trades + */ + List getMyTrades(String symbol, Integer limit, Long fromId, Long recvWindow, Long timestamp); + + /** + * Get trades for a specific account and symbol. + * + * @param symbol symbol to get trades from + * @param limit default 500; max 500 + * @return a list of trades + */ + List getMyTrades(String symbol, Integer limit); + + /** + * Get trades for a specific account and symbol. + * + * @param symbol symbol to get trades from + * @return a list of trades + */ + List getMyTrades(String symbol); + /** * Submit a withdraw request. * @@ -192,6 +219,13 @@ public interface BinanceApiRestClient { */ WithdrawHistory getWithdrawHistory(String asset); + /** + * Fetch deposit address. + * + * @return deposit address for a given asset. + */ + DepositAddress getDepositAddress(String asset); + // User stream endpoints /** diff --git a/src/main/java/com/binance/api/client/constant/BinanceApiConstants.java b/src/main/java/com/binance/api/client/constant/BinanceApiConstants.java index f990373e7..9a3e1ece8 100644 --- a/src/main/java/com/binance/api/client/constant/BinanceApiConstants.java +++ b/src/main/java/com/binance/api/client/constant/BinanceApiConstants.java @@ -8,7 +8,7 @@ public class BinanceApiConstants { /** * REST API base URL. */ - public static final String API_BASE_URL = "https://www.binance.com"; + public static final String API_BASE_URL = "https://api.binance.com"; /** * Streaming API base URL. diff --git a/src/main/java/com/binance/api/client/domain/account/Deposit.java b/src/main/java/com/binance/api/client/domain/account/Deposit.java index 653491876..8b6e654c1 100644 --- a/src/main/java/com/binance/api/client/domain/account/Deposit.java +++ b/src/main/java/com/binance/api/client/domain/account/Deposit.java @@ -25,6 +25,16 @@ public class Deposit { */ private String insertTime; + /** + * Transaction id + */ + private String txId; + + /** + * (0:pending,1:success) + */ + private int status; + public String getAmount() { return amount; } @@ -49,12 +59,30 @@ public void setInsertTime(String insertTime) { this.insertTime = insertTime; } + public String getTxId() { + return txId; + } + + public void setTxId(String txId) { + this.txId = txId; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) .append("amount", amount) .append("asset", asset) .append("insertTime", insertTime) + .append("txId", txId) + .append("status", status) .toString(); } } diff --git a/src/main/java/com/binance/api/client/domain/account/DepositAddress.java b/src/main/java/com/binance/api/client/domain/account/DepositAddress.java new file mode 100644 index 000000000..9279bb76a --- /dev/null +++ b/src/main/java/com/binance/api/client/domain/account/DepositAddress.java @@ -0,0 +1,60 @@ +package com.binance.api.client.domain.account; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * A deposit address for a given asset. + */ +public class DepositAddress { + + private String address; + + private boolean success; + + private String addressTag; + + private String asset; + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getAddressTag() { + return addressTag; + } + + public void setAddressTag(String addressTag) { + this.addressTag = addressTag; + } + + public String getAsset() { + return asset; + } + + public void setAsset(String asset) { + this.asset = asset; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) + .append("address", address) + .append("success", success) + .append("addressTag", addressTag) + .append("asset", asset) + .toString(); + } +} \ No newline at end of file diff --git a/src/main/java/com/binance/api/client/domain/account/DepositHistory.java b/src/main/java/com/binance/api/client/domain/account/DepositHistory.java index dd5d24537..1034cefb0 100644 --- a/src/main/java/com/binance/api/client/domain/account/DepositHistory.java +++ b/src/main/java/com/binance/api/client/domain/account/DepositHistory.java @@ -13,7 +13,7 @@ */ public class DepositHistory { - @JsonProperty("withdrawList") + @JsonProperty("depositList") private List depositList; private boolean success; diff --git a/src/main/java/com/binance/api/client/domain/account/Trade.java b/src/main/java/com/binance/api/client/domain/account/Trade.java new file mode 100644 index 000000000..68e449e3f --- /dev/null +++ b/src/main/java/com/binance/api/client/domain/account/Trade.java @@ -0,0 +1,148 @@ +package com.binance.api.client.domain.account; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * Represents an executed trade. + */ +public class Trade { + + /** + * Trade id. + */ + private Long id; + + /** + * Price. + */ + private String price; + + /** + * Quantity. + */ + private String qty; + + /** + * Commission. + */ + private String commission; + + /** + * Asset on which commission is taken + */ + private String commissionAsset; + + /** + * Trade execution time. + */ + private long time; + + @JsonProperty("isBuyer") + private boolean buyer; + + @JsonProperty("isMaker") + private boolean maker; + + @JsonProperty("isBestMatch") + private boolean bestMatch; + + private String orderId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPrice() { + return price; + } + + public void setPrice(String price) { + this.price = price; + } + + public String getQty() { + return qty; + } + + public void setQty(String qty) { + this.qty = qty; + } + + public String getCommission() { + return commission; + } + + public void setCommission(String commission) { + this.commission = commission; + } + + public String getCommissionAsset() { + return commissionAsset; + } + + public void setCommissionAsset(String commissionAsset) { + this.commissionAsset = commissionAsset; + } + + public long getTime() { + return time; + } + + public void setTime(long time) { + this.time = time; + } + + public boolean isBuyer() { + return buyer; + } + + public void setBuyer(boolean buyer) { + this.buyer = buyer; + } + + public boolean isMaker() { + return maker; + } + + public void setMaker(boolean maker) { + this.maker = maker; + } + + public boolean isBestMatch() { + return bestMatch; + } + + public void setBestMatch(boolean bestMatch) { + this.bestMatch = bestMatch; + } + + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) + .append("id", id) + .append("price", price) + .append("qty", qty) + .append("commission", commission) + .append("commissionAsset", commissionAsset) + .append("time", time) + .append("buyer", buyer) + .append("maker", maker) + .append("bestMatch", bestMatch) + .append("orderId", orderId) + .toString(); + } +} diff --git a/src/main/java/com/binance/api/client/domain/account/Withdraw.java b/src/main/java/com/binance/api/client/domain/account/Withdraw.java index a9fb460a2..b6518db34 100644 --- a/src/main/java/com/binance/api/client/domain/account/Withdraw.java +++ b/src/main/java/com/binance/api/client/domain/account/Withdraw.java @@ -30,7 +30,7 @@ public class Withdraw { private String successTime; /** - * Ethereum transaction id. + * Transaction id. */ private String txId; @@ -39,6 +39,11 @@ public class Withdraw { */ private String id; + /** + * (0:Email Sent,1:Cancelled 2:Awaiting Approval 3:Rejected 4:Processing 5:Failure 6:Completed) + */ + private int status; + public String getAmount() { return amount; } @@ -95,6 +100,14 @@ public void setId(String id) { this.id = id; } + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) @@ -105,6 +118,7 @@ public String toString() { .append("successTime", successTime) .append("txId", txId) .append("id", id) + .append("status", status) .toString(); } } diff --git a/src/main/java/com/binance/api/client/impl/BinanceApiAsyncRestClientImpl.java b/src/main/java/com/binance/api/client/impl/BinanceApiAsyncRestClientImpl.java index 13b3c99ea..73a70c5da 100644 --- a/src/main/java/com/binance/api/client/impl/BinanceApiAsyncRestClientImpl.java +++ b/src/main/java/com/binance/api/client/impl/BinanceApiAsyncRestClientImpl.java @@ -4,10 +4,12 @@ import com.binance.api.client.BinanceApiCallback; import com.binance.api.client.constant.BinanceApiConstants; import com.binance.api.client.domain.account.Account; +import com.binance.api.client.domain.account.DepositAddress; import com.binance.api.client.domain.account.DepositHistory; import com.binance.api.client.domain.account.NewOrder; import com.binance.api.client.domain.account.NewOrderResponse; import com.binance.api.client.domain.account.Order; +import com.binance.api.client.domain.account.Trade; import com.binance.api.client.domain.account.WithdrawHistory; import com.binance.api.client.domain.account.request.AllOrdersRequest; import com.binance.api.client.domain.account.request.CancelOrderRequest; @@ -146,6 +148,21 @@ public void getAccount(BinanceApiCallback callback) { binanceApiService.getAccount(BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, timestamp).enqueue(new BinanceApiCallbackAdapter<>(callback)); } + @Override + public void getMyTrades(String symbol, Integer limit, Long fromId, Long recvWindow, Long timestamp, BinanceApiCallback> callback) { + binanceApiService.getMyTrades(symbol, limit, fromId, recvWindow, timestamp).enqueue(new BinanceApiCallbackAdapter<>(callback)); + } + + @Override + public void getMyTrades(String symbol, Integer limit, BinanceApiCallback> callback) { + getMyTrades(symbol, limit, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis(), callback); + } + + @Override + public void getMyTrades(String symbol, BinanceApiCallback> callback) { + getMyTrades(symbol, null, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis(), callback); + } + @Override public void withdraw(String asset, String address, String amount, String name, BinanceApiCallback callback) { binanceApiService.withdraw(asset, address, amount, name, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()) @@ -164,6 +181,12 @@ public void getWithdrawHistory(String asset, BinanceApiCallback .enqueue(new BinanceApiCallbackAdapter<>(callback)); } + @Override + public void getDepositAddress(String asset, BinanceApiCallback callback) { + binanceApiService.getDepositAddress(asset, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()) + .enqueue(new BinanceApiCallbackAdapter<>(callback)); + } + // User stream endpoints @Override diff --git a/src/main/java/com/binance/api/client/impl/BinanceApiRestClientImpl.java b/src/main/java/com/binance/api/client/impl/BinanceApiRestClientImpl.java index 5e2f72373..a536c7666 100644 --- a/src/main/java/com/binance/api/client/impl/BinanceApiRestClientImpl.java +++ b/src/main/java/com/binance/api/client/impl/BinanceApiRestClientImpl.java @@ -3,10 +3,12 @@ import com.binance.api.client.BinanceApiRestClient; import com.binance.api.client.constant.BinanceApiConstants; import com.binance.api.client.domain.account.Account; +import com.binance.api.client.domain.account.DepositAddress; import com.binance.api.client.domain.account.DepositHistory; import com.binance.api.client.domain.account.NewOrder; import com.binance.api.client.domain.account.NewOrderResponse; import com.binance.api.client.domain.account.Order; +import com.binance.api.client.domain.account.Trade; import com.binance.api.client.domain.account.WithdrawHistory; import com.binance.api.client.domain.account.request.AllOrdersRequest; import com.binance.api.client.domain.account.request.CancelOrderRequest; @@ -139,7 +141,22 @@ public Account getAccount(Long recvWindow, Long timestamp) { @Override public Account getAccount() { - return executeSync(binanceApiService.getAccount(BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis())); + return getAccount(BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()); + } + + @Override + public List getMyTrades(String symbol, Integer limit, Long fromId, Long recvWindow, Long timestamp) { + return executeSync(binanceApiService.getMyTrades(symbol, limit, fromId, recvWindow, timestamp)); + } + + @Override + public List getMyTrades(String symbol, Integer limit) { + return getMyTrades(symbol, limit, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()); + } + + @Override + public List getMyTrades(String symbol) { + return getMyTrades(symbol, null, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()); } @Override @@ -157,6 +174,11 @@ public WithdrawHistory getWithdrawHistory(String asset) { return executeSync(binanceApiService.getWithdrawHistory(asset, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis())); } + @Override + public DepositAddress getDepositAddress(String asset) { + return executeSync(binanceApiService.getDepositAddress(asset, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis())); + } + // User stream endpoints @Override diff --git a/src/main/java/com/binance/api/client/impl/BinanceApiService.java b/src/main/java/com/binance/api/client/impl/BinanceApiService.java index 90696b532..10ae03c3f 100644 --- a/src/main/java/com/binance/api/client/impl/BinanceApiService.java +++ b/src/main/java/com/binance/api/client/impl/BinanceApiService.java @@ -5,11 +5,11 @@ import com.binance.api.client.domain.OrderType; import com.binance.api.client.domain.TimeInForce; import com.binance.api.client.domain.account.Account; -import com.binance.api.client.domain.account.Deposit; +import com.binance.api.client.domain.account.DepositAddress; import com.binance.api.client.domain.account.DepositHistory; import com.binance.api.client.domain.account.NewOrderResponse; import com.binance.api.client.domain.account.Order; -import com.binance.api.client.domain.account.Withdraw; +import com.binance.api.client.domain.account.Trade; import com.binance.api.client.domain.account.WithdrawHistory; import com.binance.api.client.domain.event.ListenKey; import com.binance.api.client.domain.general.ServerTime; @@ -106,19 +106,28 @@ Call> getAllOrders(@Query("symbol") String symbol, @Query("orderId") Call getAccount(@Query("recvWindow") Long recvWindow, @Query("timestamp") Long timestamp); @Headers(BinanceApiConstants.ENDPOINT_SECURITY_TYPE_SIGNED_HEADER) - @POST("/wapi/v1/withdraw.html") + @GET("/api/v3/myTrades") + Call> getMyTrades(@Query("symbol") String symbol, @Query("limit") Integer limit, @Query("fromId") Long fromId, + @Query("recvWindow") Long recvWindow, @Query("timestamp") Long timestamp); + + @Headers(BinanceApiConstants.ENDPOINT_SECURITY_TYPE_SIGNED_HEADER) + @POST("/wapi/v3/withdraw.html") Call withdraw(@Query("asset") String asset, @Query("address") String address, @Query("amount") String amount, @Query("name") String name, @Query("recvWindow") Long recvWindow, @Query("timestamp") Long timestamp); @Headers(BinanceApiConstants.ENDPOINT_SECURITY_TYPE_SIGNED_HEADER) - @POST("/wapi/v1/getDepositHistory.html") + @GET("/wapi/v3/depositHistory.html") Call getDepositHistory(@Query("asset") String asset, @Query("recvWindow") Long recvWindow, @Query("timestamp") Long timestamp); @Headers(BinanceApiConstants.ENDPOINT_SECURITY_TYPE_SIGNED_HEADER) - @POST("/wapi/v1/getWithdrawHistory.html") + @GET("/wapi/v3/withdrawHistory.html") Call getWithdrawHistory(@Query("asset") String asset, @Query("recvWindow") Long recvWindow, @Query("timestamp") Long timestamp); + @Headers(BinanceApiConstants.ENDPOINT_SECURITY_TYPE_SIGNED_HEADER) + @GET("/wapi/v3/depositAddress.html") + Call getDepositAddress(@Query("asset") String asset, @Query("recvWindow") Long recvWindow, @Query("timestamp") Long timestamp); + // User stream endpoints @Headers(BinanceApiConstants.ENDPOINT_SECURITY_TYPE_APIKEY_HEADER) diff --git a/src/test/java/com/binance/api/examples/AccountEndpointsExample.java b/src/test/java/com/binance/api/examples/AccountEndpointsExample.java index b96ef9a99..bdbaf7469 100644 --- a/src/test/java/com/binance/api/examples/AccountEndpointsExample.java +++ b/src/test/java/com/binance/api/examples/AccountEndpointsExample.java @@ -3,6 +3,9 @@ import com.binance.api.client.BinanceApiClientFactory; import com.binance.api.client.BinanceApiRestClient; import com.binance.api.client.domain.account.Account; +import com.binance.api.client.domain.account.Trade; + +import java.util.List; /** * Examples on how to get account information. @@ -18,12 +21,19 @@ public static void main(String[] args) { System.out.println(account.getBalances()); System.out.println(account.getAssetBalance("ETH")); + // Get list of trades + List myTrades = client.getMyTrades("NEOETH"); + System.out.println(myTrades); + // Get withdraw history System.out.println(client.getWithdrawHistory("ETH")); // Get deposit history System.out.println(client.getDepositHistory("ETH")); + // Get deposit address + System.out.println(client.getDepositAddress("ETH")); + // Withdraw client.withdraw("ETH", "0x123", "0.1", null); } diff --git a/src/test/java/com/binance/api/examples/AccountEndpointsExampleAsync.java b/src/test/java/com/binance/api/examples/AccountEndpointsExampleAsync.java index df054119e..560b4f27f 100644 --- a/src/test/java/com/binance/api/examples/AccountEndpointsExampleAsync.java +++ b/src/test/java/com/binance/api/examples/AccountEndpointsExampleAsync.java @@ -16,6 +16,9 @@ public static void main(String[] args) { // Get account balances (async) client.getAccount((Account response) -> System.out.println(response.getAssetBalance("ETH"))); + // Get list of trades (async) + client.getMyTrades("NEOETH", response -> System.out.println(response)); + // Get withdraw history (async) client.getWithdrawHistory("ETH", response -> System.out.println(response));