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