kucoin-api 1.0.23 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/cjs/FuturesClient.d.ts +300 -111
- package/dist/cjs/FuturesClient.js +286 -110
- package/dist/cjs/FuturesClient.js.map +1 -1
- package/dist/cjs/SpotClient.d.ts +879 -306
- package/dist/cjs/SpotClient.js +900 -338
- package/dist/cjs/SpotClient.js.map +1 -1
- package/dist/mjs/FuturesClient.d.ts +300 -111
- package/dist/mjs/FuturesClient.js +286 -110
- package/dist/mjs/FuturesClient.js.map +1 -1
- package/dist/mjs/SpotClient.d.ts +879 -306
- package/dist/mjs/SpotClient.js +900 -338
- package/dist/mjs/SpotClient.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ Check out my related JavaScript/TypeScript/Node.js projects:
|
|
|
64
64
|
|
|
65
65
|
Most methods accept JS objects. These can be populated using parameters specified by Kucoin's API documentation.
|
|
66
66
|
|
|
67
|
-
- [Kucoin API Documentation](https://www.kucoin.com/docs/
|
|
67
|
+
- [Kucoin API Documentation](https://www.kucoin.com/docs-new/introduction)
|
|
68
68
|
- Node.js Quick Start Guides
|
|
69
69
|
- [Spot Node.js Kucoin Quick Start Guide](./examples/kucoin-SPOT-examples-nodejs.md)
|
|
70
70
|
- [Futures Node.js Kucoin Quick Start Guide](./examples/kucoin-FUTURES-examples-nodejs.md)
|
|
@@ -102,7 +102,7 @@ const client = new SpotClient({
|
|
|
102
102
|
});
|
|
103
103
|
|
|
104
104
|
try {
|
|
105
|
-
const spotBuyResult = await client.
|
|
105
|
+
const spotBuyResult = await client.submitHFOrder({
|
|
106
106
|
clientOid: client.generateNewOrderID(),
|
|
107
107
|
side: 'buy',
|
|
108
108
|
type: 'market',
|
|
@@ -111,7 +111,7 @@ try {
|
|
|
111
111
|
});
|
|
112
112
|
console.log('spotBuy ', JSON.stringify(spotBuyResult, null, 2));
|
|
113
113
|
|
|
114
|
-
const spotSellResult = await client.
|
|
114
|
+
const spotSellResult = await client.submitHFOrder({
|
|
115
115
|
clientOid: client.generateNewOrderID(),
|
|
116
116
|
side: 'sell',
|
|
117
117
|
type: 'market',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
2
|
import { BaseRestClient } from './lib/BaseRestClient.js';
|
|
3
3
|
import { RestClientOptions, RestClientType } from './lib/requestUtils.js';
|
|
4
|
-
import { AccountFillsRequest, BatchCancelOrdersRequest,
|
|
5
|
-
import { AccountBalance, AccountSummary, AddMargin, BatchCancelOrderResult,
|
|
4
|
+
import { AccountFillsRequest, BatchCancelOrdersRequest, GetFundingHistoryRequest, GetFundingRatesRequest, GetInterestRatesRequest, GetKlinesRequest, GetOrdersRequest, GetStopOrdersRequest, GetTransactionsRequest, MaxOpenSizeRequest, Order, SLTPOrder } from './types/request/futures.types.js';
|
|
5
|
+
import { AccountBalance, AccountSummary, AddMargin, BatchCancelOrderResult, FullOrderBookDetail, FuturesAccountFundingRateHistory, FuturesAccountTransaction, FuturesActiveOrder, FuturesClosedPositions, FuturesCurrentFundingRate, FuturesFill, FuturesFills, FuturesHistoricFundingRate, FuturesKline, FuturesMarkPrice, FuturesOrder, FuturesOrders, FuturesPosition, FuturesRiskLimit, FuturesSymbolInfo, IndexListItem, InterestRateItem, MarketTradeDetail, MaxOpenSize, PremiumIndexItem, SubBalance, SubmitMultipleOrdersFuturesResponse, TickerDetail } from './types/response/futures.types.js';
|
|
6
6
|
import { APISuccessResponse, ServiceStatus } from './types/response/shared.types.js';
|
|
7
7
|
import { WsConnectionInfo } from './types/response/ws.js';
|
|
8
8
|
/**
|
|
@@ -17,32 +17,35 @@ export declare class FuturesClient extends BaseRestClient {
|
|
|
17
17
|
*
|
|
18
18
|
*/
|
|
19
19
|
generateNewOrderID(): string;
|
|
20
|
-
getServerTime(): Promise<APISuccessResponse<number>>;
|
|
21
|
-
getServiceStatus(): Promise<APISuccessResponse<ServiceStatus>>;
|
|
22
20
|
/**
|
|
23
|
-
*
|
|
21
|
+
*
|
|
22
|
+
* REST - ACCOUNT INFO - Account & Funding
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Get Account - Futures
|
|
27
|
+
* Request via this endpoint to get the info of the futures account.
|
|
28
|
+
*/
|
|
29
|
+
getBalance(params?: {
|
|
30
|
+
currency?: string;
|
|
31
|
+
}): Promise<APISuccessResponse<AccountBalance>>;
|
|
32
|
+
/**
|
|
24
33
|
* Get Account Ledgers - Futures
|
|
34
|
+
* This interface can query the ledger records of the futures business line
|
|
25
35
|
*/
|
|
26
36
|
getTransactions(params: GetTransactionsRequest): Promise<APISuccessResponse<{
|
|
27
37
|
hasMore: boolean;
|
|
28
38
|
dataList: FuturesAccountTransaction[];
|
|
29
39
|
}>>;
|
|
30
40
|
/**
|
|
31
|
-
*
|
|
41
|
+
*
|
|
42
|
+
* REST - ACCOUNT INFO - Sub Account
|
|
43
|
+
*
|
|
32
44
|
*/
|
|
33
|
-
getSubAPIs(params: GetSubAPIsRequest): Promise<APISuccessResponse<SubAccountAPI[]>>;
|
|
34
|
-
createSubAPI(params: CreateSubAPIRequest): Promise<APISuccessResponse<CreateSubAccountAPI>>;
|
|
35
|
-
updateSubAPI(params: UpdateSubAPIRequest): Promise<APISuccessResponse<UpdateSubAccountAPI>>;
|
|
36
|
-
deleteSubAPI(params: DeleteSubAPIRequest): Promise<APISuccessResponse<{
|
|
37
|
-
subName: string;
|
|
38
|
-
apiKey: string;
|
|
39
|
-
}>>;
|
|
40
45
|
/**
|
|
41
|
-
*
|
|
46
|
+
* Get SubAccount List - Futures Balance(V2)
|
|
47
|
+
* This endpoint can be used to get Futures sub-account information.
|
|
42
48
|
*/
|
|
43
|
-
getBalance(params?: {
|
|
44
|
-
currency?: string;
|
|
45
|
-
}): Promise<APISuccessResponse<AccountBalance>>;
|
|
46
49
|
getSubBalances(params?: {
|
|
47
50
|
currency?: string;
|
|
48
51
|
}): Promise<APISuccessResponse<{
|
|
@@ -50,24 +53,13 @@ export declare class FuturesClient extends BaseRestClient {
|
|
|
50
53
|
accounts: SubBalance[];
|
|
51
54
|
}>>;
|
|
52
55
|
/**
|
|
53
|
-
*
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
* @deprecated This method is deprecated.
|
|
57
|
-
* It is recommended to use the GET /api/v3/accounts/universal-transfer endpoint instead of this endpoint
|
|
58
|
-
*/
|
|
59
|
-
submitTransferOut(params: SubmitTransfer): Promise<Promise<APISuccessResponse<TransferDetail>>>;
|
|
60
|
-
/**
|
|
61
|
-
* @deprecated This method is deprecated.
|
|
62
|
-
* It is recommended to use the GET /api/v3/accounts/universal-transfer endpoint instead of this endpoint
|
|
63
|
-
*/
|
|
64
|
-
submitTransferIn(params: SubmitTransfer): Promise<any>;
|
|
65
|
-
/**
|
|
66
|
-
* @deprecated This method is deprecated.
|
|
56
|
+
*
|
|
57
|
+
* REST - Account Info - Trade Fee
|
|
58
|
+
*
|
|
67
59
|
*/
|
|
68
|
-
getTransfers(params: GetTransfersRequest): Promise<APISuccessResponse<FuturesTransferRecords>>;
|
|
69
60
|
/**
|
|
70
|
-
*
|
|
61
|
+
* Get Actual Fee - Futures
|
|
62
|
+
* This interface is for the actual futures fee rate of the trading pair. The fee rate of your sub-account is the same as that of the master account.
|
|
71
63
|
*/
|
|
72
64
|
getTradingPairFee(params: {
|
|
73
65
|
symbol: string;
|
|
@@ -78,143 +70,293 @@ export declare class FuturesClient extends BaseRestClient {
|
|
|
78
70
|
}>>;
|
|
79
71
|
/**
|
|
80
72
|
*
|
|
81
|
-
* REST -
|
|
73
|
+
* REST - Futures Trading - Market Data
|
|
82
74
|
*
|
|
83
75
|
*/
|
|
84
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Get Symbol
|
|
78
|
+
* Get information of specified contracts that can be traded.
|
|
79
|
+
* This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.
|
|
80
|
+
*/
|
|
85
81
|
getSymbol(params: {
|
|
86
82
|
symbol: string;
|
|
87
83
|
}): Promise<APISuccessResponse<FuturesSymbolInfo>>;
|
|
84
|
+
/**
|
|
85
|
+
* Get Symbol
|
|
86
|
+
* Get information of specified contracts that can be traded.
|
|
87
|
+
* This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.
|
|
88
|
+
*/
|
|
89
|
+
getSymbols(): Promise<APISuccessResponse<FuturesSymbolInfo[]>>;
|
|
90
|
+
/**
|
|
91
|
+
* Get Ticker
|
|
92
|
+
* This endpoint returns "last traded price/size"、"best bid/ask price/size" etc. of a single symbol.
|
|
93
|
+
*/
|
|
88
94
|
getTicker(params: {
|
|
89
95
|
symbol: string;
|
|
90
96
|
}): Promise<APISuccessResponse<TickerDetail>>;
|
|
97
|
+
/**
|
|
98
|
+
* Get All Tickers
|
|
99
|
+
* This endpoint returns "last traded price/size"、"best bid/ask price/size" etc. of all symbol.
|
|
100
|
+
*/
|
|
91
101
|
getTickers(): Promise<APISuccessResponse<TickerDetail[]>>;
|
|
102
|
+
/**
|
|
103
|
+
* Get Full OrderBook
|
|
104
|
+
* Query for Full orderbook depth data. (aggregated by price)
|
|
105
|
+
*/
|
|
92
106
|
getFullOrderBookLevel2(params: {
|
|
93
107
|
symbol: string;
|
|
94
108
|
}): Promise<APISuccessResponse<FullOrderBookDetail>>;
|
|
109
|
+
/**
|
|
110
|
+
* Get Part OrderBook
|
|
111
|
+
* Query for part orderbook depth data. (aggregated by price)
|
|
112
|
+
*/
|
|
95
113
|
getPartOrderBookLevel2Depth20(params: {
|
|
96
114
|
symbol: string;
|
|
97
115
|
}): Promise<APISuccessResponse<FullOrderBookDetail>>;
|
|
116
|
+
/**
|
|
117
|
+
* Get Part OrderBook
|
|
118
|
+
* Query for part orderbook depth data. (aggregated by price)
|
|
119
|
+
*/
|
|
98
120
|
getPartOrderBookLevel2Depth100(params: {
|
|
99
121
|
symbol: string;
|
|
100
122
|
}): Promise<APISuccessResponse<FullOrderBookDetail>>;
|
|
123
|
+
/**
|
|
124
|
+
* Get Trade History
|
|
125
|
+
* Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.
|
|
126
|
+
*/
|
|
101
127
|
getMarketTrades(params: {
|
|
102
128
|
symbol: string;
|
|
103
129
|
}): Promise<APISuccessResponse<MarketTradeDetail>>;
|
|
130
|
+
/**
|
|
131
|
+
* Get Klines
|
|
132
|
+
* Get the Kline of the symbol. Data are returned in grouped buckets based on requested type.
|
|
133
|
+
*/
|
|
104
134
|
getKlines(params: GetKlinesRequest): Promise<APISuccessResponse<FuturesKline[]>>;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
135
|
+
/**
|
|
136
|
+
* Get Mark Price
|
|
137
|
+
* Get the mark price of the symbol.
|
|
138
|
+
*/
|
|
139
|
+
getMarkPrice(params: {
|
|
140
|
+
symbol: string;
|
|
141
|
+
}): Promise<APISuccessResponse<FuturesMarkPrice>>;
|
|
142
|
+
/**
|
|
143
|
+
* Get Spot Index Price
|
|
144
|
+
* This endpoint returns the index price of the specified symbol.
|
|
145
|
+
*/
|
|
109
146
|
getIndex(params: GetInterestRatesRequest): Promise<APISuccessResponse<{
|
|
110
147
|
dataList: IndexListItem[];
|
|
111
148
|
hasMore: boolean;
|
|
112
149
|
}>>;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
150
|
+
/**
|
|
151
|
+
* Get Interest Rate Index
|
|
152
|
+
* This endpoint returns the interest rate index of the specified symbol.
|
|
153
|
+
*/
|
|
154
|
+
getInterestRates(params: GetInterestRatesRequest): Promise<APISuccessResponse<{
|
|
155
|
+
dataList: InterestRateItem[];
|
|
156
|
+
hasMore: boolean;
|
|
157
|
+
}>>;
|
|
158
|
+
/**
|
|
159
|
+
* Get Premium Index
|
|
160
|
+
* This endpoint returns the premium index of the specified symbol.
|
|
161
|
+
*/
|
|
116
162
|
getPremiumIndex(params: GetInterestRatesRequest): Promise<APISuccessResponse<{
|
|
117
163
|
dataList: PremiumIndexItem[];
|
|
118
164
|
hasMore: boolean;
|
|
119
165
|
}>>;
|
|
166
|
+
/**
|
|
167
|
+
* Get 24hr Stats
|
|
168
|
+
* Get the statistics of the platform futures trading volume in the last 24 hours.
|
|
169
|
+
*/
|
|
120
170
|
get24HourTransactionVolume(): Promise<APISuccessResponse<{
|
|
121
171
|
turnoverOf24h: number;
|
|
122
172
|
}>>;
|
|
173
|
+
/**
|
|
174
|
+
* Get Server Time
|
|
175
|
+
* Get the API server time. This is the Unix timestamp.
|
|
176
|
+
*/
|
|
177
|
+
getServerTime(): Promise<APISuccessResponse<number>>;
|
|
178
|
+
/**
|
|
179
|
+
* Get Service Status
|
|
180
|
+
* This endpoint returns the status of the API service.
|
|
181
|
+
*/
|
|
182
|
+
getServiceStatus(): Promise<APISuccessResponse<ServiceStatus>>;
|
|
123
183
|
/**
|
|
124
184
|
*
|
|
125
|
-
* REST -
|
|
185
|
+
* REST - Futures Trading - Orders
|
|
126
186
|
*
|
|
127
187
|
*/
|
|
188
|
+
/**
|
|
189
|
+
* Add Order
|
|
190
|
+
* Place order to the futures trading system
|
|
191
|
+
*/
|
|
128
192
|
submitOrder(params: Order): Promise<APISuccessResponse<{
|
|
129
193
|
orderId?: string;
|
|
130
194
|
clientOid?: string;
|
|
131
195
|
}>>;
|
|
132
|
-
|
|
196
|
+
/**
|
|
197
|
+
* Add Order Test
|
|
198
|
+
* Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations.
|
|
199
|
+
*/
|
|
200
|
+
submitNewOrderTest(params: Order): Promise<{
|
|
133
201
|
orderId?: string;
|
|
134
202
|
clientOid?: string;
|
|
135
203
|
}>;
|
|
204
|
+
/**
|
|
205
|
+
* Batch Add Orders
|
|
206
|
+
* Place multiple order to the futures trading system
|
|
207
|
+
*/
|
|
208
|
+
submitMultipleOrders(params: Order[]): Promise<APISuccessResponse<SubmitMultipleOrdersFuturesResponse[]>>;
|
|
209
|
+
/**
|
|
210
|
+
* Add Take Profit And Stop Loss Order
|
|
211
|
+
* Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface.
|
|
212
|
+
*/
|
|
213
|
+
submitSLTPOrder(params: SLTPOrder): Promise<APISuccessResponse<{
|
|
214
|
+
orderId?: string;
|
|
215
|
+
clientOid?: string;
|
|
216
|
+
}>>;
|
|
217
|
+
/**
|
|
218
|
+
* Cancel Order By OrderId
|
|
219
|
+
* Cancel an order (including a stop order).
|
|
220
|
+
*/
|
|
136
221
|
cancelOrderById(params: {
|
|
137
222
|
orderId: string;
|
|
138
223
|
}): Promise<APISuccessResponse<{
|
|
139
224
|
cancelledOrderIds: string[];
|
|
140
225
|
}>>;
|
|
226
|
+
/**
|
|
227
|
+
* Cancel Order By Client Order Id
|
|
228
|
+
* Cancel an order (including a stop order) by client order id.
|
|
229
|
+
*/
|
|
141
230
|
cancelOrderByClientOid(params: {
|
|
142
231
|
clientOid: string;
|
|
143
232
|
}): Promise<APISuccessResponse<{
|
|
144
233
|
clientOid: string;
|
|
145
234
|
}>>;
|
|
235
|
+
/**
|
|
236
|
+
* Batch Cancel Orders
|
|
237
|
+
* Cancel multiple orders.
|
|
238
|
+
*/
|
|
146
239
|
batchCancelOrders(params: BatchCancelOrdersRequest): Promise<APISuccessResponse<{
|
|
147
240
|
data: BatchCancelOrderResult[];
|
|
148
241
|
}>>;
|
|
149
|
-
submitSLTPOrder(params: SLTPOrder): Promise<APISuccessResponse<{
|
|
150
|
-
orderId?: string;
|
|
151
|
-
clientOid?: string;
|
|
152
|
-
}>>;
|
|
153
|
-
submitMultipleOrders(params: Order[]): Promise<APISuccessResponse<SubmitMultipleOrdersFuturesResponse[]>>;
|
|
154
242
|
/**
|
|
155
|
-
*
|
|
243
|
+
* Cancel All Orders
|
|
244
|
+
* Using this endpoint, all open orders (excluding stop orders) can be canceled in batches.
|
|
156
245
|
*/
|
|
157
|
-
cancelAllOrders(params?: {
|
|
158
|
-
symbol?: string;
|
|
159
|
-
}): Promise<APISuccessResponse<{
|
|
160
|
-
cancelledOrderIds: string[];
|
|
161
|
-
}>>;
|
|
162
246
|
cancelAllOrdersV3(params: {
|
|
163
247
|
symbol: string;
|
|
164
248
|
}): Promise<APISuccessResponse<{
|
|
165
249
|
cancelledOrderIds: string[];
|
|
166
250
|
}>>;
|
|
251
|
+
/**
|
|
252
|
+
* Cancel All Stop orders
|
|
253
|
+
* Using this endpoint, all untriggered stop orders can be canceled in batches.
|
|
254
|
+
*/
|
|
167
255
|
cancelAllStopOrders(params?: {
|
|
168
256
|
symbol?: string;
|
|
169
257
|
}): Promise<APISuccessResponse<{
|
|
170
258
|
cancelledOrderIds: string[];
|
|
171
259
|
}>>;
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}): Promise<APISuccessResponse<FuturesOrder[]>>;
|
|
260
|
+
/**
|
|
261
|
+
* Get Order By OrderId
|
|
262
|
+
* Get order details by order id.
|
|
263
|
+
*/
|
|
177
264
|
getOrderByOrderId(params: {
|
|
178
265
|
orderId: string;
|
|
179
266
|
}): Promise<APISuccessResponse<FuturesOrder>>;
|
|
267
|
+
/**
|
|
268
|
+
* Get Order By Client Order Id
|
|
269
|
+
* Get order details by client order id.
|
|
270
|
+
*/
|
|
180
271
|
getOrderByClientOrderId(params: {
|
|
181
272
|
clientOid: string;
|
|
182
273
|
}): Promise<APISuccessResponse<FuturesOrder>>;
|
|
183
274
|
/**
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
275
|
+
* Get Order List
|
|
276
|
+
* List your current orders. Any limit order on the exchange order book is in active status.
|
|
187
277
|
*/
|
|
278
|
+
getOrders(params?: GetOrdersRequest): Promise<APISuccessResponse<FuturesOrders>>;
|
|
188
279
|
/**
|
|
189
|
-
* Get
|
|
190
|
-
*
|
|
191
|
-
* If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h.
|
|
192
|
-
* The requested data is not real-time.
|
|
280
|
+
* Get Recent Closed Orders
|
|
281
|
+
* Get a list of recent 1000 closed orders in the last 24 hours.
|
|
193
282
|
*/
|
|
194
|
-
|
|
283
|
+
getRecentOrders(params?: {
|
|
284
|
+
symbol?: string;
|
|
285
|
+
}): Promise<APISuccessResponse<FuturesOrder[]>>;
|
|
195
286
|
/**
|
|
287
|
+
* Get Stop Order List
|
|
288
|
+
* Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface
|
|
289
|
+
*/
|
|
290
|
+
getStopOrders(params?: GetStopOrdersRequest): Promise<APISuccessResponse<FuturesOrders>>;
|
|
291
|
+
/**
|
|
292
|
+
* Get Open Order Value
|
|
293
|
+
* You can query this endpoint to get the the total number and value of the all your active orders.
|
|
294
|
+
*/
|
|
295
|
+
getOpenOrderStatistics(params: {
|
|
296
|
+
symbol: string;
|
|
297
|
+
}): Promise<APISuccessResponse<FuturesActiveOrder>>;
|
|
298
|
+
/**
|
|
299
|
+
* Get Recent Trade History
|
|
196
300
|
* Get a list of recent 1000 fills in the last 24 hours.
|
|
197
|
-
*
|
|
198
|
-
* If you need to get your recent traded order history with low latency, you may query this endpoint.
|
|
199
301
|
*/
|
|
200
302
|
getRecentFills(params?: {
|
|
201
303
|
symbol?: string;
|
|
202
304
|
}): Promise<APISuccessResponse<FuturesFill[]>>;
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
305
|
+
/**
|
|
306
|
+
* Get Trade History
|
|
307
|
+
* Get a list of recent fills.
|
|
308
|
+
* If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time.
|
|
309
|
+
*/
|
|
310
|
+
getFills(params?: AccountFillsRequest): Promise<APISuccessResponse<FuturesFills>>;
|
|
206
311
|
/**
|
|
207
312
|
*
|
|
208
|
-
* REST -
|
|
313
|
+
* REST - Futures Trading - Positions
|
|
209
314
|
*
|
|
210
315
|
*/
|
|
316
|
+
/**
|
|
317
|
+
* Get Margin Mode
|
|
318
|
+
* This interface can query the margin mode of the current symbol.
|
|
319
|
+
*/
|
|
320
|
+
getMarginMode(params: {
|
|
321
|
+
symbol: string;
|
|
322
|
+
}): Promise<APISuccessResponse<{
|
|
323
|
+
symbol: string;
|
|
324
|
+
marginMode: 'ISOLATED' | 'CROSS';
|
|
325
|
+
}>>;
|
|
326
|
+
/**
|
|
327
|
+
* Switch Margin Mode
|
|
328
|
+
* Modify the margin mode of the current symbol.
|
|
329
|
+
*/
|
|
330
|
+
updateMarginMode(params: {
|
|
331
|
+
symbol: string;
|
|
332
|
+
marginMode: 'ISOLATED' | 'CROSS';
|
|
333
|
+
}): Promise<APISuccessResponse<{
|
|
334
|
+
symbol: string;
|
|
335
|
+
marginMode: 'ISOLATED' | 'CROSS';
|
|
336
|
+
}>>;
|
|
337
|
+
/**
|
|
338
|
+
* Get Max Open Size
|
|
339
|
+
* Get Maximum Open Position Size.
|
|
340
|
+
*/
|
|
211
341
|
getMaxOpenSize(params: MaxOpenSizeRequest): Promise<APISuccessResponse<MaxOpenSize>>;
|
|
342
|
+
/**
|
|
343
|
+
* Get Position Details
|
|
344
|
+
* Get the position details of a specified position.
|
|
345
|
+
*/
|
|
212
346
|
getPosition(params: {
|
|
213
347
|
symbol: string;
|
|
214
348
|
}): Promise<APISuccessResponse<FuturesPosition>>;
|
|
349
|
+
/**
|
|
350
|
+
* Get Position List
|
|
351
|
+
* Get the position details of a specified position.
|
|
352
|
+
*/
|
|
215
353
|
getPositions(params?: {
|
|
216
354
|
currency?: string;
|
|
217
355
|
}): Promise<APISuccessResponse<FuturesPosition[]>>;
|
|
356
|
+
/**
|
|
357
|
+
* Get Positions History
|
|
358
|
+
* This interface can query position history information records.
|
|
359
|
+
*/
|
|
218
360
|
getHistoryPositions(params?: {
|
|
219
361
|
symbol?: string;
|
|
220
362
|
from?: number;
|
|
@@ -223,49 +365,26 @@ export declare class FuturesClient extends BaseRestClient {
|
|
|
223
365
|
pageId?: number;
|
|
224
366
|
}): Promise<APISuccessResponse<FuturesClosedPositions>>;
|
|
225
367
|
/**
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
* It is recommended to switch to the cross margin mode.
|
|
229
|
-
* Please refer to POST /api/v2/position/changeMarginMode endpoint
|
|
368
|
+
* Get Max Withdraw Margin
|
|
369
|
+
* This interface can query the maximum amount of margin that the current position supports withdrawal.
|
|
230
370
|
*/
|
|
231
|
-
updateAutoDepositStatus(params: {
|
|
232
|
-
symbol: string;
|
|
233
|
-
status: boolean;
|
|
234
|
-
}): Promise<APISuccessResponse<boolean>>;
|
|
235
371
|
getMaxWithdrawMargin(params: {
|
|
236
372
|
symbol: string;
|
|
237
373
|
}): Promise<APISuccessResponse<number>>;
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
sybmol: string;
|
|
243
|
-
withdrawAmount: number;
|
|
244
|
-
}>>;
|
|
245
|
-
depositMargin(params: {
|
|
246
|
-
symbol: string;
|
|
247
|
-
margin: number;
|
|
248
|
-
bizNo: string;
|
|
249
|
-
}): Promise<APISuccessResponse<AddMargin>>;
|
|
250
|
-
getMarginMode(params: {
|
|
251
|
-
symbol: string;
|
|
252
|
-
}): Promise<APISuccessResponse<{
|
|
253
|
-
symbol: string;
|
|
254
|
-
marginMode: 'ISOLATED' | 'CROSS';
|
|
255
|
-
}>>;
|
|
256
|
-
updateMarginMode(params: {
|
|
257
|
-
symbol: string;
|
|
258
|
-
marginMode: 'ISOLATED' | 'CROSS';
|
|
259
|
-
}): Promise<APISuccessResponse<{
|
|
260
|
-
symbol: string;
|
|
261
|
-
marginMode: 'ISOLATED' | 'CROSS';
|
|
262
|
-
}>>;
|
|
374
|
+
/**
|
|
375
|
+
* Get Cross Margin Leverage
|
|
376
|
+
* This interface can query the current symbol’s cross-margin leverage multiple.
|
|
377
|
+
*/
|
|
263
378
|
getCrossMarginLeverage(params: {
|
|
264
379
|
symbol: string;
|
|
265
380
|
}): Promise<APISuccessResponse<{
|
|
266
381
|
symbol: string;
|
|
267
382
|
leverage: string;
|
|
268
383
|
}>>;
|
|
384
|
+
/**
|
|
385
|
+
* Modify Cross Margin Leverage
|
|
386
|
+
* This interface can modify the current symbol’s cross-margin leverage multiple.
|
|
387
|
+
*/
|
|
269
388
|
changeCrossMarginLeverage(params: {
|
|
270
389
|
symbol: string;
|
|
271
390
|
leverage: string;
|
|
@@ -274,26 +393,61 @@ export declare class FuturesClient extends BaseRestClient {
|
|
|
274
393
|
leverage: string;
|
|
275
394
|
}>>;
|
|
276
395
|
/**
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
|
|
396
|
+
* Add Isolated Margin
|
|
397
|
+
* Add Isolated Margin Manually.
|
|
398
|
+
*/
|
|
399
|
+
depositMargin(params: {
|
|
400
|
+
symbol: string;
|
|
401
|
+
margin: number;
|
|
402
|
+
bizNo: string;
|
|
403
|
+
}): Promise<APISuccessResponse<AddMargin>>;
|
|
404
|
+
/**
|
|
405
|
+
* Remove Isolated Margin
|
|
406
|
+
* Remove Isolated Margin Manually.
|
|
407
|
+
*/
|
|
408
|
+
withdrawMargin(params: {
|
|
409
|
+
symbol: string;
|
|
410
|
+
withdrawAmount: string;
|
|
411
|
+
}): Promise<APISuccessResponse<{
|
|
412
|
+
sybmol: string;
|
|
413
|
+
withdrawAmount: number;
|
|
414
|
+
}>>;
|
|
415
|
+
/**
|
|
416
|
+
* Get Isolated Margin Risk Limit
|
|
417
|
+
* This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).
|
|
280
418
|
*/
|
|
281
419
|
getRiskLimitLevel(params: {
|
|
282
420
|
symbol: string;
|
|
283
421
|
}): Promise<APISuccessResponse<FuturesRiskLimit[]>>;
|
|
422
|
+
/**
|
|
423
|
+
* Modify Isolated Margin Risk Limit
|
|
424
|
+
* This interface is for the adjustment of the risk limit level(Only valid for isolated Margin).
|
|
425
|
+
*/
|
|
284
426
|
updateRiskLimitLevel(params: {
|
|
285
427
|
symbol: string;
|
|
286
428
|
level: number;
|
|
287
429
|
}): Promise<any>;
|
|
288
430
|
/**
|
|
289
431
|
*
|
|
290
|
-
* REST -
|
|
432
|
+
* REST - Futures Trading - Funding Fees
|
|
291
433
|
*
|
|
292
434
|
*/
|
|
435
|
+
/**
|
|
436
|
+
* Get Current Funding Rate
|
|
437
|
+
* This interface can be used to obtain the current funding rate of the specified symbol.
|
|
438
|
+
*/
|
|
293
439
|
getFundingRate(params: {
|
|
294
440
|
symbol: string;
|
|
295
441
|
}): Promise<APISuccessResponse<FuturesCurrentFundingRate>>;
|
|
442
|
+
/**
|
|
443
|
+
* Get Public Funding History
|
|
444
|
+
* Query the funding rate at each settlement time point within a certain time range of the corresponding contract
|
|
445
|
+
*/
|
|
296
446
|
getFundingRates(params: GetFundingRatesRequest): Promise<APISuccessResponse<FuturesHistoricFundingRate[]>>;
|
|
447
|
+
/**
|
|
448
|
+
* Get Private Funding History
|
|
449
|
+
* Submit request to get the funding history.
|
|
450
|
+
*/
|
|
297
451
|
getFundingHistory(params: GetFundingHistoryRequest): Promise<APISuccessResponse<{
|
|
298
452
|
dataList: FuturesAccountFundingRateHistory[];
|
|
299
453
|
hasMore: boolean;
|
|
@@ -315,4 +469,39 @@ export declare class FuturesClient extends BaseRestClient {
|
|
|
315
469
|
*/
|
|
316
470
|
getPublicWSConnectionToken(): Promise<APISuccessResponse<WsConnectionInfo>>;
|
|
317
471
|
getPrivateWSConnectionToken(): Promise<APISuccessResponse<WsConnectionInfo>>;
|
|
472
|
+
/**
|
|
473
|
+
* @deprecated - please use universal transfer from SpotClient
|
|
474
|
+
*/
|
|
475
|
+
submitTransferOut(params: {
|
|
476
|
+
currency: string;
|
|
477
|
+
amount: number;
|
|
478
|
+
recAccountType: 'MAIN' | 'TRADE';
|
|
479
|
+
}): Promise<APISuccessResponse<any>>;
|
|
480
|
+
/**
|
|
481
|
+
* @deprecated - please use universal transfer from SpotClient
|
|
482
|
+
*/
|
|
483
|
+
submitTransferIn(params: {
|
|
484
|
+
currency: string;
|
|
485
|
+
amount: number;
|
|
486
|
+
payAccountType: 'MAIN' | 'TRADE';
|
|
487
|
+
}): Promise<APISuccessResponse<any>>;
|
|
488
|
+
/**
|
|
489
|
+
* @deprecated - please use universal transfer from SpotClient
|
|
490
|
+
*/
|
|
491
|
+
getTransfers(params?: {
|
|
492
|
+
currency?: string;
|
|
493
|
+
type?: 'MAIN' | 'TRADE' | 'MARGIN' | 'ISOLATED';
|
|
494
|
+
tag?: string[];
|
|
495
|
+
startAt?: number;
|
|
496
|
+
endAt?: number;
|
|
497
|
+
currentPage?: number;
|
|
498
|
+
pageSize?: number;
|
|
499
|
+
}): Promise<APISuccessResponse<any>>;
|
|
500
|
+
/**
|
|
501
|
+
* @deprecated - please use updateMarginMode() instead
|
|
502
|
+
*/
|
|
503
|
+
updateAutoDepositStatus(params: {
|
|
504
|
+
symbol: string;
|
|
505
|
+
status: boolean;
|
|
506
|
+
}): Promise<APISuccessResponse<any>>;
|
|
318
507
|
}
|