Margin
Installation
- Maven
- Gradle
pom.xml
<dependency>
<groupId>{{groupId}}</groupId>
<artifactId>{{artifactId}}</artifactId>
<version>{{version}}</version>
</dependency>
build.gradle
implementation '{{groupId}}:{{artifactId}}:{{version}}'
Client instantiation
MarginClient client = new MarginClient(key, secret);
Features
Execute transfer between spot account and cross margin account
- Spot to Margin
- Margin to spot
- Sync
- Async
try{
Transaction res = client.transfer(new TransferParams(asset, amount, TransferType.MAIN_TO_MARGIN)).sync();
}catch(ApiException e){
//...
}
client.transfer(new TransferParams(asset, amount, TransferType.MAIN_TO_MARGIN)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
Transaction res = client.transfer(new TransferParams(asset, amount, TransferType.MARGIN_TO_MAIN)).sync();
}catch(ApiException e){
//...
}
client.transfer(new TransferParams(asset, amount, TransferType.MARGIN_TO_MAIN)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Apply for a loan
- Sync
- Async
try{
Transaction res = client.borrow(new BorrowParams(asset, amount, symbol, isIsolated)).sync();
}catch(ApiException e){
//...
}
client.borrow(new BorrowParams(asset, amount, symbol, isIsolated)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Repay loan
- Sync
- Async
try{
Transaction res = client.repay(new RepayParams(asset, amount, symbol, isIsolated)).sync();
}catch(ApiException e){
//...
}
client.repay(new RepayParams(asset, amount, symbol, isIsolated)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get info about an asset
- Sync
- Async
try{
Asset res = client.getAsset(new AssetParams(asset)).sync();
}catch(ApiException e){
//...
}
client.getAsset(new AssetParams(asset)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get info about all assets
- Sync
- Async
try{
List<Asset> res = client.getAllAssets().sync();
}catch(ApiException e){
//...
}
client.getAllAssets().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get info about a cross margin pair
- Sync
- Async
try{
CrossSymbol res = client.getCrossMarginPair(new PairParams(symbol)).sync();
}catch(ApiException e){
//...
}
client.getCrossMarginPair(new PairParams(symbol)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Gets the price Index of a symbol
- Sync
- Async
try{
PriceIndex res = client.getPriceIndex(new PriceIndexParams(symbol)).sync();
}catch(ApiException e){
//...
}
client.getPriceIndex(new PriceIndexParams(symbol)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Send a Market order.
- BUY
- SELL
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(MarketOrder.buy(symbol, quantity)).sync();
}catch(ApiException e){
//...
}
client.newOrder(MarketOrder.buy(symbol, quantity)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(MarketOrder.sell(symbol, quantity)).sync();
}catch(ApiException e){
//...
}
client.newOrder(MarketOrder.sell(symbol, quantity)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Send a Market Quote order.
- BUY
- SELL
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(MarketQuoteOrder.buy(symbol, quoteAssetQty)).sync();
}catch(ApiException e){
//...
}
client.newOrder(MarketQuoteOrder.buy(symbol, quoteAssetQty)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(MarketQuoteOrder.sell(symbol, quoteAssetQty)).sync();
}catch(ApiException e){
//...
}
client.newOrder(MarketQuoteOrder.sell(symbol, quoteAssetQty)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Send a Limit order.
- BUY
- SELL
- BUY (TimeInForce.GTC)
- SELL (TimeInForce.GTC)
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(LimitOrder.buy(symbol, quantity, price, timeInForce)).sync();
}catch(ApiException e){
//...
}
client.newOrder(LimitOrder.buy(symbol, quantity, price, timeInForce)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(LimitOrder.sell(symbol, quantity, price, timeInForce)).sync();
}catch(ApiException e){
//...
}
client.newOrder(LimitOrder.sell(symbol, quantity, price, timeInForce)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(LimitOrder.buy(symbol, quantity, price)).sync();
}catch(ApiException e){
//...
}
client.newOrder(LimitOrder.buy(symbol, quantity, price)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(LimitOrder.sell(symbol, quantity, price)).sync();
}catch(ApiException e){
//...
}
client.newOrder(LimitOrder.sell(symbol, quantity, price)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Send a Limit Maker order.
- BUY (TimeInForce.GTC)
- SELL (TimeInForce.GTC)
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(LimitMakerOrder.buy(symbol, quantity, price)).sync();
}catch(ApiException e){
//...
}
client.newOrder(LimitMakerOrder.buy(symbol, quantity, price)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(LimitMakerOrder.sell(symbol, quantity, price)).sync();
}catch(ApiException e){
//...
}
client.newOrder(LimitMakerOrder.sell(symbol, quantity, price)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Send a Stop Loss order.
- BUY (Stop price)
- SELL (Stop price)
- BUY (Trailing delta)
- SELL (Trailing delta)
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(StopLossOrder.buy(symbol, quantity, stopPrice)).sync();
}catch(ApiException e){
//...
}
client.newOrder(StopLossOrder.buy(symbol, quantity, stopPrice)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(StopLossOrder.sell(symbol, quantity, stopPrice)).sync();
}catch(ApiException e){
//...
}
client.newOrder(StopLossOrder.sell(symbol, quantity, stopPrice)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(StopLossOrder.buy(symbol, quantity, trailingDelta)).sync();
}catch(ApiException e){
//...
}
client.newOrder(StopLossOrder.buy(symbol, quantity, trailingDelta)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(StopLossOrder.sell(symbol, quantity, trailingDelta)).sync();
}catch(ApiException e){
//...
}
client.newOrder(StopLossOrder.sell(symbol, quantity, trailingDelta)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Send a Stop Loss Limit order.
- BUY
- SELL
- BUY (TimeInForce.GTC)
- SELL (TimeInForce.GTC)
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(StopLossOrder.buy(symbol, quantity, price, stopPrice, timeInForce)).sync();
}catch(ApiException e){
//...
}
client.newOrder(StopLossOrder.buy(symbol, quantity, price, stopPrice, timeInForce)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(StopLossOrder.sell(symbol, quantity, price, stopPrice, timeInForce)).sync();
}catch(ApiException e){
//...
}
client.newOrder(StopLossOrder.sell(symbol, quantity, price, stopPrice, timeInForce)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(StopLossOrder.buy(symbol, quantity, price, stopPrice)).sync();
}catch(ApiException e){
//...
}
client.newOrder(StopLossOrder.buy(symbol, quantity, price, stopPrice)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(StopLossOrder.sell(symbol, quantity, price, stopPrice)).sync();
}catch(ApiException e){
//...
}
client.newOrder(StopLossOrder.sell(symbol, quantity, price, stopPrice)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Send a Take Profit order.
- BUY (Stop price)
- SELL (Stop price)
- BUY (Trailing delta)
- SELL (Trailing delta)
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(TakeProfitOrder.buy(symbol, quantity, stopPrice)).sync();
}catch(ApiException e){
//...
}
client.newOrder(TakeProfitOrder.buy(symbol, quantity, stopPrice)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(TakeProfitOrder.sell(symbol, quantity, stopPrice)).sync();
}catch(ApiException e){
//...
}
client.newOrder(TakeProfitOrder.sell(symbol, quantity, stopPrice)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(TakeProfitOrder.buy(symbol, quantity, trailingDelta)).sync();
}catch(ApiException e){
//...
}
client.newOrder(TakeProfitOrder.buy(symbol, quantity, trailingDelta)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(TakeProfitOrder.sell(symbol, quantity, trailingDelta)).sync();
}catch(ApiException e){
//...
}
client.newOrder(TakeProfitOrder.sell(symbol, quantity, trailingDelta)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Send a Take Profit Limit order.
- BUY
- SELL
- BUY (TimeInForce.GTC)
- SELL (TimeInForce.GTC)
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(TakeProfitLimitOrder.buy(symbol, quantity, price, stopPrice, timeInForce)).sync();
}catch(ApiException e){
//...
}
client.newOrder(TakeProfitLimitOrder.buy(symbol, quantity, price, stopPrice, timeInForce)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(TakeProfitLimitOrder.sell(symbol, quantity, price, stopPrice, timeInForce)).sync();
}catch(ApiException e){
//...
}
client.newOrder(TakeProfitLimitOrder.sell(symbol, quantity, price, stopPrice, timeInForce)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(TakeProfitLimitOrder.buy(symbol, quantity, price, stopPrice)).sync();
}catch(ApiException e){
//...
}
client.newOrder(TakeProfitLimitOrder.buy(symbol, quantity, price, stopPrice)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOrderRecord res = client.newOrder(TakeProfitLimitOrder.sell(symbol, quantity, price, stopPrice)).sync();
}catch(ApiException e){
//...
}
client.newOrder(TakeProfitLimitOrder.sell(symbol, quantity, price, stopPrice)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Cancel an active order
- Sync
- Async
try{
CancelOrderResponse res = client.cancelOrder(new CancelOrderParams(symbol, orderId)).sync();
}catch(ApiException e){
//...
}
client.cancelOrder(new CancelOrderParams(symbol, orderId)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Cancel open orders
- Sync
- Async
try{
List<CancelOrderResponse> res = client.cancelOpenOrders(new CancelOpenOrdersParams(symbol)).sync();
}catch(ApiException e){
//...
}
client.cancelOpenOrders(new CancelOpenOrdersParams(symbol)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get cross margin transfer history
- All
- By asset
- By transaction
- Framed and paginated
- Sync
- Async
try{
TransferRecords res = client.getTransferHistory().sync();
}catch(ApiException e){
//...
}
client.getTransferHistory().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
TransferRecords res = client.getTransferHistory(new TransactionHistoryParams(asset)).sync();
}catch(ApiException e){
//...
}
client.getTransferHistory(new TransactionHistoryParams(asset)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
TransferRecords res = client.getTransferHistory(new TransactionHistoryParams(asset, tansactionId)).sync();
}catch(ApiException e){
//...
}
client.getTransferHistory(new TransactionHistoryParams(asset, tansactionId)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
TransferRecords res = client.getTransferHistory(new TransactionHistoryParams(asset, tansactionId), new FramedPaging(startTime, endTime, page, limit)).sync();
}catch(ApiException e){
//...
}
client.getTransferHistory(new TransactionHistoryParams(asset, tansactionId), new FramedPaging(startTime, endTime, page, limit)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get loan Record
- By asset
- By transaction
- Framed and paginated
- Sync
- Async
try{
LoanRecord res = client.getLoanRecord(new TransactionHistoryParams(asset)).sync();
}catch(ApiException e){
//...
}
client.getLoanRecord(new TransactionHistoryParams(asset)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
LoanRecord res = client.getLoanRecord(new TransactionHistoryParams(asset, tansactionId)).sync();
}catch(ApiException e){
//...
}
client.getLoanRecord(new TransactionHistoryParams(asset, tansactionId)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
LoanRecord res = client.getLoanRecord(new TransactionHistoryParams(asset, tansactionId), new FramedPaging(startTime, endTime, page, limit)).sync();
}catch(ApiException e){
//...
}
client.getLoanRecord(new TransactionHistoryParams(asset, tansactionId), new FramedPaging(startTime, endTime, page, limit)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get repay Record
- By asset
- By transaction
- Framed and paginated
- Sync
- Async
try{
RepayRecords res = client.getRepayRecord(new TransactionHistoryParams(asset)).sync();
}catch(ApiException e){
//...
}
client.getRepayRecord(new TransactionHistoryParams(asset)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
RepayRecords res = client.getRepayRecord(new TransactionHistoryParams(asset, tansactionId)).sync();
}catch(ApiException e){
//...
}
client.getRepayRecord(new TransactionHistoryParams(asset, tansactionId)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
RepayRecords res = client.getRepayRecord(new TransactionHistoryParams(asset, tansactionId), new FramedPaging(startTime, endTime, page, limit)).sync();
}catch(ApiException e){
//...
}
client.getRepayRecord(new TransactionHistoryParams(asset, tansactionId), new FramedPaging(startTime, endTime, page, limit)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get interest history
- By asset
- By transaction
- Framed and paginated
- Sync
- Async
try{
InterestHistory res = client.getInterestHistory(new TransactionHistoryParams(asset)).sync();
}catch(ApiException e){
//...
}
client.getInterestHistory(new TransactionHistoryParams(asset)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
InterestHistory res = client.getInterestHistory(new TransactionHistoryParams(asset, tansactionId)).sync();
}catch(ApiException e){
//...
}
client.getInterestHistory(new TransactionHistoryParams(asset, tansactionId)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
InterestHistory res = client.getInterestHistory(new TransactionHistoryParams(asset, tansactionId), new FramedPaging(startTime, endTime, page, limit)).sync();
}catch(ApiException e){
//...
}
client.getInterestHistory(new TransactionHistoryParams(asset, tansactionId), new FramedPaging(startTime, endTime, page, limit)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get force liquidation record
- Default
- Framed and paginated
- Sync
- Async
try{
ForceLiquidationRecords res = client.getForceLiquidationRecord(new ForceLiquidationRecordParams(isolatedSymbol)).sync();
}catch(ApiException e){
//...
}
client.getForceLiquidationRecord(new ForceLiquidationRecordParams(isolatedSymbol)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
ForceLiquidationRecords res = client.getForceLiquidationRecord(new ForceLiquidationRecordParams(isolatedSymbol, new FramedPaging(startTime, endTime, page, limit))).sync();
}catch(ApiException e){
//...
}
client.getForceLiquidationRecord(new ForceLiquidationRecordParams(isolatedSymbol, new FramedPaging(startTime, endTime, page, limit))).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
note
Response in descending order.
Get Margin account details
- Sync
- Async
try{
Account res = client.getAccount().sync();
}catch(ApiException e){
//...
}
client.getAccount().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get order status.
- By symbol
- By order id
- Sync
- Async
try{
OrderInfo res = client.getOrder(new OrderParams(symbol, isIsolated)).sync();
}catch(ApiException e){
//...
}
client.getOrder(new OrderParams(symbol, isIsolated)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
OrderInfo res = client.getOrder(new OrderParams(symbol, orderId, isIsolated)).sync();
}catch(ApiException e){
//...
}
client.getOrder(new OrderParams(symbol, orderId, isIsolated)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get open orders
- All
- By symbol
- Sync
- Async
try{
List<OrderInfo> res = client.getOpenOrders().sync();
}catch(ApiException e){
//...
}
client.getOpenOrders().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<OrderInfo> res = client.getOpenOrders(new OpenOrdersParams(symbol, isIsolated)).sync();
}catch(ApiException e){
//...
}
client.getOpenOrders(new OpenOrdersParams(symbol, isIsolated)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get all orders
- Default
- Framed
- Sync
- Async
try{
List<OrderInfo> res = client.getAllOrders(new AllOrdersParams(symbol, orderId, isIsolated)).sync();
}catch(ApiException e){
//...
}
client.getAllOrders(new AllOrdersParams(symbol, orderId, isIsolated)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<OrderInfo> res = client.getAllOrders(new AllOrdersParams(symbol, orderId, isIsolated), new TimeFrame(startTime, endTime, limit)).sync();
}catch(ApiException e){
//...
}
client.getAllOrders(new AllOrdersParams(symbol, orderId, isIsolated), new TimeFrame(startTime, endTime, limit)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Send OCO order
- Sync
- Async
try{
NewOCOOrderRecord res = client.newOCO(new NewOCOOrderParams(symbol, OrderSide.BUY, quantity, price, stopPrice, stopPrice, TimeInForce.GTC)).sync();
}catch(ApiException e){
//...
}
client.newOCO(new NewOCOOrderParams(symbol, OrderSide.BUY, quantity, price, stopPrice, stopPrice, TimeInForce.GTC)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Cancel OCO order
- By symbol
- By order id
- Sync
- Async
try{
NewOCOOrderRecord res = client.cancelOCO(new CancelOCOParams(symbol, isIsolated)).sync();
}catch(ApiException e){
//...
}
client.cancelOCO(new CancelOCOParams(symbol, isIsolated)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
NewOCOOrderRecord res = client.cancelOCO(new CancelOCOParams(symbol, orderId, isIsolated)).sync();
}catch(ApiException e){
//...
}
client.cancelOCO(new CancelOCOParams(symbol, orderId, isIsolated)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get OCO order
- By symbol
- By order id
- Sync
- Async
try{
OCOOrderRecord res = client.getOCO(new GetOCOParams(symbol, isIsolated)).sync();
}catch(ApiException e){
//...
}
client.getOCO(new GetOCOParams(symbol, isIsolated)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
OCOOrderRecord res = client.getOCO(new GetOCOParams(symbol, orderId, isIsolated)).sync();
}catch(ApiException e){
//...
}
client.getOCO(new GetOCOParams(symbol, orderId, isIsolated)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get all OCO
- By symbol
- From order id
- Framed
- Sync
- Async
try{
List<OCOOrderRecord> res = client.getAllOCO(new GetAllOCOParams(symbol, isIsolated)).sync();
}catch(ApiException e){
//...
}
client.getAllOCO(new GetAllOCOParams(symbol, isIsolated)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<OCOOrderRecord> res = client.getAllOCO(new GetAllOCOParams(symbol, fromId, isIsolated)).sync();
}catch(ApiException e){
//...
}
client.getAllOCO(new GetAllOCOParams(symbol, fromId, isIsolated)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<OCOOrderRecord> res = client.getAllOCO(new GetAllOCOParams(symbol, fromId, isIsolated), new TimeFrame(startTime, endTime, limit)).sync();
}catch(ApiException e){
//...
}
client.getAllOCO(new GetAllOCOParams(symbol, fromId, isIsolated), new TimeFrame(startTime, endTime, limit)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
get open OCO
- All
- By symbol
- Sync
- Async
try{
List<OCOOrderRecord> res = client.getOpenOCO().sync();
}catch(ApiException e){
//...
}
client.getOpenOCO().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<OCOOrderRecord> res = client.getOpenOCO(new GetOpenOCOParams(symbol, isIsolated)).sync();
}catch(ApiException e){
//...
}
client.getOpenOCO(new GetOpenOCOParams(symbol, isIsolated)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get trades
- By symbol
- From order id
- Framed
- Sync
- Async
try{
List<Trade> res = client.getTrades(new TradeParams(symbol, isIsolated)).sync();
}catch(ApiException e){
//...
}
client.getTrades(new TradeParams(symbol, isIsolated)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<Trade> res = client.getTrades(new TradeParams(symbol, fromId, isIsolated)).sync();
}catch(ApiException e){
//...
}
client.getTrades(new TradeParams(symbol, fromId, isIsolated)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<Trade> res = client.getTrades(new TradeParams(symbol), new TimeFrame(startTime, endTime, limit)).sync();
}catch(ApiException e){
//...
}
client.getTrades(new TradeParams(symbol), new TimeFrame(startTime, endTime, limit)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Query Max Borrow
- Sync
- Async
try{
MaxBorrowable res = client.getMaxBorrowable(new MaxBorrowable(amount, borrowLimit)).sync();
}catch(ApiException e){
//...
}
client.getMaxBorrowable(new MaxBorrowable(amount, borrowLimit)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Query Max Transfer-Out Amount
- Sync
- Async
try{
MaxTransferable res = client.getMaxTransferable(new MaxTransferableParams(asset, isolatedSymbol)).sync();
}catch(ApiException e){
//...
}
client.getMaxTransferable(new MaxTransferableParams(asset, isolatedSymbol)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Make an isolated margin account transfer
- Sync
- Async
try{
IsolatedTransferRecords res = client.newIsolatedTransfer(new NewIsolatedTransferParams(asset, symbol, amount, transFrom, transTo)).sync();
}catch(ApiException e){
//...
}
client.newIsolatedTransfer(new NewIsolatedTransferParams(asset, symbol, amount, transFrom, transTo)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get isolated margin transfer history
- By symbol
- By symbol and isolated asset
- With transfer direction
- Framed and paginated
- Sync
- Async
try{
IsolatedTransferRecords res = client.getIsolatedTransferHistory(new IsolatedTransferHistoryParams(symbol)).sync();
}catch(ApiException e){
//...
}
client.getIsolatedTransferHistory(new IsolatedTransferHistoryParams(symbol)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
IsolatedTransferRecords res = client.getIsolatedTransferHistory(new IsolatedTransferHistoryParams(symbol, asset)).sync();
}catch(ApiException e){
//...
}
client.getIsolatedTransferHistory(new IsolatedTransferHistoryParams(symbol, asset)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
IsolatedTransferRecords res = client.getIsolatedTransferHistory(new IsolatedTransferHistoryParams(symbol, asset, transFrom, transTo)).sync();
}catch(ApiException e){
//...
}
client.getIsolatedTransferHistory(new IsolatedTransferHistoryParams(symbol, asset, transFrom, transTo)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
IsolatedTransferRecords res = client.getIsolatedTransferHistory(new IsolatedTransferHistoryParams(symbol, asset, transFrom, transTo), new FramedPaging(startTime, endTime, page, limit)).sync();
}catch(ApiException e){
//...
}
client.getIsolatedTransferHistory(new IsolatedTransferHistoryParams(symbol, asset, transFrom, transTo), new FramedPaging(startTime, endTime, page, limit)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Query isolated margin account info
- All
- By symbol
- Sync
- Async
try{
IsolatedAccount res = client.getIsolatedAccount().sync();
}catch(ApiException e){
//...
}
client.getIsolatedAccount().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
IsolatedAccount res = client.getIsolatedAccount(new IsolatedAccountParams(symbols)).sync();
}catch(ApiException e){
//...
}
client.getIsolatedAccount(new IsolatedAccountParams(symbols)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Enable isolated margin account for a specific symbol
- Sync
- Async
try{
ToogleAccountResponse res = client.enableIsolatedAccount(new ToogleAccountParams(symbol)).sync();
}catch(ApiException e){
//...
}
client.enableIsolatedAccount(new ToogleAccountParams(symbol)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Disable isolated margin account for a specific symbol
- Sync
- Async
try{
ToogleAccountResponse res = client.disableIsolatedAccount(new ToogleAccountParams(symbol)).sync();
}catch(ApiException e){
//...
}
client.disableIsolatedAccount(new ToogleAccountParams(symbol)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Query enabled isolated margin account limit
- Sync
- Async
try{
IsolatedAccountLimit res = client.getEnabledIsolatedAccountLimit().sync();
}catch(ApiException e){
//...
}
client.getEnabledIsolatedAccountLimit().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get info about an isolated symbol
- Sync
- Async
try{
IsolatedSymbol res = client.getIsolatedSymbol(new PairParams(symbol)).sync();
}catch(ApiException e){
//...
}
client.getIsolatedSymbol(new PairParams(symbol)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get info about all the isolated symbols.
- Sync
- Async
try{
List<IsolatedSymbol> res = client.getAllIsolatedSymbols().sync();
}catch(ApiException e){
//...
}
client.getAllIsolatedSymbols().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Toggle BNB Burn On Spot Trade And Margin Interest
- Sync
- Async
try{
BNBBurnStatus res = client.toggleBNBBurnOnSpotTradeAndMarginInterest(new ToggleBurnParams(spotBNBBurn, interestBNBBurn)).sync();
}catch(ApiException e){
//...
}
client.toggleBNBBurnOnSpotTradeAndMarginInterest(new ToggleBurnParams(spotBNBBurn, interestBNBBurn)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get BNB Burn Status
- Sync
- Async
try{
BNBBurnStatus res = client.getBNBBurnStatus().sync();
}catch(ApiException e){
//...
}
client.getBNBBurnStatus().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Query Margin Interest Rate History
- By symbol
- With VIP level
- Sync
- Async
try{
List<InterestRate> res = client.getInterestRateHistory(new InterestRateHistoryParams(asset)).sync();
}catch(ApiException e){
//...
}
client.getInterestRateHistory(new InterestRateHistoryParams(asset)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<InterestRate> res = client.getInterestRateHistory(new InterestRateHistoryParams(asset, vipLevel)).sync();
}catch(ApiException e){
//...
}
client.getInterestRateHistory(new InterestRateHistoryParams(asset, vipLevel)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get cross margin fee data
- All
- By coin
- By coin and VIP level
- Sync
- Async
try{
List<CrossFee> res = client.getMarginFeeData().sync();
}catch(ApiException e){
//...
}
client.getMarginFeeData().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<CrossFee> res = client.getMarginFeeData(CrossFeeParams(coin)).sync();
}catch(ApiException e){
//...
}
client.getMarginFeeData(CrossFeeParams(coin)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<CrossFee> res = client.getMarginFeeData(CrossFeeParams(coin, vipLevel)).sync();
}catch(ApiException e){
//...
}
client.getMarginFeeData(CrossFeeParams(coin, vipLevel)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get isolated margin fee data
- All
- By coin
- By coin and VIP level
- Sync
- Async
try{
List<IsolatedFee> res = client.getIsolatedFeeData().sync();
}catch(ApiException e){
//...
}
client.getIsolatedFeeData().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<IsolatedFee> res = client.getIsolatedFeeData(IsolatedFeeParams(coin)).sync();
}catch(ApiException e){
//...
}
client.getIsolatedFeeData(IsolatedFeeParams(coin)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<IsolatedFee> res = client.getIsolatedFeeData(IsolatedFeeParams(coin, vipLevel)).sync();
}catch(ApiException e){
//...
}
client.getIsolatedFeeData(IsolatedFeeParams(coin, vipLevel)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get isolated margin tier data
- All tiers
- By tier
- Sync
- Async
try{
List<IsolatedTierData> res = client.getIsolatedMarginTierData(new IsolatedTierDataParams(symbol)).sync();
}catch(ApiException e){
//...
}
client.getIsolatedMarginTierData(new IsolatedTierDataParams(symbol)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<IsolatedTierData> res = client.getIsolatedMarginTierData(new IsolatedTierDataParams(symbol, tier)).sync();
}catch(ApiException e){
//...
}
client.getIsolatedMarginTierData(new IsolatedTierDataParams(symbol, tier)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get order rate limit
- All
- By isolated symbol
- Sync
- Async
try{
List<OrderRateLimit> res = client.getOrderRateLimit().sync();
}catch(ApiException e){
//...
}
client.getOrderRateLimit().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
List<OrderRateLimit> res = client.getOrderRateLimit(new RateLimitParams(symbol, true)).sync();
}catch(ApiException e){
//...
}
client.getOrderRateLimit(new RateLimitParams(symbol, true)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
Get dust log (conversions into BNB of dust assets)
- All
- Framed
- Sync
- Async
try{
DustLogRecord res = client.getDustLog().sync();
}catch(ApiException e){
//...
}
client.getDustLog().async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});
- Sync
- Async
try{
DustLogRecord res = client.getDustLog(new TimeFrame(Long startTime, Long endTime)).sync();
}catch(ApiException e){
//...
}
client.getDustLog(new TimeFrame(Long startTime, Long endTime)).async((response, exception) -> {
if(exception == null){
//...
}else{
//...
}
});