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/dist/mjs/SpotClient.js
CHANGED
|
@@ -73,70 +73,134 @@ export class SpotClient extends BaseRestClient {
|
|
|
73
73
|
getServiceStatus() {
|
|
74
74
|
return this.get('api/v1/status');
|
|
75
75
|
}
|
|
76
|
-
getAnnouncements(params) {
|
|
77
|
-
return this.get('api/v3/announcements', params);
|
|
78
|
-
}
|
|
79
76
|
/**
|
|
80
77
|
*
|
|
81
|
-
* REST -
|
|
78
|
+
* REST - Account Info - Account & Funding
|
|
79
|
+
*
|
|
80
|
+
*/
|
|
81
|
+
/**
|
|
82
|
+
* Get Account Summary Info
|
|
82
83
|
*
|
|
84
|
+
* This endpoint can be used to obtain account summary information.
|
|
83
85
|
*/
|
|
84
86
|
getAccountSummary() {
|
|
85
87
|
return this.getPrivate('api/v2/user-info');
|
|
86
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Get API Key Information
|
|
91
|
+
*
|
|
92
|
+
* Get information about the API key being used. Works for both master and sub user API keys.
|
|
93
|
+
*/
|
|
94
|
+
getApikeyInfo() {
|
|
95
|
+
return this.getPrivate('api/v1/user/api-key');
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Get Account Type - Spot
|
|
99
|
+
*
|
|
100
|
+
* This interface determines whether the current user is a spot high-frequency user or a spot low-frequency user.
|
|
101
|
+
*/
|
|
102
|
+
getUserType() {
|
|
103
|
+
return this.getPrivate('api/v1/hf/accounts/opened');
|
|
104
|
+
}
|
|
87
105
|
/**
|
|
88
106
|
* Get a list of acounts and their balance states (spot/margin/trade_hf)
|
|
89
107
|
*
|
|
90
|
-
* Get Account List - Spot
|
|
108
|
+
* Get Account List - Spot
|
|
91
109
|
*/
|
|
92
110
|
getBalances(params) {
|
|
93
111
|
return this.getPrivate('api/v1/accounts', params);
|
|
94
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* Get Account Detail - Spot
|
|
115
|
+
*
|
|
116
|
+
* Get Information for a single spot account. Use this endpoint when you know the accountId.
|
|
117
|
+
*/
|
|
95
118
|
getAccountDetail(params) {
|
|
96
119
|
return this.getPrivate(`api/v1/accounts/${params.accountId}`);
|
|
97
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Get Account - Cross Margin
|
|
123
|
+
*
|
|
124
|
+
* Request via this endpoint to get the info of the cross margin account.
|
|
125
|
+
*/
|
|
126
|
+
getMarginBalance(params) {
|
|
127
|
+
return this.getPrivate('api/v3/margin/accounts', params);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Get Account - Isolated Margin
|
|
131
|
+
*
|
|
132
|
+
* Request via this endpoint to get the info of the isolated margin account.
|
|
133
|
+
*/
|
|
134
|
+
getIsolatedMarginBalance(params) {
|
|
135
|
+
return this.getPrivate('api/v3/isolated/accounts', params);
|
|
136
|
+
}
|
|
98
137
|
/**
|
|
99
138
|
* Get Account Ledgers - Spot/Margin
|
|
139
|
+
*
|
|
140
|
+
* This interface is for transaction records from all types of your accounts, supporting inquiry of various currencies.
|
|
141
|
+
* Items are paginated and sorted to show the latest first.
|
|
142
|
+
* See the Pagination section for retrieving additional entries after the first page.
|
|
100
143
|
*/
|
|
101
144
|
getTransactions(params) {
|
|
102
145
|
return this.getPrivate('api/v1/accounts/ledgers', params);
|
|
103
146
|
}
|
|
104
147
|
/**
|
|
105
148
|
* Get Account Ledgers - trade_hf
|
|
149
|
+
*
|
|
150
|
+
* This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries.
|
|
151
|
+
* The query results are sorted in descending order by createdAt and id.
|
|
106
152
|
*/
|
|
107
153
|
getHFTransactions(params) {
|
|
108
154
|
return this.getPrivate('api/v1/hf/accounts/ledgers', params);
|
|
109
155
|
}
|
|
110
156
|
/**
|
|
111
157
|
* Get Account Ledgers - margin_hf
|
|
158
|
+
*
|
|
159
|
+
* This API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries.
|
|
160
|
+
* The query results are sorted in descending order by createdAt and id.
|
|
112
161
|
*/
|
|
113
162
|
getHFMarginTransactions(params) {
|
|
114
163
|
return this.getPrivate('api/v3/hf/margin/account/ledgers', params);
|
|
115
164
|
}
|
|
116
165
|
/**
|
|
117
166
|
*
|
|
118
|
-
* REST -
|
|
167
|
+
* REST - Account Info - Sub Account
|
|
119
168
|
*
|
|
120
169
|
*/
|
|
121
170
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
171
|
+
* Add SubAccount
|
|
172
|
+
*
|
|
173
|
+
* This endpoint is used to create a sub-account.
|
|
124
174
|
*/
|
|
125
|
-
getSubAccountsV1() {
|
|
126
|
-
return this.getPrivate('api/v1/sub/user');
|
|
127
|
-
}
|
|
128
|
-
getSubAccountsV2(params) {
|
|
129
|
-
return this.getPrivate('api/v2/sub/user', params);
|
|
130
|
-
}
|
|
131
175
|
createSubAccount(params) {
|
|
132
176
|
return this.postPrivate('api/v2/sub/user/created', params);
|
|
133
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* Add SubAccount Margin Permission
|
|
180
|
+
*
|
|
181
|
+
* This endpoint can be used to add sub-accounts Margin permission.
|
|
182
|
+
* Before using this endpoints, you need to ensure that the master account apikey has Margin permissions and the Margin function has been activated.
|
|
183
|
+
*/
|
|
134
184
|
enableSubAccountMargin(params) {
|
|
135
185
|
return this.postPrivate('api/v3/sub/user/margin/enable', params);
|
|
136
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Add SubAccount Futures Permission
|
|
189
|
+
*
|
|
190
|
+
* This endpoint can be used to add sub-accounts Futures permission.
|
|
191
|
+
* Before using this endpoints, you need to ensure that the master account apikey has Futures permissions and the Futures function has been activated.
|
|
192
|
+
*/
|
|
137
193
|
enableSubAccountFutures(params) {
|
|
138
194
|
return this.postPrivate('api/v3/sub/user/futures/enable', params);
|
|
139
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* Get SubAccount List - Summary Info
|
|
198
|
+
*
|
|
199
|
+
* This endpoint can be used to get a paginated list of sub-accounts. Pagination is required.
|
|
200
|
+
*/
|
|
201
|
+
getSubAccountsV2(params) {
|
|
202
|
+
return this.getPrivate('api/v2/sub/user', params);
|
|
203
|
+
}
|
|
140
204
|
/**
|
|
141
205
|
* @deprecated This method is deprecated.
|
|
142
206
|
* It is recommended to use the GET /api/v2/sub/accounts/balance endpoint instead of this endpoint
|
|
@@ -144,640 +208,901 @@ export class SpotClient extends BaseRestClient {
|
|
|
144
208
|
getSubAccountBalance(params) {
|
|
145
209
|
return this.getPrivate(`api/v1/sub-accounts/${params.subUserId}`, params);
|
|
146
210
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
211
|
+
/**
|
|
212
|
+
* Get SubAccount List - Spot Balance(V2)
|
|
213
|
+
*
|
|
214
|
+
* This endpoint can be used to get paginated Spot sub-account information.
|
|
215
|
+
* Pagination is required.
|
|
216
|
+
*/
|
|
150
217
|
getSubAccountBalancesV2(params) {
|
|
151
218
|
return this.getPrivate('api/v2/sub-accounts', params);
|
|
152
219
|
}
|
|
153
220
|
/**
|
|
154
221
|
*
|
|
155
|
-
* REST -
|
|
222
|
+
* REST - Account Info - Sub Account API
|
|
156
223
|
*
|
|
224
|
+
*/
|
|
225
|
+
/**
|
|
226
|
+
* Add SubAccount API
|
|
157
227
|
*
|
|
228
|
+
* This endpoint can be used to create APIs for sub-accounts.
|
|
158
229
|
*/
|
|
159
|
-
getSubAPIs(params) {
|
|
160
|
-
return this.getPrivate('api/v1/sub/api-key', params);
|
|
161
|
-
}
|
|
162
230
|
createSubAPI(params) {
|
|
163
231
|
return this.postPrivate('api/v1/sub/api-key', params);
|
|
164
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* Modify SubAccount API
|
|
235
|
+
*
|
|
236
|
+
* This endpoint can be used to update APIs for sub-accounts.
|
|
237
|
+
*/
|
|
165
238
|
updateSubAPI(params) {
|
|
166
239
|
return this.postPrivate('api/v1/sub/api-key/update', params);
|
|
167
240
|
}
|
|
168
|
-
deleteSubAPI(params) {
|
|
169
|
-
return this.deletePrivate('api/v1/sub/api-key', params);
|
|
170
|
-
}
|
|
171
241
|
/**
|
|
242
|
+
* Get SubAccount API List
|
|
172
243
|
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
244
|
+
* This endpoint can be used to obtain a list of APIs pertaining to a sub-account.
|
|
245
|
+
* (Not contain ND Broker Sub Account)
|
|
175
246
|
*/
|
|
247
|
+
getSubAPIs(params) {
|
|
248
|
+
return this.getPrivate('api/v1/sub/api-key', params);
|
|
249
|
+
}
|
|
176
250
|
/**
|
|
177
|
-
*
|
|
178
|
-
*
|
|
251
|
+
* Delete SubAccount API
|
|
252
|
+
*
|
|
253
|
+
* This endpoint can be used to delete an API for a sub-account.
|
|
179
254
|
*/
|
|
180
|
-
|
|
181
|
-
return this.
|
|
182
|
-
}
|
|
183
|
-
getMarginBalance(params) {
|
|
184
|
-
return this.getPrivate('api/v3/margin/accounts', params);
|
|
185
|
-
}
|
|
186
|
-
getIsolatedMarginBalance(params) {
|
|
187
|
-
return this.getPrivate('api/v3/isolated/accounts', params);
|
|
255
|
+
deleteSubAPI(params) {
|
|
256
|
+
return this.deletePrivate('api/v1/sub/api-key', params);
|
|
188
257
|
}
|
|
189
258
|
/**
|
|
190
259
|
*
|
|
191
|
-
* REST -
|
|
260
|
+
* REST - Account Info - Deposit
|
|
192
261
|
*
|
|
193
262
|
*/
|
|
194
263
|
/**
|
|
195
|
-
*
|
|
264
|
+
* Add Deposit Address(V3)
|
|
265
|
+
*
|
|
266
|
+
* Request via this endpoint to create a deposit address for a currency you intend to deposit.
|
|
196
267
|
*/
|
|
197
|
-
createDepositAddress(params) {
|
|
198
|
-
return this.postPrivate('api/v1/deposit-addresses', params);
|
|
199
|
-
}
|
|
200
268
|
createDepositAddressV3(params) {
|
|
201
269
|
return this.postPrivate('api/v3/deposit-address/create', params);
|
|
202
270
|
}
|
|
203
271
|
/**
|
|
204
|
-
*
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* @deprecated This method is deprecated. Please use getDepositAddressesV3 instead.
|
|
272
|
+
* Get Deposit Address(V3)
|
|
273
|
+
*
|
|
274
|
+
* Get all deposit addresses for the currency you intend to deposit.
|
|
275
|
+
* If the returned data is empty, you may need to Add Deposit Address first.
|
|
211
276
|
*/
|
|
212
|
-
getDepositAddressV1(params) {
|
|
213
|
-
return this.getPrivate('api/v1/deposit-addresses', params);
|
|
214
|
-
}
|
|
215
277
|
getDepositAddressesV3(params) {
|
|
216
278
|
return this.getPrivate('api/v3/deposit-addresses', params);
|
|
217
279
|
}
|
|
218
|
-
getDeposits(params) {
|
|
219
|
-
return this.getPrivate('api/v1/deposits', params);
|
|
220
|
-
}
|
|
221
280
|
/**
|
|
222
|
-
*
|
|
223
|
-
*
|
|
281
|
+
* Get Deposit History
|
|
282
|
+
*
|
|
283
|
+
* Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first.
|
|
284
|
+
* See the Pagination section for retrieving additional entries after the first page.
|
|
224
285
|
*/
|
|
225
|
-
|
|
226
|
-
return this.getPrivate('api/v1/
|
|
286
|
+
getDeposits(params) {
|
|
287
|
+
return this.getPrivate('api/v1/deposits', params);
|
|
227
288
|
}
|
|
228
289
|
/**
|
|
229
290
|
*
|
|
230
|
-
* REST -
|
|
291
|
+
* REST - Account Info - Withdrawals
|
|
231
292
|
*
|
|
232
293
|
*/
|
|
233
|
-
getWithdrawals(params) {
|
|
234
|
-
return this.getPrivate('api/v1/withdrawals', params);
|
|
235
|
-
}
|
|
236
294
|
/**
|
|
237
|
-
*
|
|
238
|
-
*
|
|
295
|
+
* Get Withdrawal Quotas
|
|
296
|
+
*
|
|
297
|
+
* This interface can obtain the withdrawal quotas information of this currency.
|
|
239
298
|
*/
|
|
240
|
-
getHistoricalWithdrawalsV1(params) {
|
|
241
|
-
return this.getPrivate('api/v1/hist-withdrawals', params);
|
|
242
|
-
}
|
|
243
299
|
getWithdrawalQuotas(params) {
|
|
244
300
|
return this.getPrivate('api/v1/withdrawals/quotas', params);
|
|
245
301
|
}
|
|
246
302
|
/**
|
|
247
|
-
*
|
|
303
|
+
* Withdraw(V3)
|
|
304
|
+
*
|
|
305
|
+
* Use this interface to withdraw the specified currency
|
|
248
306
|
*/
|
|
249
|
-
submitWithdraw(params) {
|
|
250
|
-
return this.postPrivate('api/v1/withdrawals', params);
|
|
251
|
-
}
|
|
252
307
|
submitWithdrawV3(params) {
|
|
253
308
|
return this.postPrivate('api/v3/withdrawals', params);
|
|
254
309
|
}
|
|
310
|
+
/**
|
|
311
|
+
* Cancel Withdrawal
|
|
312
|
+
*
|
|
313
|
+
* This interface can cancel the withdrawal, Only withdrawals requests of PROCESSING status could be canceled.
|
|
314
|
+
*/
|
|
255
315
|
cancelWithdrawal(params) {
|
|
256
316
|
return this.deletePrivate(`api/v1/withdrawals/${params.withdrawalId}`);
|
|
257
317
|
}
|
|
258
318
|
/**
|
|
319
|
+
* Get Withdrawal History
|
|
259
320
|
*
|
|
260
|
-
*
|
|
321
|
+
* Request via this endpoint to get withdrawal list Items are paginated and sorted to show the latest first.
|
|
322
|
+
* See the Pagination section for retrieving additional entries after the first page.
|
|
323
|
+
*/
|
|
324
|
+
getWithdrawals(params) {
|
|
325
|
+
return this.getPrivate('api/v1/withdrawals', params);
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
*
|
|
329
|
+
* REST - Account Info - Transfer
|
|
330
|
+
*
|
|
331
|
+
*/
|
|
332
|
+
/**
|
|
333
|
+
* Get Transfer Quotas
|
|
261
334
|
*
|
|
335
|
+
* This endpoint returns the transferable balance of a specified account.
|
|
262
336
|
*/
|
|
263
337
|
getTransferable(params) {
|
|
264
338
|
return this.getPrivate('api/v1/accounts/transferable', params);
|
|
265
339
|
}
|
|
266
|
-
submitFlexTransfer(params) {
|
|
267
|
-
return this.postPrivate('api/v3/accounts/universal-transfer', params);
|
|
268
|
-
}
|
|
269
340
|
/**
|
|
270
|
-
*
|
|
271
|
-
*
|
|
341
|
+
* Flex Transfer
|
|
342
|
+
*
|
|
343
|
+
* This interface can be used for transfers between master and sub accounts and inner transfers
|
|
272
344
|
*/
|
|
273
|
-
|
|
274
|
-
return this.postPrivate('api/
|
|
345
|
+
submitFlexTransfer(params) {
|
|
346
|
+
return this.postPrivate('api/v3/accounts/universal-transfer', params);
|
|
275
347
|
}
|
|
276
348
|
/**
|
|
277
|
-
*
|
|
278
|
-
*
|
|
349
|
+
*
|
|
350
|
+
* REST - Account Info - Trade Fee
|
|
351
|
+
*
|
|
279
352
|
*/
|
|
280
|
-
submitInnerTransfer(params) {
|
|
281
|
-
return this.postPrivate('api/v2/accounts/inner-transfer', params);
|
|
282
|
-
}
|
|
283
353
|
/**
|
|
354
|
+
* Get Basic Fee - Spot/Margin
|
|
284
355
|
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
356
|
+
* This interface is for the spot/margin basic fee rate of users
|
|
287
357
|
*/
|
|
288
358
|
getBasicUserFee(params) {
|
|
289
359
|
return this.getPrivate('api/v1/base-fee', params);
|
|
290
360
|
}
|
|
361
|
+
/**
|
|
362
|
+
* Get Actual Fee - Spot/Margin
|
|
363
|
+
*
|
|
364
|
+
* This interface is for the actual fee rate of the trading pair.
|
|
365
|
+
* You can inquire about fee rates of 10 trading pairs each time at most.
|
|
366
|
+
* The fee rate of your sub-account is the same as that of the master account.
|
|
367
|
+
*/
|
|
291
368
|
getTradingPairFee(params) {
|
|
292
369
|
return this.getPrivate('api/v1/trade-fees', params);
|
|
293
370
|
}
|
|
294
371
|
/**
|
|
295
372
|
*
|
|
296
|
-
* REST - SPOT TRADING -Market
|
|
373
|
+
* REST - SPOT TRADING - Market Data
|
|
297
374
|
*
|
|
298
375
|
*/
|
|
299
|
-
|
|
300
|
-
|
|
376
|
+
/**
|
|
377
|
+
* Get Announcements
|
|
378
|
+
*
|
|
379
|
+
* This interface can obtain the latest news announcements, and the default page search is for announcements within a month.
|
|
380
|
+
*/
|
|
381
|
+
getAnnouncements(params) {
|
|
382
|
+
return this.get('api/v3/announcements', params);
|
|
301
383
|
}
|
|
384
|
+
/**
|
|
385
|
+
* Get Currency
|
|
386
|
+
*
|
|
387
|
+
* Request via this endpoint to get the currency details of a specified currency.
|
|
388
|
+
*/
|
|
302
389
|
getCurrency(params) {
|
|
303
390
|
return this.get(`api/v3/currencies/${params.currency}`, params);
|
|
304
391
|
}
|
|
305
|
-
|
|
306
|
-
|
|
392
|
+
/**
|
|
393
|
+
* Get All Currencies
|
|
394
|
+
*
|
|
395
|
+
* Request via this endpoint to get the currency list. Not all currencies currently can be used for trading.
|
|
396
|
+
*/
|
|
397
|
+
getCurrencies() {
|
|
398
|
+
return this.get('api/v3/currencies');
|
|
307
399
|
}
|
|
400
|
+
/**
|
|
401
|
+
* Get Symbol
|
|
402
|
+
*
|
|
403
|
+
* Request via this endpoint to get detail currency pairs for trading.
|
|
404
|
+
* If you want to get the market information of the trading symbol, please use Get All Tickers.
|
|
405
|
+
*/
|
|
308
406
|
getSymbol(params) {
|
|
309
407
|
return this.get(`api/v2/symbols/${params.symbol}`);
|
|
310
408
|
}
|
|
409
|
+
/**
|
|
410
|
+
* Get All Symbols
|
|
411
|
+
*
|
|
412
|
+
* Request via this endpoint to get detail currency pairs for trading.
|
|
413
|
+
* If you want to get the market information of the trading symbol, please use Get All Tickers.
|
|
414
|
+
*/
|
|
415
|
+
getSymbols(params) {
|
|
416
|
+
return this.get('api/v2/symbols', params);
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Get Ticker
|
|
420
|
+
*
|
|
421
|
+
* Request via this endpoint to get Level 1 Market Data.
|
|
422
|
+
* The returned value includes the best bid price and size,
|
|
423
|
+
* the best ask price and size as well as the last traded price and the last traded size.
|
|
424
|
+
*/
|
|
311
425
|
getTicker(params) {
|
|
312
426
|
return this.get(`api/v1/market/orderbook/level1`, params);
|
|
313
427
|
}
|
|
428
|
+
/**
|
|
429
|
+
* Get All Tickers
|
|
430
|
+
*
|
|
431
|
+
* Request market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds.
|
|
432
|
+
*/
|
|
314
433
|
getTickers() {
|
|
315
434
|
return this.get('api/v1/market/allTickers');
|
|
316
435
|
}
|
|
317
|
-
|
|
318
|
-
|
|
436
|
+
/**
|
|
437
|
+
* Get Trade History
|
|
438
|
+
*
|
|
439
|
+
* Request via this endpoint to get the trade history of the specified symbol,
|
|
440
|
+
* the returned quantity is the last 100 transaction records.
|
|
441
|
+
*/
|
|
442
|
+
getTradeHistories(params) {
|
|
443
|
+
return this.get('api/v1/market/histories', params);
|
|
319
444
|
}
|
|
320
|
-
|
|
321
|
-
|
|
445
|
+
/**
|
|
446
|
+
* Get Klines
|
|
447
|
+
*
|
|
448
|
+
* Get the Kline of the symbol.
|
|
449
|
+
* Data are returned in grouped buckets based on requested type.
|
|
450
|
+
*/
|
|
451
|
+
getKlines(params) {
|
|
452
|
+
return this.get('api/v1/market/candles', params);
|
|
322
453
|
}
|
|
454
|
+
/**
|
|
455
|
+
* Get Part OrderBook
|
|
456
|
+
*
|
|
457
|
+
* Query for part orderbook depth data. Level 20(aggregated by price)
|
|
458
|
+
*/
|
|
323
459
|
getOrderBookLevel20(params) {
|
|
324
460
|
return this.get(`api/v1/market/orderbook/level2_20`, params);
|
|
325
461
|
}
|
|
462
|
+
/**
|
|
463
|
+
* Get Part OrderBook
|
|
464
|
+
*
|
|
465
|
+
* Query for part orderbook depth data. Level 100(aggregated by price)
|
|
466
|
+
*/
|
|
326
467
|
getOrderBookLevel100(params) {
|
|
327
468
|
return this.get(`api/v1/market/orderbook/level2_100`, params);
|
|
328
469
|
}
|
|
470
|
+
/**
|
|
471
|
+
* Get Full OrderBook
|
|
472
|
+
*
|
|
473
|
+
* Query for full orderbook depth data. (aggregated by price)
|
|
474
|
+
*/
|
|
329
475
|
getFullOrderBook(params) {
|
|
330
476
|
return this.getPrivate('api/v3/market/orderbook/level2', params);
|
|
331
477
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
}
|
|
478
|
+
/**
|
|
479
|
+
* Get Fiat Price
|
|
480
|
+
*
|
|
481
|
+
* Request via this endpoint to get the fiat price of the currencies for the available trading pairs.
|
|
482
|
+
*/
|
|
338
483
|
getFiatPrice(params) {
|
|
339
484
|
return this.get('api/v1/prices', params);
|
|
340
485
|
}
|
|
341
486
|
/**
|
|
487
|
+
* Get 24hr Stats
|
|
342
488
|
*
|
|
343
|
-
*
|
|
489
|
+
* Request via this endpoint to get the statistics of the specified ticker in the last 24 hours.
|
|
490
|
+
*/
|
|
491
|
+
get24hrStats(params) {
|
|
492
|
+
return this.get('api/v1/market/stats', params);
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Get Market List
|
|
344
496
|
*
|
|
497
|
+
* Request via this endpoint to get the transaction currency for the entire trading market.
|
|
345
498
|
*/
|
|
346
|
-
|
|
347
|
-
return this.
|
|
499
|
+
getMarkets() {
|
|
500
|
+
return this.get('api/v1/markets');
|
|
348
501
|
}
|
|
502
|
+
/**
|
|
503
|
+
*
|
|
504
|
+
* REST - SPOT TRADING - Orders
|
|
505
|
+
*
|
|
506
|
+
*/
|
|
507
|
+
/**
|
|
508
|
+
* Add Order
|
|
509
|
+
*
|
|
510
|
+
* Place order to the Spot trading system, you can place two major types of orders: limit and market.
|
|
511
|
+
* Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order.
|
|
512
|
+
* The amount of funds on hold depends on the order type and parameters specified.
|
|
513
|
+
*/
|
|
349
514
|
submitHFOrder(params) {
|
|
350
515
|
return this.postPrivate('api/v1/hf/orders', params);
|
|
351
516
|
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
517
|
+
/**
|
|
518
|
+
* Add Order Sync
|
|
519
|
+
*
|
|
520
|
+
* Place order to the spot trading system
|
|
521
|
+
*
|
|
522
|
+
* The difference between this interface and "Add order" is that this interface will synchronously return the order information after the order matching is completed.
|
|
523
|
+
*/
|
|
355
524
|
submitHFOrderSync(params) {
|
|
356
525
|
return this.postPrivate('api/v1/hf/orders/sync', params);
|
|
357
526
|
}
|
|
527
|
+
/**
|
|
528
|
+
* Add Order Test
|
|
529
|
+
*
|
|
530
|
+
* Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint,
|
|
531
|
+
* and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.
|
|
532
|
+
*/
|
|
533
|
+
submitHFOrderTest() {
|
|
534
|
+
return this.postPrivate('api/v1/hf/orders/test');
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* Batch Add Orders
|
|
538
|
+
*
|
|
539
|
+
* This endpoint supports sequential batch order placement from a single endpoint. A maximum of 20 orders can be placed simultaneously.
|
|
540
|
+
*/
|
|
358
541
|
submitHFMultipleOrders(params) {
|
|
359
542
|
return this.postPrivate('api/v1/hf/orders/multi', params);
|
|
360
543
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
544
|
+
/**
|
|
545
|
+
* Batch Add Orders Sync
|
|
546
|
+
*
|
|
547
|
+
* This endpoint supports sequential batch order placement from a single endpoint. A maximum of 20 orders can be placed simultaneously.
|
|
548
|
+
* The difference between this interface and "Batch Add Orders" is that this interface will synchronously return the order information after the order matching is completed.
|
|
549
|
+
*/
|
|
550
|
+
submitHFMultipleOrdersSync(params) {
|
|
551
|
+
return this.postPrivate('api/v1/hf/orders/multi/sync', params);
|
|
366
552
|
}
|
|
553
|
+
/**
|
|
554
|
+
* Cancel Order By OrderId
|
|
555
|
+
*
|
|
556
|
+
* This endpoint can be used to cancel a spot order by orderId.
|
|
557
|
+
* This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.
|
|
558
|
+
*/
|
|
367
559
|
cancelHFOrder(params) {
|
|
368
560
|
return this.deletePrivate(`api/v1/hf/orders/${params.orderId}`, params);
|
|
369
561
|
}
|
|
562
|
+
/**
|
|
563
|
+
* Cancel Order By OrderId Sync
|
|
564
|
+
*
|
|
565
|
+
* This endpoint can be used to cancel a spot order by orderId.
|
|
566
|
+
* The difference between this interface and "Cancel Order By OrderId" is that this interface will synchronously return the order information after the order canceling is completed.
|
|
567
|
+
*/
|
|
370
568
|
cancelHFOrderSync(params) {
|
|
371
569
|
return this.deletePrivate(`api/v1/hf/orders/sync/${params.orderId}`, params);
|
|
372
570
|
}
|
|
571
|
+
/**
|
|
572
|
+
* Cancel Order By ClientOid
|
|
573
|
+
*
|
|
574
|
+
* This endpoint can be used to cancel a spot order by clientOid.
|
|
575
|
+
* This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.
|
|
576
|
+
*/
|
|
373
577
|
cancelHFOrderByClientOId(params) {
|
|
374
578
|
return this.deletePrivate(`api/v1/hf/orders/client-order/${params.clientOid}`, params);
|
|
375
579
|
}
|
|
580
|
+
/**
|
|
581
|
+
* Cancel Order By ClientOid Sync
|
|
582
|
+
*
|
|
583
|
+
* This endpoint can be used to cancel a spot order by clientOid.
|
|
584
|
+
* The difference between this interface and "Cancel Order By ClientOid" is that this interface will synchronously return the order information after the order canceling is completed.
|
|
585
|
+
*/
|
|
376
586
|
cancelHFOrderSyncByClientOId(params) {
|
|
377
587
|
return this.deletePrivate(`api/v1/hf/orders/sync/client-order/${params.clientOid}`, params);
|
|
378
588
|
}
|
|
379
|
-
cancelHFOrdersNumber(params) {
|
|
380
|
-
return this.deletePrivate(`api/v1/hf/orders/cancel/${params.orderId}`, params);
|
|
381
|
-
}
|
|
382
|
-
cancelHFAllOrdersBySymbol(params) {
|
|
383
|
-
return this.deletePrivate(`api/v1/hf/orders`, params);
|
|
384
|
-
}
|
|
385
|
-
cancelHFAllOrders() {
|
|
386
|
-
return this.deletePrivate(`api/v1/hf/orders/cancelAll`);
|
|
387
|
-
}
|
|
388
|
-
getHFActiveOrders(params) {
|
|
389
|
-
return this.getPrivate(`api/v1/hf/orders/active`, params);
|
|
390
|
-
}
|
|
391
|
-
getHFActiveSymbols() {
|
|
392
|
-
return this.getPrivate(`api/v1/hf/orders/active/symbols`);
|
|
393
|
-
}
|
|
394
|
-
getHFCompletedOrders(params) {
|
|
395
|
-
return this.getPrivate(`api/v1/hf/orders/done`, params);
|
|
396
|
-
}
|
|
397
|
-
getHFOrderDetailsByOrderId(params) {
|
|
398
|
-
return this.getPrivate(`api/v1/hf/orders/${params.orderId}`, params);
|
|
399
|
-
}
|
|
400
|
-
getHFOrderDetailsByClientOid(params) {
|
|
401
|
-
return this.getPrivate(`api/v1/hf/orders/client-order/${params.clientOid}`, params);
|
|
402
|
-
}
|
|
403
|
-
cancelHFOrderAutoSetting(params) {
|
|
404
|
-
return this.postPrivate('api/v1/hf/orders/dead-cancel-all', params);
|
|
405
|
-
}
|
|
406
|
-
cancelHFOrderAutoSettingQuery() {
|
|
407
|
-
return this.getPrivate('api/v1/hf/orders/dead-cancel-all/query');
|
|
408
|
-
}
|
|
409
|
-
getHFFilledOrders(params) {
|
|
410
|
-
return this.getPrivate('api/v1/hf/fills', params);
|
|
411
|
-
}
|
|
412
589
|
/**
|
|
590
|
+
* Cancel Partial Order
|
|
413
591
|
*
|
|
414
|
-
*
|
|
415
|
-
*
|
|
416
|
-
*/
|
|
417
|
-
/**
|
|
418
|
-
* @deprecated This method is deprecated.
|
|
419
|
-
* It is recommended to use the POST /api/v1/hf/orders endpoint instead of this endpoint
|
|
592
|
+
* This interface can cancel the specified quantity of the order according to the orderId.
|
|
420
593
|
*/
|
|
421
|
-
|
|
422
|
-
return this.
|
|
594
|
+
cancelHFOrdersNumber(params) {
|
|
595
|
+
return this.deletePrivate(`api/v1/hf/orders/cancel/${params.orderId}`, params);
|
|
423
596
|
}
|
|
424
597
|
/**
|
|
425
|
-
*
|
|
426
|
-
*
|
|
598
|
+
* Cancel All Orders By Symbol
|
|
599
|
+
*
|
|
600
|
+
* This endpoint can cancel all spot orders for specific symbol.
|
|
427
601
|
*/
|
|
428
|
-
|
|
429
|
-
return this.
|
|
602
|
+
cancelHFAllOrdersBySymbol(params) {
|
|
603
|
+
return this.deletePrivate(`api/v1/hf/orders`, params);
|
|
430
604
|
}
|
|
431
605
|
/**
|
|
432
|
-
*
|
|
433
|
-
*
|
|
606
|
+
* Cancel All Orders
|
|
607
|
+
*
|
|
608
|
+
* This endpoint can cancel all spot orders for all symbol.
|
|
434
609
|
*/
|
|
435
|
-
|
|
436
|
-
return this.
|
|
610
|
+
cancelHFAllOrders() {
|
|
611
|
+
return this.deletePrivate(`api/v1/hf/orders/cancelAll`);
|
|
437
612
|
}
|
|
438
613
|
/**
|
|
439
|
-
*
|
|
440
|
-
*
|
|
614
|
+
* Modify Order
|
|
615
|
+
*
|
|
616
|
+
* This interface can modify the price and quantity of the order according to orderId or clientOid.
|
|
441
617
|
*/
|
|
442
|
-
|
|
443
|
-
return this.
|
|
618
|
+
updateHFOrder(params) {
|
|
619
|
+
return this.postPrivate('api/v1/hf/orders/alter', params);
|
|
444
620
|
}
|
|
445
621
|
/**
|
|
446
|
-
*
|
|
447
|
-
*
|
|
622
|
+
* Get Order By OrderId
|
|
623
|
+
*
|
|
624
|
+
* This endpoint can be used to obtain information for a single Spot order using the order id.
|
|
448
625
|
*/
|
|
449
|
-
|
|
450
|
-
return this.
|
|
626
|
+
getHFOrderDetailsByOrderId(params) {
|
|
627
|
+
return this.getPrivate(`api/v1/hf/orders/${params.orderId}`, params);
|
|
451
628
|
}
|
|
452
629
|
/**
|
|
453
|
-
*
|
|
454
|
-
*
|
|
630
|
+
* Get Order By ClientOid
|
|
631
|
+
*
|
|
632
|
+
* This endpoint can be used to obtain information for a single Spot order using the clientOid.
|
|
455
633
|
*/
|
|
456
|
-
|
|
457
|
-
return this.
|
|
634
|
+
getHFOrderDetailsByClientOid(params) {
|
|
635
|
+
return this.getPrivate(`api/v1/hf/orders/client-order/${params.clientOid}`, params);
|
|
458
636
|
}
|
|
459
637
|
/**
|
|
460
|
-
*
|
|
461
|
-
*
|
|
638
|
+
* Get Symbols With Open Order
|
|
639
|
+
*
|
|
640
|
+
* This interface can query all spot symbol that has active orders
|
|
462
641
|
*/
|
|
463
|
-
|
|
464
|
-
return this.getPrivate(
|
|
642
|
+
getHFActiveSymbols() {
|
|
643
|
+
return this.getPrivate(`api/v1/hf/orders/active/symbols`);
|
|
465
644
|
}
|
|
466
645
|
/**
|
|
467
|
-
*
|
|
468
|
-
*
|
|
646
|
+
* Get Open Orders
|
|
647
|
+
*
|
|
648
|
+
* This interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists.
|
|
649
|
+
* The returned data is sorted in descending order according to the latest update time of the order.
|
|
469
650
|
*/
|
|
470
|
-
|
|
471
|
-
return this.getPrivate(
|
|
651
|
+
getHFActiveOrders(params) {
|
|
652
|
+
return this.getPrivate(`api/v1/hf/orders/active`, params);
|
|
472
653
|
}
|
|
473
654
|
/**
|
|
474
|
-
*
|
|
475
|
-
*
|
|
655
|
+
* Get Closed Orders
|
|
656
|
+
*
|
|
657
|
+
* This interface is to obtain all Spot completed order lists, and the return value of the completed order interface is the paged data of all completed order lists.
|
|
658
|
+
* The returned data is sorted in descending order according to the latest update time of the order.
|
|
476
659
|
*/
|
|
477
|
-
|
|
478
|
-
return this.getPrivate(`api/v1/orders
|
|
660
|
+
getHFCompletedOrders(params) {
|
|
661
|
+
return this.getPrivate(`api/v1/hf/orders/done`, params);
|
|
479
662
|
}
|
|
480
663
|
/**
|
|
481
|
-
*
|
|
482
|
-
*
|
|
664
|
+
* Get Trade History
|
|
665
|
+
*
|
|
666
|
+
* This endpoint can be used to obtain a list of the latest Spot transaction details.
|
|
483
667
|
*/
|
|
484
|
-
|
|
485
|
-
return this.getPrivate(
|
|
668
|
+
getHFFilledOrders(params) {
|
|
669
|
+
return this.getPrivate('api/v1/hf/fills', params);
|
|
486
670
|
}
|
|
487
671
|
/**
|
|
672
|
+
* Get DCP
|
|
488
673
|
*
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
*/
|
|
492
|
-
/**
|
|
493
|
-
* @deprecated This method is deprecated.
|
|
494
|
-
* It is recommended to use the GET /api/v1/hf/fills endpoint instead of this endpoint
|
|
674
|
+
* Get Disconnection Protect(Deadman Swich)
|
|
675
|
+
* Through this interface, you can query the settings of automatic order cancellation
|
|
495
676
|
*/
|
|
496
|
-
|
|
497
|
-
return this.getPrivate('api/v1/
|
|
677
|
+
cancelHFOrderAutoSettingQuery() {
|
|
678
|
+
return this.getPrivate('api/v1/hf/orders/dead-cancel-all/query');
|
|
498
679
|
}
|
|
499
680
|
/**
|
|
500
|
-
*
|
|
501
|
-
*
|
|
681
|
+
* Set DCP
|
|
682
|
+
*
|
|
683
|
+
* Set Disconnection Protect(Deadman Swich)
|
|
684
|
+
* Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time.
|
|
685
|
+
* If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not.
|
|
502
686
|
*/
|
|
503
|
-
|
|
504
|
-
return this.
|
|
687
|
+
cancelHFOrderAutoSetting(params) {
|
|
688
|
+
return this.postPrivate('api/v1/hf/orders/dead-cancel-all', params);
|
|
505
689
|
}
|
|
506
690
|
/**
|
|
691
|
+
* Add Stop Order
|
|
507
692
|
*
|
|
508
|
-
*
|
|
509
|
-
*
|
|
693
|
+
* Place stop order to the Spot trading system.
|
|
510
694
|
*/
|
|
511
|
-
// Spot and margin trading, submits a stop order on the platform.
|
|
512
695
|
submitStopOrder(params) {
|
|
513
696
|
return this.postPrivate('api/v1/stop-order', params);
|
|
514
697
|
}
|
|
515
698
|
/**
|
|
516
|
-
*
|
|
699
|
+
* Cancel Stop Order By ClientOid
|
|
517
700
|
*
|
|
518
|
-
* This endpoint
|
|
701
|
+
* This endpoint can be used to cancel a spot stop order by clientOid.
|
|
519
702
|
*/
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
cancelStopOrderById(params) {
|
|
523
|
-
return this.deletePrivate(`api/v1/stop-order/${params.orderId}`);
|
|
703
|
+
cancelStopOrderByClientOid(params) {
|
|
704
|
+
return this.deletePrivate(`api/v1/stop-order/cancelOrderByClientOid`, params);
|
|
524
705
|
}
|
|
525
706
|
/**
|
|
526
|
-
*
|
|
707
|
+
* Cancel Stop Order By OrderId
|
|
708
|
+
*
|
|
709
|
+
* Request via this endpoint to cancel a single stop order previously placed.
|
|
527
710
|
*/
|
|
528
|
-
|
|
529
|
-
return this.deletePrivate(`api/v1/stop-order
|
|
711
|
+
cancelStopOrderById(params) {
|
|
712
|
+
return this.deletePrivate(`api/v1/stop-order/${params.orderId}`);
|
|
530
713
|
}
|
|
531
714
|
/**
|
|
532
|
-
*
|
|
715
|
+
* Batch Cancel Stop Orders
|
|
716
|
+
*
|
|
717
|
+
* Request via this interface to cancel a batch of stop orders.
|
|
533
718
|
*/
|
|
534
719
|
cancelStopOrders(params) {
|
|
535
720
|
return this.deletePrivate(`api/v1/stop-order/cancel`, params);
|
|
536
721
|
}
|
|
537
722
|
/**
|
|
538
|
-
*
|
|
723
|
+
* Get Stop Orders List
|
|
724
|
+
*
|
|
725
|
+
* Request via this endpoint to get your current untriggered stop order list.
|
|
539
726
|
*/
|
|
540
727
|
getStopOrders(params) {
|
|
541
728
|
return this.getPrivate('api/v1/stop-order', params);
|
|
542
729
|
}
|
|
543
730
|
/**
|
|
544
|
-
*
|
|
731
|
+
* Get Stop Order By OrderId
|
|
732
|
+
*
|
|
733
|
+
* Request via this interface to get a stop order information via the order ID.
|
|
734
|
+
|
|
735
|
+
|
|
545
736
|
*/
|
|
546
737
|
getStopOrderByOrderId(params) {
|
|
547
738
|
return this.getPrivate(`api/v1/stop-order/${params.orderId}`);
|
|
548
739
|
}
|
|
549
740
|
/**
|
|
550
|
-
*
|
|
741
|
+
* Get Stop Order By ClientOid
|
|
742
|
+
*
|
|
743
|
+
*
|
|
551
744
|
*/
|
|
552
745
|
getStopOrderByClientOid(params) {
|
|
553
746
|
return this.getPrivate('api/v1/stop-order/queryOrderByClientOid', params);
|
|
554
747
|
}
|
|
555
748
|
/**
|
|
749
|
+
* Add OCO Order
|
|
556
750
|
*
|
|
557
|
-
*
|
|
558
|
-
*
|
|
751
|
+
* Place OCO order to the Spot trading system
|
|
559
752
|
*/
|
|
560
|
-
// submits an OCO (One Cancels the Other) order on the platform.
|
|
561
753
|
submitOCOOrder(params) {
|
|
562
754
|
return this.postPrivate('api/v3/oco/order', params);
|
|
563
755
|
}
|
|
564
756
|
/**
|
|
565
|
-
*
|
|
757
|
+
* Cancel OCO Order By OrderId
|
|
758
|
+
*
|
|
759
|
+
* Request via this endpoint to cancel a single oco order previously placed.
|
|
566
760
|
*/
|
|
567
761
|
cancelOCOOrderById(params) {
|
|
568
762
|
return this.deletePrivate(`api/v3/oco/order/${params.orderId}`);
|
|
569
763
|
}
|
|
570
764
|
/**
|
|
571
|
-
*
|
|
765
|
+
* Cancel OCO Order By ClientOid
|
|
766
|
+
*
|
|
767
|
+
* Request via this endpoint to cancel a single oco order previously placed.
|
|
572
768
|
*/
|
|
573
769
|
cancelOCOOrderByClientOid(params) {
|
|
574
770
|
return this.deletePrivate(`api/v3/oco/client-order/${params.clientOid}`);
|
|
575
771
|
}
|
|
576
772
|
/**
|
|
577
|
-
* Batch
|
|
773
|
+
* Batch Cancel OCO Order
|
|
774
|
+
*
|
|
775
|
+
* This interface can batch cancel OCO orders through orderIds.
|
|
578
776
|
*/
|
|
579
777
|
cancelMultipleOCOOrders(params) {
|
|
580
778
|
return this.deletePrivate('api/v3/oco/orders', params);
|
|
581
779
|
}
|
|
582
780
|
/**
|
|
583
|
-
*
|
|
781
|
+
* Get OCO Order By OrderId
|
|
782
|
+
*
|
|
783
|
+
* Request via this interface to get a oco order information via the order ID.
|
|
584
784
|
*/
|
|
585
785
|
getOCOOrderByOrderId(params) {
|
|
586
786
|
return this.getPrivate(`api/v3/oco/order/${params.orderId}`);
|
|
587
787
|
}
|
|
588
788
|
/**
|
|
589
|
-
*
|
|
789
|
+
* Get OCO Order By ClientOid
|
|
790
|
+
*
|
|
791
|
+
* Request via this interface to get a oco order information via the clientOid.
|
|
590
792
|
*/
|
|
591
793
|
getOCOOrderByClientOid(params) {
|
|
592
794
|
return this.getPrivate(`api/v3/oco/client-order/${params.clientOid}`);
|
|
593
795
|
}
|
|
594
796
|
/**
|
|
595
|
-
*
|
|
797
|
+
* Get OCO Order Details
|
|
798
|
+
*
|
|
799
|
+
* Request via this interface to get a oco order information via the order ID.
|
|
596
800
|
*/
|
|
597
801
|
getOCOOrderDetails(params) {
|
|
598
802
|
return this.getPrivate(`api/v3/oco/order/details/${params.orderId}`);
|
|
599
803
|
}
|
|
600
804
|
/**
|
|
601
|
-
*
|
|
805
|
+
* Get OCO Order List
|
|
806
|
+
*
|
|
807
|
+
* Request via this endpoint to get your current OCO order list.
|
|
602
808
|
*/
|
|
603
809
|
getOCOOrders(params) {
|
|
604
810
|
return this.getPrivate('api/v3/oco/orders', params);
|
|
605
811
|
}
|
|
606
812
|
/**
|
|
607
813
|
*
|
|
608
|
-
* REST - MARGIN TRADING -
|
|
814
|
+
* REST - MARGIN TRADING - Market Data
|
|
815
|
+
*
|
|
816
|
+
*/
|
|
817
|
+
/**
|
|
818
|
+
* Get Symbols - Cross Margin
|
|
819
|
+
*
|
|
820
|
+
* This endpoint allows querying the configuration of cross margin symbol.
|
|
821
|
+
*/
|
|
822
|
+
getMarginActivePairsV3(params) {
|
|
823
|
+
return this.getPrivate('api/v3/margin/symbols', params);
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Get Margin Config
|
|
827
|
+
*
|
|
828
|
+
* Request via this endpoint to get the configure info of the cross margin.
|
|
829
|
+
*/
|
|
830
|
+
getMarginConfigInfo() {
|
|
831
|
+
return this.get('api/v1/margin/config');
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* Get ETF Info
|
|
835
|
+
*
|
|
836
|
+
* This interface returns leveraged token information
|
|
837
|
+
*/
|
|
838
|
+
getMarginLeveragedToken(params) {
|
|
839
|
+
return this.getPrivate('api/v3/etf/info', params);
|
|
840
|
+
}
|
|
841
|
+
/**
|
|
842
|
+
* Get Mark Price List
|
|
843
|
+
*
|
|
844
|
+
* This endpoint returns the current Mark price for all margin trading pairs.
|
|
845
|
+
*/
|
|
846
|
+
getMarginMarkPrices() {
|
|
847
|
+
return this.get('api/v3/mark-price/all-symbols');
|
|
848
|
+
}
|
|
849
|
+
/**
|
|
850
|
+
* Get Mark Price Detail
|
|
851
|
+
*
|
|
852
|
+
* This endpoint returns the current Mark price for specified margin trading pairs.
|
|
853
|
+
*/
|
|
854
|
+
getMarginMarkPrice(params) {
|
|
855
|
+
return this.get(`api/v1/mark-price/${params.symbol}/current`);
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Get Symbols - Isolated Margin
|
|
859
|
+
*
|
|
860
|
+
* This endpoint allows querying the configuration of isolated margin symbol.
|
|
861
|
+
*/
|
|
862
|
+
getIsolatedMarginSymbolsConfig() {
|
|
863
|
+
return this.getPrivate('api/v1/isolated/symbols');
|
|
864
|
+
}
|
|
865
|
+
/**
|
|
866
|
+
*
|
|
867
|
+
* REST - MARGIN TRADING - Orders
|
|
868
|
+
*
|
|
869
|
+
*/
|
|
870
|
+
/**
|
|
871
|
+
* Add Order
|
|
609
872
|
*
|
|
873
|
+
* Place order to the Cross-margin or Isolated-margin trading system
|
|
610
874
|
*/
|
|
611
875
|
submitHFMarginOrder(params) {
|
|
612
876
|
return this.postPrivate('api/v3/hf/margin/order', params);
|
|
613
877
|
}
|
|
878
|
+
/**
|
|
879
|
+
* Add Order Test
|
|
880
|
+
*
|
|
881
|
+
* This interface is used to test the order submission.
|
|
882
|
+
*/
|
|
614
883
|
submitHFMarginOrderTest() {
|
|
615
884
|
return this.postPrivate('api/v3/hf/margin/order/test');
|
|
616
885
|
}
|
|
886
|
+
/**
|
|
887
|
+
* Cancel Order By OrderId
|
|
888
|
+
*
|
|
889
|
+
* This endpoint can be used to cancel a margin order by orderId.
|
|
890
|
+
*/
|
|
617
891
|
cancelHFMarginOrder(params) {
|
|
618
892
|
return this.deletePrivate(`api/v3/hf/margin/orders/${params.orderId}`, params);
|
|
619
893
|
}
|
|
894
|
+
/**
|
|
895
|
+
* Cancel Order By ClientOid
|
|
896
|
+
*
|
|
897
|
+
* This endpoint can be used to cancel a margin order by clientOid.
|
|
898
|
+
*/
|
|
620
899
|
cancelHFMarginOrderByClientOid(params) {
|
|
621
900
|
return this.deletePrivate(`api/v3/hf/margin/orders/client-order/${params.clientOid}`, params);
|
|
622
901
|
}
|
|
902
|
+
/**
|
|
903
|
+
* Cancel All Orders By Symbol
|
|
904
|
+
*
|
|
905
|
+
* This interface can cancel all open Margin orders by symbol
|
|
906
|
+
*/
|
|
623
907
|
cancelHFAllMarginOrders(params) {
|
|
624
908
|
return this.deletePrivate(`api/v3/hf/margin/orders`, params);
|
|
625
909
|
}
|
|
910
|
+
/**
|
|
911
|
+
* Get Symbols With Open Order
|
|
912
|
+
*
|
|
913
|
+
* This interface can query all Margin symbol that has active orders
|
|
914
|
+
*/
|
|
915
|
+
getHFMarginOpenSymbols(params) {
|
|
916
|
+
return this.getPrivate('api/v3/hf/margin/order/active/symbols', params);
|
|
917
|
+
}
|
|
918
|
+
/**
|
|
919
|
+
* Get Open Orders
|
|
920
|
+
*
|
|
921
|
+
* This interface is to obtain all Margin active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists.
|
|
922
|
+
*/
|
|
626
923
|
getHFActiveMarginOrders(params) {
|
|
627
924
|
return this.getPrivate(`api/v3/hf/margin/orders/active`, params);
|
|
628
925
|
}
|
|
926
|
+
/**
|
|
927
|
+
* Get Closed Orders
|
|
928
|
+
*
|
|
929
|
+
* This interface is to obtain all Margin Closed order lists
|
|
930
|
+
*/
|
|
629
931
|
getHFMarginFilledOrders(params) {
|
|
630
932
|
return this.getPrivate('api/v3/hf/margin/orders/done', params);
|
|
631
933
|
}
|
|
934
|
+
/**
|
|
935
|
+
* Get Trade History
|
|
936
|
+
*
|
|
937
|
+
* This endpoint can be used to obtain a list of the latest Margin transaction details.
|
|
938
|
+
*/
|
|
939
|
+
getHFMarginFills(params) {
|
|
940
|
+
return this.getPrivate('api/v3/hf/margin/fills', params);
|
|
941
|
+
}
|
|
942
|
+
/**
|
|
943
|
+
* Get Order By OrderId
|
|
944
|
+
*
|
|
945
|
+
* This endpoint can be used to obtain a Margin order by orderId.
|
|
946
|
+
*/
|
|
632
947
|
getHFMarginOrderByOrderId(params) {
|
|
633
948
|
return this.getPrivate(`api/v3/hf/margin/orders/${params.orderId}`, params);
|
|
634
949
|
}
|
|
950
|
+
/**
|
|
951
|
+
* Get Order By ClientOid
|
|
952
|
+
*
|
|
953
|
+
* This endpoint can be used to obtain a Margin order by clientOid.
|
|
954
|
+
*/
|
|
635
955
|
getHFMarginOrderByClientOid(params) {
|
|
636
956
|
return this.getPrivate(`api/v3/hf/margin/orders/client-order/${params.clientOid}?symbol=${params.symbol}`);
|
|
637
957
|
}
|
|
638
|
-
getHFMarginFills(params) {
|
|
639
|
-
return this.getPrivate('api/v3/hf/margin/fills', params);
|
|
640
|
-
}
|
|
641
|
-
getHFMarginOpenSymbols(params) {
|
|
642
|
-
return this.getPrivate('api/v3/hf/margin/order/active/symbols', params);
|
|
643
|
-
}
|
|
644
958
|
/**
|
|
645
959
|
*
|
|
646
|
-
* REST - MARGIN TRADING -
|
|
960
|
+
* REST - MARGIN TRADING - Debit
|
|
647
961
|
*
|
|
648
962
|
*/
|
|
649
963
|
/**
|
|
650
|
-
*
|
|
651
|
-
*
|
|
964
|
+
* Borrow
|
|
965
|
+
*
|
|
966
|
+
* This API endpoint is used to initiate an application for cross or isolated margin borrowing.
|
|
652
967
|
*/
|
|
653
|
-
|
|
654
|
-
return this.postPrivate('api/
|
|
968
|
+
marginBorrowV3(params) {
|
|
969
|
+
return this.postPrivate('api/v3/margin/borrow', params);
|
|
655
970
|
}
|
|
656
971
|
/**
|
|
657
|
-
*
|
|
658
|
-
*
|
|
972
|
+
* Get Borrow History
|
|
973
|
+
*
|
|
974
|
+
* This API endpoint is used to get the borrowing orders for cross and isolated margin accounts
|
|
659
975
|
*/
|
|
660
|
-
|
|
661
|
-
return this.
|
|
976
|
+
getMarginBorrowHistoryV3(params) {
|
|
977
|
+
return this.getPrivate('api/v3/margin/borrow', params);
|
|
662
978
|
}
|
|
663
979
|
/**
|
|
980
|
+
* Repay
|
|
664
981
|
*
|
|
665
|
-
*
|
|
666
|
-
*
|
|
982
|
+
* This API endpoint is used to initiate an application for cross or isolated margin repayment.
|
|
667
983
|
*/
|
|
668
|
-
|
|
669
|
-
return this.
|
|
670
|
-
}
|
|
671
|
-
getMarginMarkPrices() {
|
|
672
|
-
return this.get('api/v3/mark-price/all-symbols');
|
|
673
|
-
}
|
|
674
|
-
getMarginMarkPrice(params) {
|
|
675
|
-
return this.get(`api/v1/mark-price/${params.symbol}/current`);
|
|
676
|
-
}
|
|
677
|
-
getMarginConfigInfo() {
|
|
678
|
-
return this.get('api/v1/margin/config');
|
|
679
|
-
}
|
|
680
|
-
getMarginRiskLimitConfig(params) {
|
|
681
|
-
return this.getPrivate('api/v3/margin/currencies', params);
|
|
984
|
+
marginRepayV3(params) {
|
|
985
|
+
return this.postPrivate('api/v3/margin/repay', params);
|
|
682
986
|
}
|
|
683
987
|
/**
|
|
988
|
+
* Get Repay History
|
|
684
989
|
*
|
|
685
|
-
*
|
|
686
|
-
*
|
|
687
|
-
*/
|
|
688
|
-
getIsolatedMarginSymbolsConfig() {
|
|
689
|
-
return this.getPrivate('api/v1/isolated/symbols');
|
|
690
|
-
}
|
|
691
|
-
/**
|
|
692
|
-
* @deprecated This method is deprecated.
|
|
693
|
-
* It is recommended to use the GET /api/v3/margin/accounts endpoint instead of this endpoint
|
|
990
|
+
* This API endpoint is used to get the repayment orders for cross and isolated margin accounts
|
|
694
991
|
*/
|
|
695
|
-
|
|
696
|
-
return this.getPrivate('api/
|
|
697
|
-
}
|
|
698
|
-
/**
|
|
699
|
-
* @deprecated This method is deprecated.
|
|
700
|
-
* It is recommended to use the GET /api/v3/isolated/accounts endpoint instead of this endpoint
|
|
701
|
-
*/
|
|
702
|
-
getIsolatedMarginAccount(params) {
|
|
703
|
-
return this.getPrivate(`api/v1/isolated/account/${params.symbol}`);
|
|
992
|
+
getMarginRepayHistoryV3(params) {
|
|
993
|
+
return this.getPrivate('api/v3/margin/repay', params);
|
|
704
994
|
}
|
|
705
995
|
/**
|
|
996
|
+
* Get Interest History
|
|
706
997
|
*
|
|
707
|
-
*
|
|
708
|
-
*
|
|
998
|
+
* Request via this endpoint to get the interest records of the cross/isolated margin lending.
|
|
709
999
|
*/
|
|
710
|
-
marginBorrowV3(params) {
|
|
711
|
-
return this.postPrivate('api/v3/margin/borrow', params);
|
|
712
|
-
}
|
|
713
|
-
marginRepayV3(params) {
|
|
714
|
-
return this.postPrivate('api/v3/margin/repay', params);
|
|
715
|
-
}
|
|
716
|
-
getMarginBorrowHistoryV3(params) {
|
|
717
|
-
return this.getPrivate('api/v3/margin/borrow', params);
|
|
718
|
-
}
|
|
719
|
-
getMarginRepayHistoryV3(params) {
|
|
720
|
-
return this.getPrivate('api/v3/margin/repay', params);
|
|
721
|
-
}
|
|
722
1000
|
getMarginInterestRecordsV3(params) {
|
|
723
1001
|
return this.getPrivate('api/v3/margin/interest', params);
|
|
724
1002
|
}
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
1003
|
+
/**
|
|
1004
|
+
* Modify Leverage
|
|
1005
|
+
*
|
|
1006
|
+
* This endpoint allows modifying the leverage multiplier for cross margin or isolated margin.
|
|
1007
|
+
*/
|
|
728
1008
|
updateMarginLeverageV3(params) {
|
|
729
1009
|
return this.postPrivate('api/v3/position/update-user-leverage', params);
|
|
730
1010
|
}
|
|
731
1011
|
/**
|
|
732
1012
|
*
|
|
733
|
-
* REST - MARGIN TRADING -
|
|
1013
|
+
* REST - MARGIN TRADING - Credit
|
|
1014
|
+
*
|
|
1015
|
+
*/
|
|
1016
|
+
/**
|
|
1017
|
+
* Get Loan Market
|
|
734
1018
|
*
|
|
1019
|
+
* This API endpoint is used to get the information about the currencies available for lending.
|
|
735
1020
|
*/
|
|
736
1021
|
getLendingCurrencyV3(params) {
|
|
737
1022
|
return this.get('api/v3/project/list', params);
|
|
738
1023
|
}
|
|
1024
|
+
/**
|
|
1025
|
+
* Get Loan Market Interest Rate
|
|
1026
|
+
*
|
|
1027
|
+
* This API endpoint is used to get the interest rates of the margin lending market over the past 7 days.
|
|
1028
|
+
*/
|
|
739
1029
|
getLendingInterestRateV3(params) {
|
|
740
1030
|
return this.get('api/v3/project/marketInterestRate', params);
|
|
741
1031
|
}
|
|
1032
|
+
/**
|
|
1033
|
+
* Purchase
|
|
1034
|
+
*
|
|
1035
|
+
* Invest credit in the market and earn interest,Please ensure that the funds are in the main(funding) account
|
|
1036
|
+
*/
|
|
742
1037
|
submitLendingSubscriptionV3(params) {
|
|
743
1038
|
return this.postPrivate('api/v3/purchase', params);
|
|
744
1039
|
}
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
1040
|
+
/**
|
|
1041
|
+
* Modify Purchase
|
|
1042
|
+
*
|
|
1043
|
+
* This API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.
|
|
1044
|
+
*/
|
|
748
1045
|
updateLendingSubscriptionOrdersV3(params) {
|
|
749
1046
|
return this.postPrivate('api/v3/lend/purchase/update', params);
|
|
750
1047
|
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
1048
|
+
/**
|
|
1049
|
+
* Get Purchase Orders
|
|
1050
|
+
*
|
|
1051
|
+
* This API endpoint provides pagination query for the purchase orders.
|
|
1052
|
+
*/
|
|
754
1053
|
getLendingSubscriptionOrdersV3(params) {
|
|
755
1054
|
return this.getPrivate('api/v3/purchase/orders', params);
|
|
756
1055
|
}
|
|
757
1056
|
/**
|
|
1057
|
+
* Redeem
|
|
758
1058
|
*
|
|
759
|
-
*
|
|
1059
|
+
* Redeem your loan order
|
|
1060
|
+
*/
|
|
1061
|
+
submitLendingRedemptionV3(params) {
|
|
1062
|
+
return this.postPrivate('api/v3/redeem', params);
|
|
1063
|
+
}
|
|
1064
|
+
/**
|
|
1065
|
+
* Get Redeem Orders
|
|
760
1066
|
*
|
|
1067
|
+
* This API endpoint provides pagination query for the redeem orders.
|
|
761
1068
|
*/
|
|
1069
|
+
getLendingRedemptionOrdersV3(params) {
|
|
1070
|
+
return this.getPrivate('api/v3/redeem/orders', params);
|
|
1071
|
+
}
|
|
762
1072
|
/**
|
|
763
|
-
* Subscribe to Earn Fixed Income Products
|
|
764
1073
|
*
|
|
765
|
-
*
|
|
766
|
-
*
|
|
1074
|
+
* REST - MARGIN TRADING - Risk Limit
|
|
1075
|
+
*
|
|
767
1076
|
*/
|
|
768
|
-
|
|
769
|
-
|
|
1077
|
+
/**
|
|
1078
|
+
* Get Margin Risk Limit
|
|
1079
|
+
*
|
|
1080
|
+
* Request via this endpoint to get the Configure and Risk limit info of the margin.
|
|
1081
|
+
*/
|
|
1082
|
+
getMarginRiskLimitConfig(params) {
|
|
1083
|
+
return this.getPrivate('api/v3/margin/currencies', params);
|
|
770
1084
|
}
|
|
771
1085
|
/**
|
|
772
|
-
* Initiate redemption by holding ID
|
|
773
1086
|
*
|
|
774
|
-
*
|
|
1087
|
+
* REST - COPY TRADING
|
|
1088
|
+
*
|
|
775
1089
|
*/
|
|
776
|
-
|
|
777
|
-
|
|
1090
|
+
/**
|
|
1091
|
+
*
|
|
1092
|
+
* REST - EARN
|
|
1093
|
+
*
|
|
1094
|
+
*/
|
|
1095
|
+
/**
|
|
1096
|
+
/**
|
|
1097
|
+
* Earn Purchase
|
|
1098
|
+
*
|
|
1099
|
+
* This endpoint allows subscribing earn product
|
|
1100
|
+
*/
|
|
1101
|
+
subscribeEarnFixedIncome(params) {
|
|
1102
|
+
return this.postPrivate('api/v1/earn/orders', params);
|
|
778
1103
|
}
|
|
779
1104
|
/**
|
|
780
|
-
* Get Earn Redeem Preview
|
|
1105
|
+
* Get Earn Redeem Preview
|
|
781
1106
|
*
|
|
782
1107
|
* This endpoint retrieves redemption preview information by holding ID. If the current holding is fully redeemed or in the process of being redeemed, it indicates that the holding does not exist.
|
|
783
1108
|
*/
|
|
@@ -785,10 +1110,13 @@ export class SpotClient extends BaseRestClient {
|
|
|
785
1110
|
return this.getPrivate('api/v1/earn/redeem-preview', params);
|
|
786
1111
|
}
|
|
787
1112
|
/**
|
|
1113
|
+
* Earn Redeem
|
|
788
1114
|
*
|
|
789
|
-
*
|
|
790
|
-
*
|
|
1115
|
+
* This endpoint allows initiating redemption by holding ID. If the current holding is fully redeemed or in the process of being redeemed, it indicates that the holding does not exist.
|
|
791
1116
|
*/
|
|
1117
|
+
submitRedemption(params) {
|
|
1118
|
+
return this.deletePrivate('api/v1/earn/orders', params);
|
|
1119
|
+
}
|
|
792
1120
|
/**
|
|
793
1121
|
* Get Earn Savings Products
|
|
794
1122
|
*
|
|
@@ -797,14 +1125,6 @@ export class SpotClient extends BaseRestClient {
|
|
|
797
1125
|
getEarnSavingsProducts(params) {
|
|
798
1126
|
return this.getPrivate('api/v1/earn/saving/products', params);
|
|
799
1127
|
}
|
|
800
|
-
/**
|
|
801
|
-
* Get Earn Fixed Income Current Holdings
|
|
802
|
-
*
|
|
803
|
-
* This endpoint retrieves current holding assets of fixed income products. If no current holding assets are available, an empty list is returned.
|
|
804
|
-
*/
|
|
805
|
-
getEarnFixedIncomeHoldAssets(params) {
|
|
806
|
-
return this.getPrivate('api/v1/earn/hold-assets', params);
|
|
807
|
-
}
|
|
808
1128
|
/**
|
|
809
1129
|
* Get Earn Limited-Time Promotion Products
|
|
810
1130
|
*
|
|
@@ -814,10 +1134,21 @@ export class SpotClient extends BaseRestClient {
|
|
|
814
1134
|
return this.getPrivate('api/v1/earn/promotion/products', params);
|
|
815
1135
|
}
|
|
816
1136
|
/**
|
|
1137
|
+
* Get Earn Account Holdings
|
|
817
1138
|
*
|
|
818
|
-
*
|
|
1139
|
+
* This endpoint retrieves current holding assets of fixed income products. If no current holding assets are available, an empty list is returned.
|
|
1140
|
+
*/
|
|
1141
|
+
getEarnFixedIncomeHoldAssets(params) {
|
|
1142
|
+
return this.getPrivate('api/v1/earn/hold-assets', params);
|
|
1143
|
+
}
|
|
1144
|
+
/**
|
|
1145
|
+
* Get Earn Staking Products
|
|
819
1146
|
*
|
|
1147
|
+
* This endpoint retrieves staking products. If no staking products are available, an empty list is returned.
|
|
820
1148
|
*/
|
|
1149
|
+
getEarnStakingProducts(params) {
|
|
1150
|
+
return this.getPrivate('api/v1/earn/staking/products', params);
|
|
1151
|
+
}
|
|
821
1152
|
/**
|
|
822
1153
|
* Get Earn KCS Staking Products
|
|
823
1154
|
*
|
|
@@ -827,14 +1158,6 @@ export class SpotClient extends BaseRestClient {
|
|
|
827
1158
|
getEarnKcsStakingProducts(params) {
|
|
828
1159
|
return this.getPrivate('api/v1/earn/kcs-staking/products', params);
|
|
829
1160
|
}
|
|
830
|
-
/**
|
|
831
|
-
* Get Earn Staking Products
|
|
832
|
-
*
|
|
833
|
-
* This endpoint retrieves staking products. If no staking products are available, an empty list is returned.
|
|
834
|
-
*/
|
|
835
|
-
getEarnStakingProducts(params) {
|
|
836
|
-
return this.getPrivate('api/v1/earn/staking/products', params);
|
|
837
|
-
}
|
|
838
1161
|
/**
|
|
839
1162
|
* Get Earn ETH Staking Products
|
|
840
1163
|
*
|
|
@@ -847,20 +1170,22 @@ export class SpotClient extends BaseRestClient {
|
|
|
847
1170
|
/**
|
|
848
1171
|
*
|
|
849
1172
|
* REST - VIP LENDING
|
|
1173
|
+
*
|
|
850
1174
|
*/
|
|
851
1175
|
/**
|
|
852
|
-
* Get
|
|
1176
|
+
* Get Account Detail - VIP Lending
|
|
853
1177
|
*
|
|
1178
|
+
* The following information is only applicable to loans.
|
|
1179
|
+
* Get information on off-exchange funding and loans.
|
|
854
1180
|
* This endpoint is only for querying accounts that are currently involved in loans.
|
|
855
|
-
*
|
|
856
1181
|
*/
|
|
857
1182
|
getOtcLoan() {
|
|
858
1183
|
return this.getPrivate('api/v1/otc-loan/loan');
|
|
859
1184
|
}
|
|
860
1185
|
/**
|
|
861
|
-
* Get
|
|
1186
|
+
* Get Accounts - VIP Lending
|
|
862
1187
|
*
|
|
863
|
-
* This
|
|
1188
|
+
* Accounts participating in OTC lending, This interface is only for querying accounts currently running OTC lending.
|
|
864
1189
|
*/
|
|
865
1190
|
getOtcLoanAccounts() {
|
|
866
1191
|
return this.getPrivate('api/v1/otc-loan/accounts');
|
|
@@ -874,13 +1199,15 @@ export class SpotClient extends BaseRestClient {
|
|
|
874
1199
|
* Get Affiliate User Rebate Information
|
|
875
1200
|
*
|
|
876
1201
|
* This endpoint allows getting affiliate user rebate information.
|
|
877
|
-
*
|
|
878
|
-
* @param params - The parameters for the request
|
|
879
|
-
* @returns A promise that resolves to the affiliate user rebate information
|
|
880
1202
|
*/
|
|
881
1203
|
getAffiliateUserRebateInfo(params) {
|
|
882
1204
|
return this.getPrivate('api/v2/affiliate/inviter/statistics', params);
|
|
883
1205
|
}
|
|
1206
|
+
/**
|
|
1207
|
+
*
|
|
1208
|
+
* REST - BROKER
|
|
1209
|
+
*
|
|
1210
|
+
*/
|
|
884
1211
|
/**
|
|
885
1212
|
* Get download link for broker rebate orders
|
|
886
1213
|
*
|
|
@@ -900,5 +1227,240 @@ export class SpotClient extends BaseRestClient {
|
|
|
900
1227
|
getPrivateWSConnectionToken() {
|
|
901
1228
|
return this.postPrivate('api/v1/bullet-private');
|
|
902
1229
|
}
|
|
1230
|
+
/**
|
|
1231
|
+
*
|
|
1232
|
+
* DEPRECATED
|
|
1233
|
+
*
|
|
1234
|
+
*/
|
|
1235
|
+
/**
|
|
1236
|
+
*
|
|
1237
|
+
* REST - ACCOUNT - Sub-Account
|
|
1238
|
+
* DEPRECATED
|
|
1239
|
+
*/
|
|
1240
|
+
/**
|
|
1241
|
+
* @deprecated This method is deprecated.
|
|
1242
|
+
* It is recommended to use the getSubAccountsV2() endpoint instead of this endpoint
|
|
1243
|
+
*/
|
|
1244
|
+
getSubAccountsV1() {
|
|
1245
|
+
return this.getPrivate('api/v1/sub/user');
|
|
1246
|
+
}
|
|
1247
|
+
/**
|
|
1248
|
+
* @deprecated This method is deprecated.
|
|
1249
|
+
* It is recommended to use the getSubAccountsV2() endpoint instead of this endpoint
|
|
1250
|
+
*/
|
|
1251
|
+
getSubAccountBalancesV1() {
|
|
1252
|
+
return this.getPrivate('api/v1/sub-accounts');
|
|
1253
|
+
}
|
|
1254
|
+
/**
|
|
1255
|
+
*
|
|
1256
|
+
* REST - FUNDING - Funding overview
|
|
1257
|
+
* DEPRECATED
|
|
1258
|
+
*/
|
|
1259
|
+
/**
|
|
1260
|
+
* @deprecated This method is deprecated.
|
|
1261
|
+
* It is recommended to use the getMarginBalance() endpoint instead of this endpoint
|
|
1262
|
+
*/
|
|
1263
|
+
getMarginBalances() {
|
|
1264
|
+
return this.getPrivate('api/v1/margin/account');
|
|
1265
|
+
}
|
|
1266
|
+
/**
|
|
1267
|
+
*
|
|
1268
|
+
* REST - FUNDING -Deposit
|
|
1269
|
+
* DEPRECATED
|
|
1270
|
+
*/
|
|
1271
|
+
/**
|
|
1272
|
+
* @deprecated This method is deprecated. Please use createDepositAddressV3() instead.
|
|
1273
|
+
*/
|
|
1274
|
+
createDepositAddress(params) {
|
|
1275
|
+
return this.postPrivate('api/v1/deposit-addresses', params);
|
|
1276
|
+
}
|
|
1277
|
+
/**
|
|
1278
|
+
* @deprecated This method is deprecated. Please use getDepositAddressesV3() instead.
|
|
1279
|
+
*/
|
|
1280
|
+
getDepositAddressesV2(params) {
|
|
1281
|
+
return this.getPrivate('api/v2/deposit-addresses', params);
|
|
1282
|
+
}
|
|
1283
|
+
/**
|
|
1284
|
+
* @deprecated This method is deprecated. Please use getDepositAddressesV3() instead.
|
|
1285
|
+
*/
|
|
1286
|
+
getDepositAddressV1(params) {
|
|
1287
|
+
return this.getPrivate('api/v1/deposit-addresses', params);
|
|
1288
|
+
}
|
|
1289
|
+
/**
|
|
1290
|
+
* @deprecated This method is deprecated.
|
|
1291
|
+
* It is recommended to use the getDeposits() endpoint instead of this endpoint
|
|
1292
|
+
*/
|
|
1293
|
+
getHistoricalDepositsV1(params) {
|
|
1294
|
+
return this.getPrivate('api/v1/hist-deposits', params);
|
|
1295
|
+
}
|
|
1296
|
+
/**
|
|
1297
|
+
*
|
|
1298
|
+
* REST - FUNDING -Withdrawals
|
|
1299
|
+
* DEPRECATED
|
|
1300
|
+
*/
|
|
1301
|
+
/**
|
|
1302
|
+
* @deprecated This method is deprecated.
|
|
1303
|
+
* It is recommended to use the getWithdrawals() endpoint instead of this endpoint
|
|
1304
|
+
*/
|
|
1305
|
+
getHistoricalWithdrawalsV1(params) {
|
|
1306
|
+
return this.getPrivate('api/v1/hist-withdrawals', params);
|
|
1307
|
+
}
|
|
1308
|
+
/**
|
|
1309
|
+
* @deprecated This method is deprecated. Please use submitWithdrawV3() instead.
|
|
1310
|
+
*/
|
|
1311
|
+
submitWithdraw(params) {
|
|
1312
|
+
return this.postPrivate('api/v1/withdrawals', params);
|
|
1313
|
+
}
|
|
1314
|
+
/**
|
|
1315
|
+
*
|
|
1316
|
+
* REST - FUNDING - Transfer
|
|
1317
|
+
* DEPRECATED
|
|
1318
|
+
*/
|
|
1319
|
+
/**
|
|
1320
|
+
* @deprecated This method is deprecated.
|
|
1321
|
+
* It is recommended to use the submitFlexTransfer() endpoint instead of this endpoint
|
|
1322
|
+
*/
|
|
1323
|
+
submitTransferMasterSub(params) {
|
|
1324
|
+
return this.postPrivate('api/v2/accounts/sub-transfer', params);
|
|
1325
|
+
}
|
|
1326
|
+
/**
|
|
1327
|
+
* @deprecated This method is deprecated.
|
|
1328
|
+
* It is recommended to use the submitFlexTransfer() endpoint instead of this endpoint
|
|
1329
|
+
*/
|
|
1330
|
+
submitInnerTransfer(params) {
|
|
1331
|
+
return this.postPrivate('api/v2/accounts/inner-transfer', params);
|
|
1332
|
+
}
|
|
1333
|
+
/**
|
|
1334
|
+
*
|
|
1335
|
+
* REST - SPOT TRADING - Orders
|
|
1336
|
+
* DEPRECATED
|
|
1337
|
+
*/
|
|
1338
|
+
/**
|
|
1339
|
+
* @deprecated This method is deprecated.
|
|
1340
|
+
* It is recommended to use the HF trading endpoints instead of this endpoint
|
|
1341
|
+
*/
|
|
1342
|
+
submitOrder(params) {
|
|
1343
|
+
return this.postPrivate('api/v1/orders', params);
|
|
1344
|
+
}
|
|
1345
|
+
/**
|
|
1346
|
+
* @deprecated This method is deprecated.
|
|
1347
|
+
* It is recommended to use the HF trading endpoints instead of this endpoint
|
|
1348
|
+
*/
|
|
1349
|
+
submitOrderTest() {
|
|
1350
|
+
return this.postPrivate('api/v1/orders/test');
|
|
1351
|
+
}
|
|
1352
|
+
/**
|
|
1353
|
+
* @deprecated This method is deprecated.
|
|
1354
|
+
* It is recommended to use the HF trading endpoints instead of this endpoint
|
|
1355
|
+
*/
|
|
1356
|
+
submitMultipleOrders(params) {
|
|
1357
|
+
return this.postPrivate('api/v1/orders/multi', params);
|
|
1358
|
+
}
|
|
1359
|
+
/**
|
|
1360
|
+
* @deprecated This method is deprecated.
|
|
1361
|
+
* It is recommended to use the HF trading endpoints instead of this endpoint
|
|
1362
|
+
*/
|
|
1363
|
+
cancelOrderById(params) {
|
|
1364
|
+
return this.deletePrivate(`api/v1/orders/${params.orderId}`);
|
|
1365
|
+
}
|
|
1366
|
+
/**
|
|
1367
|
+
* @deprecated This method is deprecated.
|
|
1368
|
+
* It is recommended to use the HF trading endpoints instead of this endpoint
|
|
1369
|
+
*/
|
|
1370
|
+
cancelOrderByClientOid(params) {
|
|
1371
|
+
return this.deletePrivate(`api/v1/order/client-order/${params.clientOid}`);
|
|
1372
|
+
}
|
|
1373
|
+
/**
|
|
1374
|
+
* @deprecated This method is deprecated.
|
|
1375
|
+
* It is recommended to use the HF trading endpoints instead of this endpoint
|
|
1376
|
+
*/
|
|
1377
|
+
cancelAllOrders(params) {
|
|
1378
|
+
return this.deletePrivate('api/v1/orders', params);
|
|
1379
|
+
}
|
|
1380
|
+
/**
|
|
1381
|
+
* @deprecated This method is deprecated.
|
|
1382
|
+
* It is recommended to use the HF trading endpoints instead of this endpoint
|
|
1383
|
+
*/
|
|
1384
|
+
getOrders(params) {
|
|
1385
|
+
return this.getPrivate('api/v1/orders', params);
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* @deprecated This method is deprecated.
|
|
1389
|
+
* It is recommended to use the HF trading endpoints instead of this endpoint
|
|
1390
|
+
*/
|
|
1391
|
+
getRecentOrders(params) {
|
|
1392
|
+
return this.getPrivate('api/v1/limit/orders', params);
|
|
1393
|
+
}
|
|
1394
|
+
/**
|
|
1395
|
+
* @deprecated This method is deprecated.
|
|
1396
|
+
* It is recommended to use the HF trading endpoints instead of this endpoint
|
|
1397
|
+
*/
|
|
1398
|
+
getOrderByOrderId(params) {
|
|
1399
|
+
return this.getPrivate(`api/v1/orders/${params.orderId}`);
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* @deprecated This method is deprecated.
|
|
1403
|
+
* It is recommended to use the HF trading endpoints instead of this endpoint
|
|
1404
|
+
*/
|
|
1405
|
+
getOrderByClientOid(params) {
|
|
1406
|
+
return this.getPrivate(`api/v1/order/client-order/${params.clientOid}`);
|
|
1407
|
+
}
|
|
1408
|
+
/**
|
|
1409
|
+
*
|
|
1410
|
+
* REST - SPOT TRADING -Fills
|
|
1411
|
+
* DEPRECATED
|
|
1412
|
+
*/
|
|
1413
|
+
/**
|
|
1414
|
+
* @deprecated This method is deprecated.
|
|
1415
|
+
* It is recommended to use the HF trading endpoints instead of this endpoint
|
|
1416
|
+
*/
|
|
1417
|
+
getFills(params) {
|
|
1418
|
+
return this.getPrivate('api/v1/fills', params);
|
|
1419
|
+
}
|
|
1420
|
+
/**
|
|
1421
|
+
* @deprecated This method is deprecated.
|
|
1422
|
+
* It is recommended to use the HF trading endpoints instead of this endpoint
|
|
1423
|
+
*/
|
|
1424
|
+
getRecentFills() {
|
|
1425
|
+
return this.getPrivate('api/v1/limit/fills');
|
|
1426
|
+
}
|
|
1427
|
+
/**
|
|
1428
|
+
*
|
|
1429
|
+
* REST - MARGIN TRADING - Orders
|
|
1430
|
+
* DEPRECATED
|
|
1431
|
+
*/
|
|
1432
|
+
/**
|
|
1433
|
+
* @deprecated This method is deprecated.
|
|
1434
|
+
* It is recommended to use the submitHFMarginOrder() endpoint instead of this endpoint
|
|
1435
|
+
*/
|
|
1436
|
+
submitMarginOrder(params) {
|
|
1437
|
+
return this.postPrivate('api/v1/margin/order', params);
|
|
1438
|
+
}
|
|
1439
|
+
/**
|
|
1440
|
+
* @deprecated This method is deprecated.
|
|
1441
|
+
* It is recommended to use the submitHFMarginOrderTest() endpoint instead of this endpoint
|
|
1442
|
+
*/
|
|
1443
|
+
submitMarginOrderTest() {
|
|
1444
|
+
return this.postPrivate('api/v1/margin/order/test');
|
|
1445
|
+
}
|
|
1446
|
+
/**
|
|
1447
|
+
*
|
|
1448
|
+
* REST - MARGIN TRADING - Isolated Margin
|
|
1449
|
+
* DEPRECATED
|
|
1450
|
+
*/
|
|
1451
|
+
/**
|
|
1452
|
+
* @deprecated This method is deprecated.
|
|
1453
|
+
* It is recommended to use the getMarginBalance() endpoint instead of this endpoint
|
|
1454
|
+
*/
|
|
1455
|
+
getIsolatedMarginAccounts(params) {
|
|
1456
|
+
return this.getPrivate('api/v1/isolated/accounts', params);
|
|
1457
|
+
}
|
|
1458
|
+
/**
|
|
1459
|
+
* @deprecated This method is deprecated.
|
|
1460
|
+
* It is recommended to use the getIsolatedMarginBalance() endpoint instead of this endpoint
|
|
1461
|
+
*/
|
|
1462
|
+
getIsolatedMarginAccount(params) {
|
|
1463
|
+
return this.getPrivate(`api/v1/isolated/account/${params.symbol}`);
|
|
1464
|
+
}
|
|
903
1465
|
}
|
|
904
1466
|
//# sourceMappingURL=SpotClient.js.map
|