This repository was archived by the owner on Oct 30, 2023. It is now read-only.
forked from joaopsilva/binance-java-api
-
Notifications
You must be signed in to change notification settings - Fork 599
Expand file tree
/
Copy pathBinanceApiMarginRestClient.java
More file actions
executable file
·131 lines (110 loc) · 3.51 KB
/
BinanceApiMarginRestClient.java
File metadata and controls
executable file
·131 lines (110 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
package com.binance.api.client;
import com.binance.api.client.domain.TransferType;
import com.binance.api.client.domain.account.*;
import com.binance.api.client.domain.account.request.*;
import java.util.List;
public interface BinanceApiMarginRestClient {
/**
* Get current margin account information using default parameters.
*/
MarginAccount getAccount();
/**
* Get all orders on margin account.
*
* @param orderRequest order request parameters
*/
List<Order> getAllOrders(AllOrdersRequest orderRequest);
/**
* Get all open orders on margin account for a symbol.
*
* @param orderRequest order request parameters
*/
List<Order> getOpenOrders(OrderRequest orderRequest);
/**
* Send in a new margin order.
*
* @param order the new order to submit.
* @return a response containing details about the newly placed order.
*/
MarginNewOrderResponse newOrder(MarginNewOrder order);
/**
* Cancel an active margin order.
*
* @param cancelOrderRequest order status request parameters
*/
CancelOrderResponse cancelOrder(CancelOrderRequest cancelOrderRequest);
/**
* Check margin order's status.
* @param orderStatusRequest order status request options/filters
*
* @return an order
*/
Order getOrderStatus(OrderStatusRequest orderStatusRequest);
/**
* Get margin trades for a specific symbol.
*
* @param symbol symbol to get trades from
* @return a list of trades
*/
List<Trade> getMyTrades(String symbol);
// User stream endpoints
/**
* Start a new user data stream.
*
* @return a listen key that can be used with data streams
*/
String startUserDataStream();
/**
* PING a user data stream to prevent a time out.
*
* @param listenKey listen key that identifies a data stream
*/
void keepAliveUserDataStream(String listenKey);
/**
* Execute transfer between spot account and margin account
* @param asset asset to repay
* @param amount amount to repay
* @return transaction id
*/
MarginTransaction transfer(String asset, String amount, TransferType type);
/**
* Apply for a loan
* @param asset asset to repay
* @param amount amount to repay
* @return transaction id
*/
MarginTransaction borrow(String asset, String amount);
/**
* Query loan record
* @param asset asset to query
* @return repay records
*/
RepayQueryResult queryRepay(String asset, long startTime);
/**
* Query max borrowable
* @param asset asset to query
* @return max borrowable
*/
MaxBorrowableQueryResult queryMaxBorrowable(String asset);
/**
* Query loan record
* @param asset asset to query
* @param txId the tranId in POST /sapi/v1/margin/repay
* @return loan records
*/
RepayQueryResult queryRepay(String asset, String txId);
/**
* Repay loan for margin account
* @param asset asset to repay
* @param amount amount to repay
* @return transaction id
*/
MarginTransaction repay(String asset, String amount);
/**
* Query loan record
* @param asset asset to query
* @param txId the tranId in POST /sapi/v1/margin/loan
* @return loan records
*/
LoanQueryResult queryLoan(String asset, String txId);
}