okx-api 1.4.0 → 1.4.1

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.
@@ -36,6 +36,190 @@ class RestClient extends BaseRestClient_1.default {
36
36
  return timestamp;
37
37
  });
38
38
  }
39
+ /**
40
+ *
41
+ * Trading account endpoints
42
+ *
43
+ */
44
+ getAccountInstruments(params) {
45
+ return this.getPrivate('/api/v5/account/instruments', params);
46
+ }
47
+ getBalance(ccy) {
48
+ return this.getPrivate('/api/v5/account/balance', { ccy });
49
+ }
50
+ getPositions(params) {
51
+ return this.getPrivate('/api/v5/account/positions', params);
52
+ }
53
+ getPositionsHistory(params) {
54
+ return this.getPrivate('/api/v5/account/positions-history', params);
55
+ }
56
+ getAccountPositionRisk(instType) {
57
+ return this.getPrivate('/api/v5/account/account-position-risk', {
58
+ instType,
59
+ });
60
+ }
61
+ /** Up to last 7 days */
62
+ getBills(params) {
63
+ return this.getPrivate('/api/v5/account/bills', params);
64
+ }
65
+ /** Last 3 months */
66
+ getBillsArchive(params) {
67
+ return this.getPrivate('/api/v5/account/bills-archive', params);
68
+ }
69
+ getAccountConfiguration() {
70
+ return this.getPrivate('/api/v5/account/config');
71
+ }
72
+ setPositionMode(posMode) {
73
+ return this.postPrivate('/api/v5/account/set-position-mode', { posMode });
74
+ }
75
+ setLeverage(params) {
76
+ return this.postPrivate('/api/v5/account/set-leverage', params);
77
+ }
78
+ /** Max buy/sell amount or open amount */
79
+ getMaxBuySellAmount(params) {
80
+ return this.getPrivate('/api/v5/account/max-size', params);
81
+ }
82
+ getMaxAvailableTradableAmount(params) {
83
+ return this.getPrivate('/api/v5/account/max-avail-size', params);
84
+ }
85
+ changePositionMargin(params) {
86
+ return this.postPrivate('/api/v5/account/position/margin-balance', params);
87
+ }
88
+ getLeverage(instId, mgnMode) {
89
+ return this.getPrivate('/api/v5/account/leverage-info', {
90
+ instId,
91
+ mgnMode,
92
+ });
93
+ }
94
+ getLeverageEstimatedInfo(params) {
95
+ return this.getPrivate('/api/v5/account/adjust-leverage-info', params);
96
+ }
97
+ getMaxLoan(instId, mgnMode, mgnCcy) {
98
+ return this.getPrivate('/api/v5/account/max-loan', {
99
+ instId,
100
+ mgnMode,
101
+ mgnCcy,
102
+ });
103
+ }
104
+ getFeeRates(instType, instId, uly) {
105
+ return this.getPrivate('/api/v5/account/trade-fee', {
106
+ instType,
107
+ instId,
108
+ uly,
109
+ });
110
+ }
111
+ getInterestAccrued(params) {
112
+ return this.getPrivate('/api/v5/account/interest-accrued', params);
113
+ }
114
+ getInterestRate(ccy) {
115
+ return this.getPrivate('/api/v5/account/interest-rate', { ccy });
116
+ }
117
+ setGreeksDisplayType(greeksType) {
118
+ return this.postPrivate('/api/v5/account/set-greeks', { greeksType });
119
+ }
120
+ setIsolatedMode(isoMode, type) {
121
+ return this.postPrivate('/api/v5/account/set-isolated-mode', {
122
+ isoMode,
123
+ type,
124
+ });
125
+ }
126
+ getMaxWithdrawals(ccy) {
127
+ return this.getPrivate('/api/v5/account/max-withdrawal', { ccy });
128
+ }
129
+ getAccountRiskState() {
130
+ return this.getPrivate('/api/v5/account/risk-state');
131
+ }
132
+ submitQuickMarginBorrowRepay(params) {
133
+ return this.postPrivate('/api/v5/account/quick-margin-borrow-repay', params);
134
+ }
135
+ getQuickMarginBorrowRepayHistory(params) {
136
+ return this.getPrivate('/api/v5/account/quick-margin-borrow-repay-history', params);
137
+ }
138
+ borrowRepayVIPLoan(ccy, side, amt, ordId) {
139
+ return this.postPrivate('/api/v5/account/borrow-repay', {
140
+ ccy,
141
+ side,
142
+ amt,
143
+ ordId,
144
+ });
145
+ }
146
+ getVIPLoanBorrowRepayHistory(params) {
147
+ return this.getPrivate('/api/v5/account/borrow-repay-history', params);
148
+ }
149
+ getVIPInterestAccrued(params) {
150
+ return this.getPrivate('/api/v5/account/vip-interest-accrued', params);
151
+ }
152
+ getVIPInterestDeducted(params) {
153
+ return this.getPrivate('/api/v5/account/vip-interest-deducted', params);
154
+ }
155
+ getVIPLoanOrders(params) {
156
+ return this.getPrivate('/api/v5/account/vip-loan-order-list', params);
157
+ }
158
+ getVIPLoanOrder(params) {
159
+ return this.getPrivate('/api/v5/account/vip-loan-order-detail', params);
160
+ }
161
+ getBorrowInterestLimits(params) {
162
+ return this.getPrivate('/api/v5/account/interest-limits', params);
163
+ }
164
+ getFixedLoanBorrowLimit() {
165
+ return this.getPrivate('/api/v5/account/fixed-loan/borrowing-limit');
166
+ }
167
+ getFixedLoanBorrowQuote(params) {
168
+ return this.getPrivate('/api/v5/account/fixed-loan/borrowing-quote', params);
169
+ }
170
+ submitFixedLoanBorrowOrder(params) {
171
+ return this.postPrivate('/api/v5/account/fixed-loan/borrowing-order', params);
172
+ }
173
+ updateFixedLoanBorrowOrder(params) {
174
+ return this.postPrivate('/api/v5/account/fixed-loan/amend-borrowing-order', params);
175
+ }
176
+ manualRenewFixedLoanBorrowOrder(params) {
177
+ return this.postPrivate('/api/v5/account/fixed-loan/manual-reborrow', params);
178
+ }
179
+ repayFixedLoanBorrowOrder(params) {
180
+ return this.postPrivate('/api/v5/account/fixed-loan/repay-borrowing-order', params);
181
+ }
182
+ getFixedLoanBorrowOrders(params) {
183
+ return this.getPrivate('/api/v5/account/fixed-loan/borrowing-orders-list', params);
184
+ }
185
+ positionBuilder(params) {
186
+ return this.postPrivate('/api/v5/account/position-builder', params);
187
+ }
188
+ updateRiskOffsetAmount(params) {
189
+ return this.postPrivate('/api/v5/account/set-riskOffset-amt', params);
190
+ }
191
+ getGreeks(ccy) {
192
+ return this.getPrivate('/api/v5/account/greeks', { ccy });
193
+ }
194
+ getPMLimitation(params) {
195
+ return this.getPrivate('/api/v5/account/position-tiers', params);
196
+ }
197
+ updateRiskOffsetType(params) {
198
+ return this.postPrivate('/api/v5/account/set-riskOffset-type', params);
199
+ }
200
+ activateOption() {
201
+ return this.postPrivate('/api/v5/account/activate-option');
202
+ }
203
+ setAutoLoan(params) {
204
+ return this.postPrivate('/api/v5/account/set-auto-loan', params);
205
+ }
206
+ setAccountMode(params) {
207
+ return this.postPrivate('/api/v5/account/set-account-level', params);
208
+ }
209
+ resetMMPStatus(params) {
210
+ return this.postPrivate('/api/v5/account/mmp-reset', params);
211
+ }
212
+ setMMPConfig(params) {
213
+ return this.postPrivate('/api/v5/account/mmp-config', params);
214
+ }
215
+ getMMPConfig(params) {
216
+ return this.getPrivate('/api/v5/account/mmp-config', params);
217
+ }
218
+ /**
219
+ *
220
+ * Orderbook trading - trade endpoints
221
+ *
222
+ */
39
223
  submitOrder(params) {
40
224
  return this.postPrivate('/api/v5/trade/order', params);
41
225
  }
@@ -93,36 +277,6 @@ class RestClient extends BaseRestClient_1.default {
93
277
  getTransactionDetailsArchiveLink(params) {
94
278
  return this.getPrivate('/api/v5/trade/fills-archive', params);
95
279
  }
96
- cancelMassOrder(params) {
97
- return this.postPrivate('/api/v5/trade/mass-cancel', params);
98
- }
99
- cancelAllAfter(params) {
100
- return this.postPrivate('/api/v5/trade/cancel-all-after', params);
101
- }
102
- getAccountRateLimit() {
103
- return this.getPrivate('/api/v5/trade/account-rate-limit');
104
- }
105
- placeAlgoOrder(params) {
106
- return this.postPrivate('/api/v5/trade/order-algo', params);
107
- }
108
- getAlgoOrderDetails(params) {
109
- return this.getPrivate('/api/v5/trade/order-algo', params);
110
- }
111
- amendAlgoOrder(params) {
112
- return this.postPrivate('/api/v5/trade/amend-algos', params);
113
- }
114
- cancelAlgoOrder(params) {
115
- return this.postPrivate('/api/v5/trade/cancel-algos', params);
116
- }
117
- cancelAdvanceAlgoOrder(params) {
118
- return this.postPrivate('/api/v5/trade/cancel-advance-algos', params);
119
- }
120
- getAlgoOrderList(params) {
121
- return this.getPrivate('/api/v5/trade/orders-algo-pending', params);
122
- }
123
- getAlgoOrderHistory(params) {
124
- return this.getPrivate('/api/v5/trade/orders-algo-history', params);
125
- }
126
280
  /** Get easy convert currency list */
127
281
  getEasyConvertCurrencies() {
128
282
  return this.getPrivate('/api/v5/trade/easy-convert-currency-list');
@@ -168,563 +322,590 @@ class RestClient extends BaseRestClient_1.default {
168
322
  getOneClickRepayHistory(params) {
169
323
  return this.getPrivate('/api/v5/trade/one-click-repay-history', params);
170
324
  }
325
+ cancelMassOrder(params) {
326
+ return this.postPrivate('/api/v5/trade/mass-cancel', params);
327
+ }
328
+ cancelAllAfter(params) {
329
+ return this.postPrivate('/api/v5/trade/cancel-all-after', params);
330
+ }
331
+ getAccountRateLimit() {
332
+ return this.getPrivate('/api/v5/trade/account-rate-limit');
333
+ }
171
334
  /**
172
335
  *
173
- * Block trading endpoints (private)
336
+ * Orderbook trading - Algo trading endpoints
174
337
  *
175
338
  */
176
- getBlockCounterParties() {
177
- return this.getPrivate('/api/v5/rfq/counterparties');
178
- }
179
- createBlockRFQ(params) {
180
- return this.postPrivate('/api/v5/rfq/create-rfq', params);
181
- }
182
- cancelBlockRFQ(params) {
183
- return this.postPrivate('/api/v5/rfq/cancel-rfq', params);
339
+ placeAlgoOrder(params) {
340
+ return this.postPrivate('/api/v5/trade/order-algo', params);
184
341
  }
185
- cancelMultipleBlockRFQs(params) {
186
- return this.postPrivate('/api/v5/rfq/cancel-batch-rfqs', params);
342
+ cancelAlgoOrder(params) {
343
+ return this.postPrivate('/api/v5/trade/cancel-algos', params);
187
344
  }
188
- cancelAllRFQs() {
189
- return this.postPrivate('/api/v5/rfq/cancel-all-rfqs');
345
+ amendAlgoOrder(params) {
346
+ return this.postPrivate('/api/v5/trade/amend-algos', params);
190
347
  }
191
- executeBlockQuote(params) {
192
- return this.postPrivate('/api/v5/rfq/execute-quote', params);
348
+ cancelAdvanceAlgoOrder(params) {
349
+ return this.postPrivate('/api/v5/trade/cancel-advance-algos', params);
193
350
  }
194
- getQuoteProducts() {
195
- return this.getPrivate('/api/v5/rfq/maker-instrument-settings');
351
+ getAlgoOrderDetails(params) {
352
+ return this.getPrivate('/api/v5/trade/order-algo', params);
196
353
  }
197
- updateBlockQuoteProducts(params) {
198
- return this.postPrivate('/api/v5/rfq/maker-instrument-settings', params);
354
+ getAlgoOrderList(params) {
355
+ return this.getPrivate('/api/v5/trade/orders-algo-pending', params);
199
356
  }
200
- resetBlockMmp() {
201
- return this.postPrivate('/api/v5/rfq/mmp-reset');
357
+ getAlgoOrderHistory(params) {
358
+ return this.getPrivate('/api/v5/trade/orders-algo-history', params);
202
359
  }
203
- updateBlockMmpConfig(params) {
204
- return this.postPrivate('/api/v5/rfq/mmp-config', params);
205
- }
206
- getBlockMmpConfig() {
207
- return this.getPrivate('/api/v5/rfq/mmp-config');
208
- }
209
- createBlockQuote(params) {
210
- return this.postPrivate('/api/v5/rfq/create-quote', params);
360
+ /**
361
+ *
362
+ * Orderbook trading - Grid trading endpoints
363
+ *
364
+ */
365
+ placeGridAlgoOrder(params) {
366
+ return this.postPrivate('/api/v5/tradingBot/grid/order-algo', params);
211
367
  }
212
- cancelBlockQuote(params) {
213
- return this.postPrivate('/api/v5/rfq/cancel-quote', params);
368
+ amendGridAlgoOrder(algoId, instId, triggerPx) {
369
+ return this.postPrivate('/api/v5/tradingBot/grid/amend-order-algo', Object.assign({ algoId,
370
+ instId }, triggerPx));
214
371
  }
215
- cancelMultipleBlockQuotes(params) {
216
- return this.postPrivate('/api/v5/rfq/cancel-batch-quotes', params);
372
+ stopGridAlgoOrder(orders) {
373
+ return this.postPrivate('/api/v5/tradingBot/grid/stop-order-algo', orders);
217
374
  }
218
- cancelAllBlockQuotes() {
219
- return this.postPrivate('/api/v5/rfq/cancel-all-quotes');
375
+ closeGridContractPosition(params) {
376
+ return this.postPrivate('/api/v5/tradingBot/grid/close-position', params);
220
377
  }
221
- cancelAllBlockAfter(params) {
222
- return this.postPrivate('/api/v5/rfq/cancel-all-after', params);
378
+ cancelGridContractCloseOrder(params) {
379
+ return this.postPrivate('/api/v5/tradingBot/grid/cancel-close-order', params);
223
380
  }
224
- getBlockRFQs(params) {
225
- return this.getPrivate('/api/v5/rfq/rfqs', params);
381
+ instantTriggerGridAlgoOrder(params) {
382
+ return this.postPrivate('/api/v5/tradingBot/grid/order-instant-trigger', params);
226
383
  }
227
- getBlockQuotes(params) {
228
- return this.getPrivate('/api/v5/rfq/quotes', params);
384
+ getGridAlgoOrderList(params) {
385
+ return this.getPrivate('/api/v5/tradingBot/grid/orders-algo-pending', params);
229
386
  }
230
- getBlockTrades(params) {
231
- return this.getPrivate('/api/v5/rfq/trades', params);
387
+ getGridAlgoOrderHistory(params) {
388
+ return this.getPrivate('/api/v5/tradingBot/grid/orders-algo-history', params);
232
389
  }
233
- getPublicRFQBlockTrades(params) {
234
- return this.get('/api/v5/rfq/public-trades', params);
390
+ getGridAlgoOrderDetails(algoOrdType, algoId) {
391
+ return this.getPrivate('/api/v5/tradingBot/grid/orders-algo-details', {
392
+ algoOrdType,
393
+ algoId,
394
+ });
235
395
  }
236
- getBlockPublicTrades(params) {
237
- return this.get('/api/v5/public/block-trades', params);
396
+ getGridAlgoSubOrders(algoOrdType, algoId, type, groupId, pagination) {
397
+ return this.getPrivate('/api/v5/tradingBot/grid/sub-orders', Object.assign({ algoOrdType,
398
+ algoId,
399
+ type,
400
+ groupId }, pagination));
238
401
  }
239
- /**
240
- *
241
- * Funding endpoints (private)
242
- *
243
- */
244
- getCurrencies(ccy) {
245
- return this.getPrivate('/api/v5/asset/currencies', { ccy });
402
+ /** Only contract grid supports this method */
403
+ getGridAlgoOrderPositions(algoOrdType, algoId) {
404
+ return this.getPrivate('/api/v5/tradingBot/grid/positions', {
405
+ algoOrdType,
406
+ algoId,
407
+ });
246
408
  }
247
- getBalances(ccy) {
248
- return this.getPrivate('/api/v5/asset/balances', { ccy });
409
+ spotGridWithdrawIncome(algoId) {
410
+ return this.postPrivate('/api/v5/tradingBot/grid/withdraw-income', {
411
+ algoId,
412
+ });
249
413
  }
250
- getNonTradableAssets(params) {
251
- return this.getPrivate('/api/v5/asset/non-tradable-assets', params);
414
+ computeGridMarginBalance(algoId, type, amt) {
415
+ return this.postPrivate('/api/v5/tradingBot/grid/compute-margin-balance', {
416
+ algoId,
417
+ type,
418
+ amt,
419
+ });
252
420
  }
253
- getAccountAssetValuation(ccy) {
254
- return this.getPrivate('/api/v5/asset/asset-valuation', { ccy });
421
+ adjustGridMarginBalance(algoId, type, change) {
422
+ return this.postPrivate('/api/v5/tradingBot/grid/margin-balance', Object.assign({ algoId,
423
+ type }, change));
255
424
  }
256
- fundsTransfer(params) {
257
- return this.postPrivate('/api/v5/asset/transfer', params);
425
+ adjustGridInvestment(params) {
426
+ return this.postPrivate('/api/v5/tradingBot/grid/adjust-investment', params);
258
427
  }
259
- /** Either parameter transId or clientId is required. */
260
- getFundsTransferState(params) {
261
- return this.getPrivate('/api/v5/asset/transfer-state', params);
428
+ getGridAIParameter(algoOrdType, instId, direction, duration) {
429
+ return this.get('/api/v5/tradingBot/grid/ai-param', {
430
+ algoOrdType,
431
+ instId,
432
+ direction,
433
+ duration,
434
+ });
262
435
  }
263
- getAssetBillsDetails(params) {
264
- return this.getPrivate('/api/v5/asset/bills', params);
436
+ computeGridMinInvestment(params) {
437
+ return this.post('/api/v5/tradingBot/grid/min-investment', params);
265
438
  }
266
- getLightningDeposits(ccy, amt, to) {
267
- return this.getPrivate('/api/v5/asset/deposit-lightning', { ccy, amt, to });
439
+ getRSIBackTesting(params) {
440
+ return this.get('/api/v5/tradingBot/public/rsi-back-testing', params);
268
441
  }
269
- getDepositAddress(ccy) {
270
- return this.getPrivate('/api/v5/asset/deposit-address', { ccy });
442
+ /**
443
+ *
444
+ * Orderbook trading - Signal bot trading endpoints
445
+ *
446
+ */
447
+ createSignal(params) {
448
+ return this.postPrivate('/api/v5/tradingBot/signal/create-signal', params);
271
449
  }
272
- getDepositHistory(params) {
273
- return this.getPrivate('/api/v5/asset/deposit-history', params);
450
+ getSignals(params) {
451
+ return this.getPrivate('/api/v5/tradingBot/signal/signals', params);
274
452
  }
275
- submitWithdraw(params) {
276
- return this.postPrivate('/api/v5/asset/withdrawal', params);
453
+ createSignalBot(params) {
454
+ return this.postPrivate('/api/v5/tradingBot/signal/order-algo', params);
277
455
  }
278
- submitWithdrawLightning(ccy, invoice, memo) {
279
- return this.postPrivate('/api/v5/asset/withdrawal-lightning', {
280
- ccy,
281
- invoice,
282
- memo,
283
- });
456
+ cancelSignalBots(params) {
457
+ return this.postPrivate('/api/v5/tradingBot/signal/stop-order-algo', params);
284
458
  }
285
- cancelWithdrawal(wdId) {
286
- return this.postPrivate('/api/v5/asset/cancel-withdrawal', { wdId });
459
+ updateSignalMargin(params) {
460
+ return this.postPrivate('/api/v5/tradingBot/signal/margin-balance', params);
287
461
  }
288
- getWithdrawalHistory(params) {
289
- return this.getPrivate('/api/v5/asset/withdrawal-history', params);
462
+ updateSignalTPSL(params) {
463
+ return this.postPrivate('/api/v5/tradingBot/signal/amendTPSL', params);
290
464
  }
291
- getDepositWithdrawStatus(params) {
292
- return this.getPrivate('/api/v5/asset/deposit-withdraw-status', params);
465
+ setSignalInstruments(params) {
466
+ return this.postPrivate('/api/v5/tradingBot/signal/set-instruments', params);
293
467
  }
294
- smallAssetsConvert(ccy) {
295
- return this.postPrivate('/api/v5/asset/convert-dust-assets', { ccy });
468
+ getSignalBotOrder(params) {
469
+ return this.getPrivate('/api/v5/tradingBot/signal/orders-algo-details', params);
296
470
  }
297
- getExchanges() {
298
- return this.get('/api/v5/asset/exchange-list');
471
+ getActiveSignalBot(params) {
472
+ return this.getPrivate('/api/v5/tradingBot/signal/orders-algo-details', params);
299
473
  }
300
- applyForMonthlyStatement(params) {
301
- return this.postPrivate('/api/v5/asset/monthly-statement', params);
474
+ getSignalBotHistory(params) {
475
+ return this.getPrivate('/api/v5/tradingBot/signal/orders-algo-history', params);
302
476
  }
303
- getMonthlyStatement(params) {
304
- return this.getPrivate('/api/v5/asset/monthly-statement', params);
477
+ getSignalBotPositions(params) {
478
+ return this.getPrivate('/api/v5/tradingBot/signal/positions', params);
305
479
  }
306
- getSavingBalance(ccy) {
307
- return this.getPrivate('/api/v5/finance/savings/balance', { ccy });
480
+ getSignalBotPositionHistory(params) {
481
+ return this.getPrivate('/api/v5/tradingBot/signal/positions-history', params);
308
482
  }
309
- savingsPurchaseRedemption(ccy, amt, side, rate) {
310
- return this.postPrivate('/api/v5/finance/savings/purchase-redempt', {
311
- ccy,
312
- amt,
313
- side,
314
- rate,
315
- });
483
+ closeSignalBotPosition(params) {
484
+ return this.postPrivate('/api/v5/tradingBot/signal/close-position', params);
316
485
  }
317
- setLendingRate(ccy, rate) {
318
- return this.postPrivate('/api/v5/finance/savings/set-lending-rate', {
319
- ccy,
320
- rate,
321
- });
486
+ placeSignalBotSubOrder(params) {
487
+ return this.postPrivate('/api/v5/tradingBot/signal/sub-order', params);
322
488
  }
323
- getLendingHistory(params) {
324
- return this.getPrivate('/api/v5/finance/savings/lending-history', params);
489
+ cancelSubOrder(params) {
490
+ return this.postPrivate('/api/v5/tradingBot/signal/cancel-sub-order', params);
325
491
  }
326
- getPublicBorrowInfo(ccy) {
327
- return this.get('/api/v5/finance/savings/lending-rate-summary', { ccy });
492
+ getSignalBotSubOrders(params) {
493
+ return this.getPrivate('/api/v5/tradingBot/signal/sub-orders', params);
328
494
  }
329
- getPublicBorrowHistory(params) {
330
- return this.get('/api/v5/finance/savings/lending-rate-history', params);
495
+ getSignalBotEventHistory(params) {
496
+ return this.getPrivate('/api/v5/tradingBot/signal/event-history', params);
331
497
  }
332
498
  /**
333
499
  *
334
- * Convert endpoints (private)
500
+ * Orderbook trading - Recurring buy endpoints
335
501
  *
336
502
  */
337
- getConvertCurrencies() {
338
- return this.getPrivate('/api/v5/asset/convert/currencies');
503
+ submitRecurringBuyOrder(params) {
504
+ return this.postPrivate('/api/v5/tradingBot/recurring/order-algo', params);
339
505
  }
340
- getConvertCurrencyPair(fromCcy, toCcy) {
341
- return this.getPrivate('/api/v5/asset/convert/currency-pair', {
342
- fromCcy,
343
- toCcy,
344
- });
506
+ amendRecurringBuyOrder(params) {
507
+ return this.postPrivate('/api/v5/tradingBot/recurring/amend-order-algo', params);
345
508
  }
346
- estimateConvertQuote(params) {
347
- return this.postPrivate('/api/v5/asset/convert/estimate-quote', params);
509
+ stopRecurringBuyOrder(params) {
510
+ return this.postPrivate('/api/v5/tradingBot/recurring/stop-order-algo', params);
348
511
  }
349
- convertTrade(params) {
350
- return this.postPrivate('/api/v5/asset/convert/trade', params);
512
+ getRecurringBuyOrders(params) {
513
+ return this.getPrivate('/api/v5/tradingBot/recurring/orders-algo-pending', params);
351
514
  }
352
- getConvertHistory(params) {
353
- return this.getPrivate('/api/v5/asset/convert/history', params);
515
+ getRecurringBuyOrderHistory(params) {
516
+ return this.getPrivate('/api/v5/tradingBot/recurring/orders-algo-history', params);
517
+ }
518
+ getRecurringBuyOrderDetails(params) {
519
+ return this.getPrivate('/api/v5/tradingBot/recurring/orders-algo-details', params);
520
+ }
521
+ getRecurringBuySubOrders(params) {
522
+ return this.getPrivate('/api/v5/tradingBot/recurring/sub-orders', params);
354
523
  }
355
524
  /**
356
525
  *
357
- * Account endpoints (private)
526
+ * Orderbook trading - Copy trading endpoints
358
527
  *
359
528
  */
360
- getAccountInstruments(params) {
361
- return this.getPrivate('/api/v5/account/instruments', params);
529
+ getCopytradingSubpositions(params) {
530
+ return this.getPrivate('/api/v5/copytrading/current-subpositions', params);
362
531
  }
363
- getBalance(ccy) {
364
- return this.getPrivate('/api/v5/account/balance', { ccy });
532
+ getCopytradingSubpositionsHistory(params) {
533
+ return this.getPrivate('/api/v5/copytrading/subpositions-history', params);
365
534
  }
366
- getPositions(params) {
367
- return this.getPrivate('/api/v5/account/positions', params);
535
+ submitCopytradingAlgoOrder(params) {
536
+ return this.postPrivate('/api/v5/copytrading/algo-order', params);
368
537
  }
369
- getPositionsHistory(params) {
370
- return this.getPrivate('/api/v5/account/positions-history', params);
538
+ closeCopytradingSubposition(params) {
539
+ return this.postPrivate('/api/v5/copytrading/close-subposition', params);
371
540
  }
372
- getAccountPositionRisk(instType) {
373
- return this.getPrivate('/api/v5/account/account-position-risk', {
374
- instType,
375
- });
541
+ getCopytradingInstruments(params) {
542
+ return this.getPrivate('/api/v5/copytrading/instruments', params);
376
543
  }
377
- /** Up to last 7 days */
378
- getBills(params) {
379
- return this.getPrivate('/api/v5/account/bills', params);
544
+ setCopytradingInstruments(params) {
545
+ return this.postPrivate('/api/v5/copytrading/set-instruments', params);
380
546
  }
381
- /** Last 3 months */
382
- getBillsArchive(params) {
383
- return this.getPrivate('/api/v5/account/bills-archive', params);
547
+ getCopytradingProfitDetails(params) {
548
+ return this.getPrivate('/api/v5/copytrading/profit-sharing-details', params);
384
549
  }
385
- getAccountConfiguration() {
386
- return this.getPrivate('/api/v5/account/config');
550
+ getCopytradingTotalProfit(params) {
551
+ return this.getPrivate('/api/v5/copytrading/total-profit-sharing', params);
387
552
  }
388
- setPositionMode(posMode) {
389
- return this.postPrivate('/api/v5/account/set-position-mode', { posMode });
553
+ getCopytradingUnrealizedProfit(params) {
554
+ return this.getPrivate('/api/v5/copytrading/unrealized-profit-sharing-details', params);
390
555
  }
391
- setAccountMode(params) {
392
- return this.postPrivate('/api/v5/account/set-account-level', params);
556
+ getCopytradingTotalUnrealizedProfit(params) {
557
+ return this.getPrivate('/api/v5/copytrading/total-unrealized-profit-sharing', params);
393
558
  }
394
- setAutoLoan(params) {
395
- return this.postPrivate('/api/v5/account/set-auto-loan', params);
559
+ applyCopytradingLeadTrading(params) {
560
+ return this.postPrivate('/api/v5/copytrading/apply-lead-trading', params);
396
561
  }
397
- setLeverage(params) {
398
- return this.postPrivate('/api/v5/account/set-leverage', params);
562
+ stopCopytradingLeadTrading(params) {
563
+ return this.postPrivate('/api/v5/copytrading/stop-lead-trading', params);
399
564
  }
400
- /** Max buy/sell amount or open amount */
401
- getMaxBuySellAmount(params) {
402
- return this.getPrivate('/api/v5/account/max-size', params);
565
+ updateCopytradingProfitSharing(params) {
566
+ return this.postPrivate('/api/v5/copytrading/amend-profit-sharing-ratio', params);
403
567
  }
404
- getMaxAvailableTradableAmount(params) {
405
- return this.getPrivate('/api/v5/account/max-avail-size', params);
568
+ getCopytradingAccount() {
569
+ return this.getPrivate('/api/v5/copytrading/config');
406
570
  }
407
- changePositionMargin(params) {
408
- return this.postPrivate('/api/v5/account/position/margin-balance', params);
571
+ setCopytradingFirstCopy(params) {
572
+ return this.postPrivate('/api/v5/copytrading/first-copy-settings', params);
409
573
  }
410
- getLeverage(instId, mgnMode) {
411
- return this.getPrivate('/api/v5/account/leverage-info', {
412
- instId,
413
- mgnMode,
414
- });
574
+ updateCopytradingCopySettings(params) {
575
+ return this.postPrivate('/api/v5/copytrading/amend-copy-settings', params);
415
576
  }
416
- getLeverageEstimatedInfo(params) {
417
- return this.getPrivate('/api/v5/account/adjust-leverage-info', params);
577
+ stopCopytradingCopy(params) {
578
+ return this.postPrivate('/api/v5/copytrading/stop-copy-trading', params);
418
579
  }
419
- getMaxLoan(instId, mgnMode, mgnCcy) {
420
- return this.getPrivate('/api/v5/account/max-loan', {
421
- instId,
422
- mgnMode,
423
- mgnCcy,
424
- });
580
+ getCopytradingCopySettings(params) {
581
+ return this.getPrivate('/api/v5/copytrading/copy-settings', params);
425
582
  }
426
- getFeeRates(instType, instId, uly) {
427
- return this.getPrivate('/api/v5/account/trade-fee', {
428
- instType,
429
- instId,
430
- uly,
431
- });
583
+ getCopytradingBatchLeverageInfo(params) {
584
+ return this.getPrivate('/api/v5/copytrading/batch-leverage-info', params);
432
585
  }
433
- getInterestAccrued(params) {
434
- return this.getPrivate('/api/v5/account/interest-accrued', params);
586
+ setCopytradingBatchLeverage(params) {
587
+ return this.postPrivate('/api/v5/copytrading/batch-set-leverage', params);
435
588
  }
436
- getInterestRate(ccy) {
437
- return this.getPrivate('/api/v5/account/interest-rate', { ccy });
589
+ getCopytradingMyLeadTraders(params) {
590
+ return this.getPrivate('/api/v5/copytrading/current-lead-traders', params);
438
591
  }
439
- setGreeksDisplayType(greeksType) {
440
- return this.postPrivate('/api/v5/account/set-greeks', { greeksType });
592
+ getCopytradingLeadTradersHistory(params) {
593
+ return this.getPrivate('/api/v5/copytrading/lead-traders-history', params);
441
594
  }
442
- setIsolatedMode(isoMode, type) {
443
- return this.postPrivate('/api/v5/account/set-isolated-mode', {
444
- isoMode,
445
- type,
446
- });
595
+ getCopytradingConfig(params) {
596
+ return this.get('/api/v5/copytrading/public-config', params);
447
597
  }
448
- getMaxWithdrawals(ccy) {
449
- return this.getPrivate('/api/v5/account/max-withdrawal', { ccy });
598
+ getCopytradingLeadRanks(params) {
599
+ return this.get('/api/v5/copytrading/public-lead-traders', params);
450
600
  }
451
- getAccountRiskState() {
452
- return this.getPrivate('/api/v5/account/risk-state');
601
+ getCopytradingLeadWeeklyPnl(params) {
602
+ return this.get('/api/v5/copytrading/public-weekly-pnl', params);
453
603
  }
454
- submitQuickMarginBorrowRepay(params) {
455
- return this.postPrivate('/api/v5/account/quick-margin-borrow-repay', params);
604
+ getCopytradingLeadDailyPnl(params) {
605
+ return this.get('/api/v5/copytrading/public-pnl', params);
456
606
  }
457
- getQuickMarginBorrowRepayHistory(params) {
458
- return this.getPrivate('/api/v5/account/quick-margin-borrow-repay-history', params);
607
+ getCopytradingLeadStats(params) {
608
+ return this.get('/api/v5/copytrading/public-stats', params);
459
609
  }
460
- borrowRepayVIPLoan(ccy, side, amt, ordId) {
461
- return this.postPrivate('/api/v5/account/borrow-repay', {
462
- ccy,
463
- side,
464
- amt,
465
- ordId,
466
- });
610
+ getCopytradingLeadPreferences(params) {
611
+ return this.get('/api/v5/copytrading/public-preference-currency', params);
467
612
  }
468
- getVIPLoanBorrowRepayHistory(params) {
469
- return this.getPrivate('/api/v5/account/borrow-repay-history', params);
613
+ getCopytradingLeadOpenPositions(params) {
614
+ return this.get('/api/v5/copytrading/public-current-subpositions', params);
470
615
  }
471
- getVIPInterestAccrued(params) {
472
- return this.getPrivate('/api/v5/account/vip-interest-accrued', params);
616
+ getCopytradingLeadPositionHistory(params) {
617
+ return this.get('/api/v5/copytrading/public-subpositions-history', params);
473
618
  }
474
- getVIPInterestDeducted(params) {
475
- return this.getPrivate('/api/v5/account/vip-interest-deducted', params);
619
+ getCopyTraders(params) {
620
+ return this.get('/api/v5/copytrading/public-copy-traders', params);
476
621
  }
477
- getVIPLoanOrders(params) {
478
- return this.getPrivate('/api/v5/account/vip-loan-order-list', params);
622
+ getCopytradingLeadPrivateRanks(params) {
623
+ return this.getPrivate('/api/v5/copytrading/lead-traders', params);
479
624
  }
480
- getVIPLoanOrder(params) {
481
- return this.getPrivate('/api/v5/account/vip-loan-order-detail', params);
625
+ getCopytradingLeadPrivateWeeklyPnl(params) {
626
+ return this.getPrivate('/api/v5/copytrading/weekly-pnl', params);
482
627
  }
483
- getBorrowInterestLimits(params) {
484
- return this.getPrivate('/api/v5/account/interest-limits', params);
628
+ getCopytradingPLeadPrivateDailyPnl(params) {
629
+ return this.getPrivate('/api/v5/copytrading/pnl', params);
485
630
  }
486
- getFixedLoanBorrowLimit() {
487
- return this.getPrivate('/api/v5/account/fixed-loan/borrowing-limit');
631
+ geCopytradingLeadPrivateStats(params) {
632
+ return this.getPrivate('/api/v5/copytrading/stats', params);
488
633
  }
489
- getFixedLoanBorrowQuote(params) {
490
- return this.getPrivate('/api/v5/account/fixed-loan/borrowing-quote', params);
634
+ getCopytradingLeadPrivatePreferences(params) {
635
+ return this.getPrivate('/api/v5/copytrading/preference-currency', params);
491
636
  }
492
- submitFixedLoanBorrowOrder(params) {
493
- return this.postPrivate('/api/v5/account/fixed-loan/borrowing-order', params);
637
+ getCopytradingLeadPrivateOpenPositions(params) {
638
+ return this.getPrivate('/api/v5/copytrading/performance-current-subpositions', params);
494
639
  }
495
- updateFixedLoanBorrowOrder(params) {
496
- return this.postPrivate('/api/v5/account/fixed-loan/amend-borrowing-order', params);
640
+ getCopytradingLeadPrivatePositionHistory(params) {
641
+ return this.getPrivate('/api/v5/copytrading/performance-subpositions-history', params);
497
642
  }
498
- manualRenewFixedLoanBorrowOrder(params) {
499
- return this.postPrivate('/api/v5/account/fixed-loan/manual-reborrow', params);
643
+ getCopyTradersPrivate(params) {
644
+ return this.getPrivate('/api/v5/copytrading/copy-traders', params);
500
645
  }
501
- repayFixedLoanBorrowOrder(params) {
502
- return this.postPrivate('/api/v5/account/fixed-loan/repay-borrowing-order', params);
646
+ /**
647
+ *
648
+ * Orderbook trading - Market data endpoints
649
+ *
650
+ */
651
+ getTickers(instrumentType, uly) {
652
+ return this.get('/api/v5/market/tickers', {
653
+ instType: instrumentType,
654
+ uly,
655
+ });
503
656
  }
504
- getFixedLoanBorrowOrders(params) {
505
- return this.getPrivate('/api/v5/account/fixed-loan/borrowing-orders-list', params);
657
+ getTicker(instId) {
658
+ return this.get('/api/v5/market/ticker', {
659
+ instId,
660
+ });
506
661
  }
507
- positionBuilder(params) {
508
- return this.postPrivate('/api/v5/account/position-builder', params);
662
+ getOrderBook(instId, sz) {
663
+ return this.get('/api/v5/market/books', { instId, sz });
509
664
  }
510
- updateRiskOffsetAmount(params) {
511
- return this.postPrivate('/api/v5/account/set-riskOffset-amt', params);
665
+ getFullOrderBook(params) {
666
+ return this.get('/api/v5/market/books-full', params);
512
667
  }
513
- getGreeks(ccy) {
514
- return this.getPrivate('/api/v5/account/greeks', { ccy });
668
+ /**
669
+ * @deprecated this method's parameters will change to an object in the next release. Use getCandlesV2 instead.
670
+ *
671
+ * @param instId
672
+ * @param bar
673
+ * @param pagination
674
+ * @returns
675
+ */
676
+ getCandles(instId, bar = '1m', pagination) {
677
+ return this.get('/api/v5/market/candles', Object.assign({ instId,
678
+ bar }, pagination));
515
679
  }
516
- getPMLimitation(params) {
517
- return this.getPrivate('/api/v5/account/position-tiers', params);
680
+ getCandlesV2(params) {
681
+ return this.get('/api/v5/market/candles', params);
518
682
  }
519
- updateRiskOffsetType(params) {
520
- return this.postPrivate('/api/v5/account/set-riskOffset-type', params);
683
+ /**
684
+ * @deprecated this method's parameters will change to an object in the next release. Use getHistoricCandlesV2 instead.
685
+ *
686
+ * @param instId
687
+ * @param bar
688
+ * @param pagination
689
+ * @returns
690
+ */
691
+ getHistoricCandles(instId, bar = '1m', pagination) {
692
+ return this.get('/api/v5/market/history-candles', Object.assign({ instId,
693
+ bar }, pagination));
521
694
  }
522
- activateOption() {
523
- return this.postPrivate('/api/v5/account/activate-option');
695
+ getHistoricCandlesV2(params) {
696
+ return this.get('/api/v5/market/history-candles', params);
524
697
  }
525
- resetMMPStatus(params) {
526
- return this.postPrivate('/api/v5/account/mmp-reset', params);
698
+ getTrades(instId, limit) {
699
+ return this.get('/api/v5/market/trades', { instId, limit });
527
700
  }
528
- setMMPConfig(params) {
529
- return this.postPrivate('/api/v5/account/mmp-config', params);
701
+ getHistoricTrades(instId, pagination) {
702
+ return this.get('/api/v5/market/history-trades', Object.assign({ instId }, pagination));
530
703
  }
531
- getMMPConfig(params) {
532
- return this.getPrivate('/api/v5/account/mmp-config', params);
704
+ getOptionTradesByInstrument(params) {
705
+ return this.get('/api/v5/market/option/instrument-family-trades', params);
706
+ }
707
+ getOptionTrades(params) {
708
+ return this.get('/api/v5/public/option-trades', params);
709
+ }
710
+ get24hrTotalVolume() {
711
+ return this.get('/api/v5/market/platform-24-volume');
533
712
  }
534
713
  /**
535
714
  *
536
- * SubAccount endpoints (private)
715
+ * Block trading - REST endpoints
537
716
  *
538
717
  */
539
- /** View sub-account list */
540
- getSubAccountList(params) {
541
- return this.getPrivate('/api/v5/users/subaccount/list', params);
718
+ getBlockCounterParties() {
719
+ return this.getPrivate('/api/v5/rfq/counterparties');
542
720
  }
543
- /** Reset the APIKey of a sub-account */
544
- resetSubAccountAPIKey(subAcct, apiKey, options) {
545
- return this.postPrivate('/api/v5/users/subaccount/modify-apikey', Object.assign({ subAcct,
546
- apiKey }, options));
721
+ createBlockRFQ(params) {
722
+ return this.postPrivate('/api/v5/rfq/create-rfq', params);
547
723
  }
548
- /** Get sub-account trading balance */
549
- getSubAccountBalances(subAcct) {
550
- return this.getPrivate('/api/v5/account/subaccount/balances', { subAcct });
724
+ cancelBlockRFQ(params) {
725
+ return this.postPrivate('/api/v5/rfq/cancel-rfq', params);
551
726
  }
552
- /** Get sub-account funding balance */
553
- getSubAccountFundingBalances(subAcct, ccy) {
554
- return this.getPrivate('/api/v5/asset/subaccount/balances', {
555
- subAcct,
556
- ccy,
557
- });
727
+ cancelMultipleBlockRFQs(params) {
728
+ return this.postPrivate('/api/v5/rfq/cancel-batch-rfqs', params);
558
729
  }
559
- getSubAccountMaxWithdrawal(params) {
560
- return this.getPrivate('/api/v5/account/subaccount/max-withdrawal', params);
730
+ cancelAllRFQs() {
731
+ return this.postPrivate('/api/v5/rfq/cancel-all-rfqs');
561
732
  }
562
- /** History of sub-account transfer */
563
- getSubAccountTransferHistory(params) {
564
- return this.getPrivate('/api/v5/asset/subaccount/bills', params);
733
+ executeBlockQuote(params) {
734
+ return this.postPrivate('/api/v5/rfq/execute-quote', params);
565
735
  }
566
- getManagedSubAccountTransferHistory(params) {
567
- return this.getPrivate('/api/v5/asset/subaccount/managed-subaccount-bills', params);
736
+ getQuoteProducts() {
737
+ return this.getPrivate('/api/v5/rfq/maker-instrument-settings');
568
738
  }
569
- /** Master accounts manage the transfers between sub-accounts */
570
- transferSubAccountBalance(params) {
571
- return this.postPrivate('/api/v5/asset/subaccount/transfer', params);
739
+ updateBlockQuoteProducts(params) {
740
+ return this.postPrivate('/api/v5/rfq/maker-instrument-settings', params);
572
741
  }
573
- /** Set Permission Of Transfer Out */
574
- setSubAccountTransferOutPermission(subAcct, canTransOut = true) {
575
- return this.postPrivate('/api/v5/users/subaccount/set-transfer-out', {
576
- subAcct,
577
- canTransOut,
578
- });
742
+ resetBlockMmp() {
743
+ return this.postPrivate('/api/v5/rfq/mmp-reset');
579
744
  }
580
- /** Get custody trading sub-account list */
581
- getSubAccountCustodyTradingList(subAcct) {
582
- return this.getPrivate('/api/v5/users/entrust-subaccount-list', {
583
- subAcct,
584
- });
745
+ updateBlockMmpConfig(params) {
746
+ return this.postPrivate('/api/v5/rfq/mmp-config', params);
585
747
  }
586
- setSubAccountLoanAllocation(params) {
587
- return this.postPrivate('/api/v5/account/subaccount/set-loan-allocation', params);
748
+ getBlockMmpConfig() {
749
+ return this.getPrivate('/api/v5/rfq/mmp-config');
588
750
  }
589
- getSubAccountBorrowInterestAndLimit(params) {
590
- return this.getPrivate('/api/v5/account/subaccount/interest-limits', params);
751
+ createBlockQuote(params) {
752
+ return this.postPrivate('/api/v5/rfq/create-quote', params);
753
+ }
754
+ cancelBlockQuote(params) {
755
+ return this.postPrivate('/api/v5/rfq/cancel-quote', params);
756
+ }
757
+ cancelMultipleBlockQuotes(params) {
758
+ return this.postPrivate('/api/v5/rfq/cancel-batch-quotes', params);
759
+ }
760
+ cancelAllBlockQuotes() {
761
+ return this.postPrivate('/api/v5/rfq/cancel-all-quotes');
762
+ }
763
+ cancelAllBlockAfter(params) {
764
+ return this.postPrivate('/api/v5/rfq/cancel-all-after', params);
765
+ }
766
+ getBlockRFQs(params) {
767
+ return this.getPrivate('/api/v5/rfq/rfqs', params);
768
+ }
769
+ getBlockQuotes(params) {
770
+ return this.getPrivate('/api/v5/rfq/quotes', params);
771
+ }
772
+ getBlockTrades(params) {
773
+ return this.getPrivate('/api/v5/rfq/trades', params);
774
+ }
775
+ getPublicRFQBlockTrades(params) {
776
+ return this.get('/api/v5/rfq/public-trades', params);
777
+ }
778
+ getBlockTickers(instType, uly) {
779
+ return this.get('/api/v5/market/block-tickers', { instType, uly });
780
+ }
781
+ getBlockTicker(instId) {
782
+ return this.get('/api/v5/market/block-ticker', { instId });
783
+ }
784
+ getBlockPublicTrades(params) {
785
+ return this.get('/api/v5/public/block-trades', params);
591
786
  }
592
787
  /**
593
788
  *
594
- * Grid trading endpoints (private)
789
+ * Spread trading - REST endpoints
595
790
  *
596
791
  */
597
- placeGridAlgoOrder(params) {
598
- return this.postPrivate('/api/v5/tradingBot/grid/order-algo', params);
599
- }
600
- amendGridAlgoOrder(algoId, instId, triggerPx) {
601
- return this.postPrivate('/api/v5/tradingBot/grid/amend-order-algo', Object.assign({ algoId,
602
- instId }, triggerPx));
603
- }
604
- stopGridAlgoOrder(orders) {
605
- return this.postPrivate('/api/v5/tradingBot/grid/stop-order-algo', orders);
792
+ submitSpreadOrder(params) {
793
+ return this.postPrivate('/api/v5/sprd/order', params);
606
794
  }
607
- closeGridContractPosition(params) {
608
- return this.postPrivate('/api/v5/tradingBot/grid/close-position', params);
795
+ cancelSpreadOrder(params) {
796
+ return this.postPrivate('/api/v5/sprd/cancel-order', params);
609
797
  }
610
- cancelGridContractCloseOrder(params) {
611
- return this.postPrivate('/api/v5/tradingBot/grid/cancel-close-order', params);
798
+ cancelAllSpreadOrders(params) {
799
+ return this.postPrivate('/api/v5/sprd/mass-cancel', params);
612
800
  }
613
- instantTriggerGridAlgoOrder(params) {
614
- return this.postPrivate('/api/v5/tradingBot/grid/order-instant-trigger', params);
801
+ updateSpreadOrder(params) {
802
+ return this.postPrivate('/api/v5/sprd/amend-order', params);
615
803
  }
616
- getGridAlgoOrderList(params) {
617
- return this.getPrivate('/api/v5/tradingBot/grid/orders-algo-pending', params);
804
+ getSpreadOrder(params) {
805
+ return this.getPrivate('/api/v5/sprd/order', params);
618
806
  }
619
- getGridAlgoOrderHistory(params) {
620
- return this.getPrivate('/api/v5/tradingBot/grid/orders-algo-history', params);
807
+ getSpreadActiveOrders(params) {
808
+ return this.getPrivate('/api/v5/sprd/orders-pending', params);
621
809
  }
622
- getGridAlgoOrderDetails(algoOrdType, algoId) {
623
- return this.getPrivate('/api/v5/tradingBot/grid/orders-algo-details', {
624
- algoOrdType,
625
- algoId,
626
- });
810
+ getSpreadOrdersRecent(params) {
811
+ return this.getPrivate('/api/v5/sprd/orders-history', params);
627
812
  }
628
- getGridAlgoSubOrders(algoOrdType, algoId, type, groupId, pagination) {
629
- return this.getPrivate('/api/v5/tradingBot/grid/sub-orders', Object.assign({ algoOrdType,
630
- algoId,
631
- type,
632
- groupId }, pagination));
813
+ getSpreadOrdersArchive(params) {
814
+ return this.getPrivate('/api/v5/sprd/orders-history-archive', params);
633
815
  }
634
- /** Only contract grid supports this method */
635
- getGridAlgoOrderPositions(algoOrdType, algoId) {
636
- return this.getPrivate('/api/v5/tradingBot/grid/positions', {
637
- algoOrdType,
638
- algoId,
639
- });
816
+ getSpreadTrades(params) {
817
+ return this.getPrivate('/api/v5/sprd/trades', params);
640
818
  }
641
- spotGridWithdrawIncome(algoId) {
642
- return this.postPrivate('/api/v5/tradingBot/grid/withdraw-income', {
643
- algoId,
644
- });
819
+ getSpreads(params) {
820
+ return this.get('/api/v5/sprd/spreads', params);
645
821
  }
646
- computeGridMarginBalance(algoId, type, amt) {
647
- return this.postPrivate('/api/v5/tradingBot/grid/compute-margin-balance', {
648
- algoId,
649
- type,
650
- amt,
651
- });
822
+ getSpreadOrderBook(params) {
823
+ return this.get('/api/v5/sprd/books', params);
652
824
  }
653
- adjustGridMarginBalance(algoId, type, change) {
654
- return this.postPrivate('/api/v5/tradingBot/grid/margin-balance', Object.assign({ algoId,
655
- type }, change));
825
+ getSpreadTicker(params) {
826
+ return this.get('/api/v5/market/sprd-ticker', params);
656
827
  }
657
- adjustGridInvestment(params) {
658
- return this.postPrivate('/api/v5/tradingBot/grid/adjust-investment', params);
828
+ getSpreadPublicTrades(params) {
829
+ return this.get('/api/v5/sprd/public-trades', params);
659
830
  }
660
- getGridAIParameter(algoOrdType, instId, direction, duration) {
661
- return this.get('/api/v5/tradingBot/grid/ai-param', {
662
- algoOrdType,
663
- instId,
664
- direction,
665
- duration,
666
- });
831
+ getSpreadCandles(params) {
832
+ return this.get('/api/v5/market/sprd-candles', params);
667
833
  }
668
- computeGridMinInvestment(params) {
669
- return this.post('/api/v5/tradingBot/grid/min-investment', params);
834
+ getSpreadHistoryCandles(params) {
835
+ return this.get('/api/v5/market/sprd-history-candles', params);
670
836
  }
671
- getRSIBackTesting(params) {
672
- return this.get('/api/v5/tradingBot/public/rsi-back-testing', params);
837
+ cancelSpreadAllAfter(params) {
838
+ return this.postPrivate('/api/v5/sprd/cancel-all-after', params);
673
839
  }
674
840
  /**
675
841
  *
676
- * Market data endpoints (public)
842
+ * Public data - rest endpoints
677
843
  *
678
844
  */
679
- getTickers(instrumentType, uly) {
680
- return this.get('/api/v5/market/tickers', {
681
- instType: instrumentType,
845
+ getInstruments(instType, uly, instFamily, instId) {
846
+ return this.get('/api/v5/public/instruments', {
847
+ instType,
682
848
  uly,
683
- });
684
- }
685
- getTicker(instId) {
686
- return this.get('/api/v5/market/ticker', {
849
+ instFamily,
687
850
  instId,
688
851
  });
689
852
  }
690
- getIndexTickers(params) {
691
- return this.get('/api/v5/market/index-tickers', Object.assign({}, params));
853
+ getDeliveryExerciseHistory(params) {
854
+ return this.get('/api/v5/public/delivery-exercise-history', params);
692
855
  }
693
- getOrderBook(instId, sz) {
694
- return this.get('/api/v5/market/books', { instId, sz });
856
+ getOpenInterest(params) {
857
+ return this.get('/api/v5/public/open-interest', params);
695
858
  }
696
- getFullOrderBook(params) {
697
- return this.get('/api/v5/market/books-full', params);
859
+ getFundingRate(params) {
860
+ return this.get('/api/v5/public/funding-rate', params);
698
861
  }
699
- /**
700
- * @deprecated this method's parameters will change to an object in the next release. Use getCandlesV2 instead.
701
- *
702
- * @param instId
703
- * @param bar
704
- * @param pagination
705
- * @returns
706
- */
707
- getCandles(instId, bar = '1m', pagination) {
708
- return this.get('/api/v5/market/candles', Object.assign({ instId,
709
- bar }, pagination));
862
+ getFundingRateHistory(params) {
863
+ return this.get('/api/v5/public/funding-rate-history', params);
710
864
  }
711
- getCandlesV2(params) {
712
- return this.get('/api/v5/market/candles', params);
865
+ getMinMaxLimitPrice(params) {
866
+ return this.get('/api/v5/public/price-limit', params);
713
867
  }
714
- /**
715
- * @deprecated this method's parameters will change to an object in the next release. Use getHistoricCandlesV2 instead.
716
- *
717
- * @param instId
718
- * @param bar
719
- * @param pagination
720
- * @returns
721
- */
722
- getHistoricCandles(instId, bar = '1m', pagination) {
723
- return this.get('/api/v5/market/history-candles', Object.assign({ instId,
724
- bar }, pagination));
868
+ getOptionMarketData(params) {
869
+ return this.get('/api/v5/public/opt-summary', params);
725
870
  }
726
- getHistoricCandlesV2(params) {
727
- return this.get('/api/v5/market/history-candles', params);
871
+ getEstimatedDeliveryExercisePrice(params) {
872
+ return this.get('/api/v5/public/estimated-price', params);
873
+ }
874
+ getDiscountRateAndInterestFreeQuota(params) {
875
+ return this.get('/api/v5/public/discount-rate-interest-free-quota', params);
876
+ }
877
+ getSystemTime(params) {
878
+ return this.get('/api/v5/public/time', params);
879
+ }
880
+ getMarkPrice(params) {
881
+ return this.get('/api/v5/public/mark-price', params);
882
+ }
883
+ getPositionTiers(params) {
884
+ return this.get('/api/v5/public/position-tiers', params);
885
+ }
886
+ getInterestRateAndLoanQuota(params) {
887
+ return this.get('/api/v5/public/interest-rate-loan-quota', params);
888
+ }
889
+ getVIPInterestRateAndLoanQuota(params) {
890
+ return this.get('/api/v5/public/vip-interest-rate-loan-quota', params);
891
+ }
892
+ getUnderlying(params) {
893
+ return this.get('/api/v5/public/underlying', params);
894
+ }
895
+ getInsuranceFund(params) {
896
+ return this.get('/api/v5/public/insurance-fund', params);
897
+ }
898
+ getUnitConvert(params) {
899
+ return this.get('/api/v5/public/convert-contract-coin', params);
900
+ }
901
+ getOptionTickBands(params) {
902
+ return this.get('/api/v5/public/instrument-tick-bands', params);
903
+ }
904
+ getPremiumHistory(params) {
905
+ return this.get('/api/v5/public/premium-history', params);
906
+ }
907
+ getIndexTickers(params) {
908
+ return this.get('/api/v5/market/index-tickers', Object.assign({}, params));
728
909
  }
729
910
  /**
730
911
  * @deprecated this method's parameters will change to an object in the next release. Use getIndexCandlesV2 instead.
@@ -786,23 +967,8 @@ class RestClient extends BaseRestClient_1.default {
786
967
  getHistoricMarkPriceCandlesV2(params) {
787
968
  return this.get('/api/v5/market/history-mark-price-candles', params);
788
969
  }
789
- getTrades(instId, limit) {
790
- return this.get('/api/v5/market/trades', { instId, limit });
791
- }
792
- getHistoricTrades(instId, pagination) {
793
- return this.get('/api/v5/market/history-trades', Object.assign({ instId }, pagination));
794
- }
795
- getOptionTradesByInstrument(params) {
796
- return this.get('/api/v5/market/option/instrument-family-trades', params);
797
- }
798
- getOptionTrades(params) {
799
- return this.get('/api/v5/public/option-trades', params);
800
- }
801
- get24hrTotalVolume() {
802
- return this.get('/api/v5/market/platform-24-volume');
803
- }
804
- getOracle() {
805
- return this.get('/api/v5/market/open-oracle');
970
+ getOracle() {
971
+ return this.get('/api/v5/market/open-oracle');
806
972
  }
807
973
  getExchangeRate() {
808
974
  return this.get('/api/v5/market/exchange-rate');
@@ -810,11 +976,8 @@ class RestClient extends BaseRestClient_1.default {
810
976
  getIndexComponents(index) {
811
977
  return this.get('/api/v5/market/index-components', { index });
812
978
  }
813
- getBlockTickers(instType, uly) {
814
- return this.get('/api/v5/market/block-tickers', { instType, uly });
815
- }
816
- getBlockTicker(instId) {
817
- return this.get('/api/v5/market/block-ticker', { instId });
979
+ getEconomicCalendar(params) {
980
+ return this.getPrivate('/api/v5/public/economic-calendar', params);
818
981
  }
819
982
  /**
820
983
  * @deprecated
@@ -823,81 +986,14 @@ class RestClient extends BaseRestClient_1.default {
823
986
  return this.get('/api/v5/market/block-trades', { instId });
824
987
  }
825
988
  /**
826
- *
827
- * Public data endpoints (public)
828
- *
989
+ * @deprecated
829
990
  */
830
- getInstruments(instType, uly, instFamily, instId) {
831
- return this.get('/api/v5/public/instruments', {
832
- instType,
833
- uly,
834
- instFamily,
835
- instId,
836
- });
837
- }
838
- getDeliveryExerciseHistory(params) {
839
- return this.get('/api/v5/public/delivery-exercise-history', params);
840
- }
841
- getOpenInterest(params) {
842
- return this.get('/api/v5/public/open-interest', params);
843
- }
844
- getFundingRate(params) {
845
- return this.get('/api/v5/public/funding-rate', params);
846
- }
847
- getFundingRateHistory(params) {
848
- return this.get('/api/v5/public/funding-rate-history', params);
849
- }
850
- getMinMaxLimitPrice(params) {
851
- return this.get('/api/v5/public/price-limit', params);
852
- }
853
- getOptionMarketData(params) {
854
- return this.get('/api/v5/public/opt-summary', params);
855
- }
856
- getEstimatedDeliveryExercisePrice(params) {
857
- return this.get('/api/v5/public/estimated-price', params);
858
- }
859
- getDiscountRateAndInterestFreeQuota(params) {
860
- return this.get('/api/v5/public/discount-rate-interest-free-quota', params);
861
- }
862
- getSystemTime(params) {
863
- return this.get('/api/v5/public/time', params);
864
- }
865
991
  getLiquidationOrders(params) {
866
992
  return this.get('/api/v5/public/liquidation-orders', params);
867
993
  }
868
- getMarkPrice(params) {
869
- return this.get('/api/v5/public/mark-price', params);
870
- }
871
- getPositionTiers(params) {
872
- return this.get('/api/v5/public/position-tiers', params);
873
- }
874
- getInterestRateAndLoanQuota(params) {
875
- return this.get('/api/v5/public/interest-rate-loan-quota', params);
876
- }
877
- getVIPInterestRateAndLoanQuota(params) {
878
- return this.get('/api/v5/public/vip-interest-rate-loan-quota', params);
879
- }
880
- getUnderlying(params) {
881
- return this.get('/api/v5/public/underlying', params);
882
- }
883
- getInsuranceFund(params) {
884
- return this.get('/api/v5/public/insurance-fund', params);
885
- }
886
- getUnitConvert(params) {
887
- return this.get('/api/v5/public/convert-contract-coin', params);
888
- }
889
- getOptionTickBands(params) {
890
- return this.get('/api/v5/public/instrument-tick-bands', params);
891
- }
892
- getPremiumHistory(params) {
893
- return this.get('/api/v5/public/premium-history', params);
894
- }
895
- getEconomicCalendar(params) {
896
- return this.getPrivate('/api/v5/public/economic-calendar', params);
897
- }
898
994
  /**
899
995
  *
900
- * Trading data endpoints (public)
996
+ * Trading statistics - REST endpoints
901
997
  *
902
998
  */
903
999
  getSupportCoin() {
@@ -947,7 +1043,150 @@ class RestClient extends BaseRestClient_1.default {
947
1043
  }
948
1044
  /**
949
1045
  *
950
- * FINANCIAL PRODUCT - On-chain earn endpoints
1046
+ * Funding account - REST endpoints
1047
+ *
1048
+ */
1049
+ getCurrencies(ccy) {
1050
+ return this.getPrivate('/api/v5/asset/currencies', { ccy });
1051
+ }
1052
+ getBalances(ccy) {
1053
+ return this.getPrivate('/api/v5/asset/balances', { ccy });
1054
+ }
1055
+ getNonTradableAssets(params) {
1056
+ return this.getPrivate('/api/v5/asset/non-tradable-assets', params);
1057
+ }
1058
+ getAccountAssetValuation(ccy) {
1059
+ return this.getPrivate('/api/v5/asset/asset-valuation', { ccy });
1060
+ }
1061
+ fundsTransfer(params) {
1062
+ return this.postPrivate('/api/v5/asset/transfer', params);
1063
+ }
1064
+ /** Either parameter transId or clientId is required. */
1065
+ getFundsTransferState(params) {
1066
+ return this.getPrivate('/api/v5/asset/transfer-state', params);
1067
+ }
1068
+ getAssetBillsDetails(params) {
1069
+ return this.getPrivate('/api/v5/asset/bills', params);
1070
+ }
1071
+ getLightningDeposits(ccy, amt, to) {
1072
+ return this.getPrivate('/api/v5/asset/deposit-lightning', { ccy, amt, to });
1073
+ }
1074
+ getDepositAddress(ccy) {
1075
+ return this.getPrivate('/api/v5/asset/deposit-address', { ccy });
1076
+ }
1077
+ getDepositHistory(params) {
1078
+ return this.getPrivate('/api/v5/asset/deposit-history', params);
1079
+ }
1080
+ submitWithdraw(params) {
1081
+ return this.postPrivate('/api/v5/asset/withdrawal', params);
1082
+ }
1083
+ submitWithdrawLightning(ccy, invoice, memo) {
1084
+ return this.postPrivate('/api/v5/asset/withdrawal-lightning', {
1085
+ ccy,
1086
+ invoice,
1087
+ memo,
1088
+ });
1089
+ }
1090
+ cancelWithdrawal(wdId) {
1091
+ return this.postPrivate('/api/v5/asset/cancel-withdrawal', { wdId });
1092
+ }
1093
+ getWithdrawalHistory(params) {
1094
+ return this.getPrivate('/api/v5/asset/withdrawal-history', params);
1095
+ }
1096
+ getDepositWithdrawStatus(params) {
1097
+ return this.getPrivate('/api/v5/asset/deposit-withdraw-status', params);
1098
+ }
1099
+ smallAssetsConvert(ccy) {
1100
+ return this.postPrivate('/api/v5/asset/convert-dust-assets', { ccy });
1101
+ }
1102
+ getExchanges() {
1103
+ return this.get('/api/v5/asset/exchange-list');
1104
+ }
1105
+ applyForMonthlyStatement(params) {
1106
+ return this.postPrivate('/api/v5/asset/monthly-statement', params);
1107
+ }
1108
+ getMonthlyStatement(params) {
1109
+ return this.getPrivate('/api/v5/asset/monthly-statement', params);
1110
+ }
1111
+ getConvertCurrencies() {
1112
+ return this.getPrivate('/api/v5/asset/convert/currencies');
1113
+ }
1114
+ getConvertCurrencyPair(fromCcy, toCcy) {
1115
+ return this.getPrivate('/api/v5/asset/convert/currency-pair', {
1116
+ fromCcy,
1117
+ toCcy,
1118
+ });
1119
+ }
1120
+ estimateConvertQuote(params) {
1121
+ return this.postPrivate('/api/v5/asset/convert/estimate-quote', params);
1122
+ }
1123
+ convertTrade(params) {
1124
+ return this.postPrivate('/api/v5/asset/convert/trade', params);
1125
+ }
1126
+ getConvertHistory(params) {
1127
+ return this.getPrivate('/api/v5/asset/convert/history', params);
1128
+ }
1129
+ /**
1130
+ *
1131
+ * Subaccount - REST endpoints
1132
+ *
1133
+ */
1134
+ /** View sub-account list */
1135
+ getSubAccountList(params) {
1136
+ return this.getPrivate('/api/v5/users/subaccount/list', params);
1137
+ }
1138
+ /** Reset the APIKey of a sub-account */
1139
+ resetSubAccountAPIKey(subAcct, apiKey, options) {
1140
+ return this.postPrivate('/api/v5/users/subaccount/modify-apikey', Object.assign({ subAcct,
1141
+ apiKey }, options));
1142
+ }
1143
+ /** Get sub-account trading balance */
1144
+ getSubAccountBalances(subAcct) {
1145
+ return this.getPrivate('/api/v5/account/subaccount/balances', { subAcct });
1146
+ }
1147
+ /** Get sub-account funding balance */
1148
+ getSubAccountFundingBalances(subAcct, ccy) {
1149
+ return this.getPrivate('/api/v5/asset/subaccount/balances', {
1150
+ subAcct,
1151
+ ccy,
1152
+ });
1153
+ }
1154
+ getSubAccountMaxWithdrawal(params) {
1155
+ return this.getPrivate('/api/v5/account/subaccount/max-withdrawal', params);
1156
+ }
1157
+ /** History of sub-account transfer */
1158
+ getSubAccountTransferHistory(params) {
1159
+ return this.getPrivate('/api/v5/asset/subaccount/bills', params);
1160
+ }
1161
+ getManagedSubAccountTransferHistory(params) {
1162
+ return this.getPrivate('/api/v5/asset/subaccount/managed-subaccount-bills', params);
1163
+ }
1164
+ /** Master accounts manage the transfers between sub-accounts */
1165
+ transferSubAccountBalance(params) {
1166
+ return this.postPrivate('/api/v5/asset/subaccount/transfer', params);
1167
+ }
1168
+ /** Set Permission Of Transfer Out */
1169
+ setSubAccountTransferOutPermission(subAcct, canTransOut = true) {
1170
+ return this.postPrivate('/api/v5/users/subaccount/set-transfer-out', {
1171
+ subAcct,
1172
+ canTransOut,
1173
+ });
1174
+ }
1175
+ /** Get custody trading sub-account list */
1176
+ getSubAccountCustodyTradingList(subAcct) {
1177
+ return this.getPrivate('/api/v5/users/entrust-subaccount-list', {
1178
+ subAcct,
1179
+ });
1180
+ }
1181
+ setSubAccountLoanAllocation(params) {
1182
+ return this.postPrivate('/api/v5/account/subaccount/set-loan-allocation', params);
1183
+ }
1184
+ getSubAccountBorrowInterestAndLimit(params) {
1185
+ return this.getPrivate('/api/v5/account/subaccount/interest-limits', params);
1186
+ }
1187
+ /**
1188
+ *
1189
+ * Financial product - on chain earn endpoints
951
1190
  *
952
1191
  */
953
1192
  /** Get earn offers */
@@ -987,7 +1226,7 @@ class RestClient extends BaseRestClient_1.default {
987
1226
  }
988
1227
  /**
989
1228
  *
990
- * FINANCIAL PRODUCT - ETH staking endpoints
1229
+ * Financial product - ETH staking endpoints
991
1230
  *
992
1231
  */
993
1232
  purchaseETHStaking(params) {
@@ -1007,286 +1246,60 @@ class RestClient extends BaseRestClient_1.default {
1007
1246
  }
1008
1247
  /**
1009
1248
  *
1010
- * Simple earn fixed endpoints
1249
+ * Financial product - simple earn flexible endpoints
1011
1250
  *
1012
1251
  */
1013
- getLendingOffers(params) {
1014
- return this.get('/api/v5/finance/fixed-loan/lending-offers', params);
1252
+ getSavingBalance(ccy) {
1253
+ return this.getPrivate('/api/v5/finance/savings/balance', { ccy });
1015
1254
  }
1016
- getLendingAPYHistory(params) {
1017
- return this.get('/api/v5/finance/fixed-loan/lending-apy-history', params);
1255
+ savingsPurchaseRedemption(ccy, amt, side, rate) {
1256
+ return this.postPrivate('/api/v5/finance/savings/purchase-redempt', {
1257
+ ccy,
1258
+ amt,
1259
+ side,
1260
+ rate,
1261
+ });
1018
1262
  }
1019
- getLendingVolume(params) {
1020
- return this.get('/api/v5/finance/fixed-loan/pending-lending-volume', params);
1263
+ setLendingRate(ccy, rate) {
1264
+ return this.postPrivate('/api/v5/finance/savings/set-lending-rate', {
1265
+ ccy,
1266
+ rate,
1267
+ });
1021
1268
  }
1022
- placeLendingOrder(params) {
1023
- return this.postPrivate('/api/v5/finance/fixed-loan/lending-order', params);
1269
+ getLendingHistory(params) {
1270
+ return this.getPrivate('/api/v5/finance/savings/lending-history', params);
1024
1271
  }
1025
- amendLendingOrder(params) {
1026
- return this.postPrivate('/api/v5/finance/fixed-loan/lending-order', params);
1027
- }
1028
- getLendingOrders(params) {
1029
- return this.getPrivate('/api/v5/finance/fixed-loan/lending-orders-list', params);
1030
- }
1031
- getLendingSubOrders(params) {
1032
- return this.getPrivate('/api/v5/finance/fixed-loan/lending-sub-orders', params);
1033
- }
1034
- /**
1035
- *
1036
- * Signal bot trading endpoints
1037
- *
1038
- */
1039
- createSignal(params) {
1040
- return this.postPrivate('/api/v5/tradingBot/signal/create-signal', params);
1041
- }
1042
- getSignals(params) {
1043
- return this.getPrivate('/api/v5/tradingBot/signal/signals', params);
1044
- }
1045
- createSignalBot(params) {
1046
- return this.postPrivate('/api/v5/tradingBot/signal/order-algo', params);
1047
- }
1048
- cancelSignalBots(params) {
1049
- return this.postPrivate('/api/v5/tradingBot/signal/stop-order-algo', params);
1050
- }
1051
- updateSignalMargin(params) {
1052
- return this.postPrivate('/api/v5/tradingBot/signal/margin-balance', params);
1053
- }
1054
- updateSignalTPSL(params) {
1055
- return this.postPrivate('/api/v5/tradingBot/signal/amendTPSL', params);
1056
- }
1057
- setSignalInstruments(params) {
1058
- return this.postPrivate('/api/v5/tradingBot/signal/set-instruments', params);
1059
- }
1060
- getSignalBotOrder(params) {
1061
- return this.getPrivate('/api/v5/tradingBot/signal/orders-algo-details', params);
1062
- }
1063
- getActiveSignalBot(params) {
1064
- return this.getPrivate('/api/v5/tradingBot/signal/orders-algo-details', params);
1065
- }
1066
- getSignalBotHistory(params) {
1067
- return this.getPrivate('/api/v5/tradingBot/signal/orders-algo-history', params);
1068
- }
1069
- getSignalBotPositions(params) {
1070
- return this.getPrivate('/api/v5/tradingBot/signal/positions', params);
1071
- }
1072
- getSignalBotPositionHistory(params) {
1073
- return this.getPrivate('/api/v5/tradingBot/signal/positions-history', params);
1074
- }
1075
- closeSignalBotPosition(params) {
1076
- return this.postPrivate('/api/v5/tradingBot/signal/close-position', params);
1077
- }
1078
- placeSignalBotSubOrder(params) {
1079
- return this.postPrivate('/api/v5/tradingBot/signal/sub-order', params);
1080
- }
1081
- cancelSubOrder(params) {
1082
- return this.postPrivate('/api/v5/tradingBot/signal/cancel-sub-order', params);
1083
- }
1084
- getSignalBotSubOrders(params) {
1085
- return this.getPrivate('/api/v5/tradingBot/signal/sub-orders', params);
1086
- }
1087
- getSignalBotEventHistory(params) {
1088
- return this.getPrivate('/api/v5/tradingBot/signal/event-history', params);
1089
- }
1090
- /**
1091
- *
1092
- * Recurring buy endpoints
1093
- *
1094
- */
1095
- submitRecurringBuyOrder(params) {
1096
- return this.postPrivate('/api/v5/tradingBot/recurring/order-algo', params);
1097
- }
1098
- amendRecurringBuyOrder(params) {
1099
- return this.postPrivate('/api/v5/tradingBot/recurring/amend-order-algo', params);
1100
- }
1101
- stopRecurringBuyOrder(params) {
1102
- return this.postPrivate('/api/v5/tradingBot/recurring/stop-order-algo', params);
1103
- }
1104
- getRecurringBuyOrders(params) {
1105
- return this.getPrivate('/api/v5/tradingBot/recurring/orders-algo-pending', params);
1106
- }
1107
- getRecurringBuyOrderHistory(params) {
1108
- return this.getPrivate('/api/v5/tradingBot/recurring/orders-algo-history', params);
1109
- }
1110
- getRecurringBuyOrderDetails(params) {
1111
- return this.getPrivate('/api/v5/tradingBot/recurring/orders-algo-details', params);
1112
- }
1113
- getRecurringBuySubOrders(params) {
1114
- return this.getPrivate('/api/v5/tradingBot/recurring/sub-orders', params);
1115
- }
1116
- /**
1117
- *
1118
- * Copy Trading endpoints
1119
- *
1120
- */
1121
- getCopytradingSubpositions(params) {
1122
- return this.getPrivate('/api/v5/copytrading/current-subpositions', params);
1123
- }
1124
- getCopytradingSubpositionsHistory(params) {
1125
- return this.getPrivate('/api/v5/copytrading/subpositions-history', params);
1126
- }
1127
- submitCopytradingAlgoOrder(params) {
1128
- return this.postPrivate('/api/v5/copytrading/algo-order', params);
1129
- }
1130
- closeCopytradingSubposition(params) {
1131
- return this.postPrivate('/api/v5/copytrading/close-subposition', params);
1132
- }
1133
- getCopytradingInstruments(params) {
1134
- return this.getPrivate('/api/v5/copytrading/instruments', params);
1135
- }
1136
- setCopytradingInstruments(params) {
1137
- return this.postPrivate('/api/v5/copytrading/set-instruments', params);
1138
- }
1139
- getCopytradingProfitDetails(params) {
1140
- return this.getPrivate('/api/v5/copytrading/profit-sharing-details', params);
1141
- }
1142
- getCopytradingTotalProfit(params) {
1143
- return this.getPrivate('/api/v5/copytrading/total-profit-sharing', params);
1144
- }
1145
- getCopytradingUnrealizedProfit(params) {
1146
- return this.getPrivate('/api/v5/copytrading/unrealized-profit-sharing-details', params);
1147
- }
1148
- getCopytradingTotalUnrealizedProfit(params) {
1149
- return this.getPrivate('/api/v5/copytrading/total-unrealized-profit-sharing', params);
1150
- }
1151
- applyCopytradingLeadTrading(params) {
1152
- return this.postPrivate('/api/v5/copytrading/apply-lead-trading', params);
1153
- }
1154
- stopCopytradingLeadTrading(params) {
1155
- return this.postPrivate('/api/v5/copytrading/stop-lead-trading', params);
1156
- }
1157
- updateCopytradingProfitSharing(params) {
1158
- return this.postPrivate('/api/v5/copytrading/amend-profit-sharing-ratio', params);
1159
- }
1160
- getCopytradingAccount() {
1161
- return this.getPrivate('/api/v5/copytrading/config');
1162
- }
1163
- setCopytradingFirstCopy(params) {
1164
- return this.postPrivate('/api/v5/copytrading/first-copy-settings', params);
1165
- }
1166
- updateCopytradingCopySettings(params) {
1167
- return this.postPrivate('/api/v5/copytrading/amend-copy-settings', params);
1168
- }
1169
- stopCopytradingCopy(params) {
1170
- return this.postPrivate('/api/v5/copytrading/stop-copy-trading', params);
1171
- }
1172
- getCopytradingCopySettings(params) {
1173
- return this.getPrivate('/api/v5/copytrading/copy-settings', params);
1174
- }
1175
- getCopytradingBatchLeverageInfo(params) {
1176
- return this.getPrivate('/api/v5/copytrading/batch-leverage-info', params);
1177
- }
1178
- setCopytradingBatchLeverage(params) {
1179
- return this.postPrivate('/api/v5/copytrading/batch-set-leverage', params);
1180
- }
1181
- getCopytradingMyLeadTraders(params) {
1182
- return this.getPrivate('/api/v5/copytrading/current-lead-traders', params);
1183
- }
1184
- getCopytradingLeadTradersHistory(params) {
1185
- return this.getPrivate('/api/v5/copytrading/lead-traders-history', params);
1186
- }
1187
- getCopytradingConfig(params) {
1188
- return this.get('/api/v5/copytrading/public-config', params);
1189
- }
1190
- getCopytradingLeadRanks(params) {
1191
- return this.get('/api/v5/copytrading/public-lead-traders', params);
1192
- }
1193
- getCopytradingLeadWeeklyPnl(params) {
1194
- return this.get('/api/v5/copytrading/public-weekly-pnl', params);
1195
- }
1196
- getCopytradingLeadDailyPnl(params) {
1197
- return this.get('/api/v5/copytrading/public-pnl', params);
1198
- }
1199
- getCopytradingLeadStats(params) {
1200
- return this.get('/api/v5/copytrading/public-stats', params);
1201
- }
1202
- getCopytradingLeadPreferences(params) {
1203
- return this.get('/api/v5/copytrading/public-preference-currency', params);
1204
- }
1205
- getCopytradingLeadOpenPositions(params) {
1206
- return this.get('/api/v5/copytrading/public-current-subpositions', params);
1207
- }
1208
- getCopytradingLeadPositionHistory(params) {
1209
- return this.get('/api/v5/copytrading/public-subpositions-history', params);
1210
- }
1211
- getCopyTraders(params) {
1212
- return this.get('/api/v5/copytrading/public-copy-traders', params);
1213
- }
1214
- getCopytradingLeadPrivateRanks(params) {
1215
- return this.getPrivate('/api/v5/copytrading/lead-traders', params);
1216
- }
1217
- getCopytradingLeadPrivateWeeklyPnl(params) {
1218
- return this.getPrivate('/api/v5/copytrading/weekly-pnl', params);
1219
- }
1220
- getCopytradingPLeadPrivateDailyPnl(params) {
1221
- return this.getPrivate('/api/v5/copytrading/pnl', params);
1222
- }
1223
- geCopytradingLeadPrivateStats(params) {
1224
- return this.getPrivate('/api/v5/copytrading/stats', params);
1225
- }
1226
- getCopytradingLeadPrivatePreferences(params) {
1227
- return this.getPrivate('/api/v5/copytrading/preference-currency', params);
1228
- }
1229
- getCopytradingLeadPrivateOpenPositions(params) {
1230
- return this.getPrivate('/api/v5/copytrading/performance-current-subpositions', params);
1231
- }
1232
- getCopytradingLeadPrivatePositionHistory(params) {
1233
- return this.getPrivate('/api/v5/copytrading/performance-subpositions-history', params);
1272
+ getPublicBorrowInfo(ccy) {
1273
+ return this.get('/api/v5/finance/savings/lending-rate-summary', { ccy });
1234
1274
  }
1235
- getCopyTradersPrivate(params) {
1236
- return this.getPrivate('/api/v5/copytrading/copy-traders', params);
1275
+ getPublicBorrowHistory(params) {
1276
+ return this.get('/api/v5/finance/savings/lending-rate-history', params);
1237
1277
  }
1238
1278
  /**
1239
1279
  *
1240
- * Spread trading endpoints
1280
+ * Financial product - simple earn fixed endpoints
1241
1281
  *
1242
1282
  */
1243
- submitSpreadOrder(params) {
1244
- return this.postPrivate('/api/v5/sprd/order', params);
1245
- }
1246
- cancelSpreadOrder(params) {
1247
- return this.postPrivate('/api/v5/sprd/cancel-order', params);
1248
- }
1249
- cancelAllSpreadOrders(params) {
1250
- return this.postPrivate('/api/v5/sprd/mass-cancel', params);
1251
- }
1252
- updateSpreadOrder(params) {
1253
- return this.postPrivate('/api/v5/sprd/amend-order', params);
1254
- }
1255
- getSpreadOrder(params) {
1256
- return this.getPrivate('/api/v5/sprd/order', params);
1257
- }
1258
- getSpreadActiveOrders(params) {
1259
- return this.getPrivate('/api/v5/sprd/orders-pending', params);
1260
- }
1261
- getSpreadOrdersRecent(params) {
1262
- return this.getPrivate('/api/v5/sprd/orders-history', params);
1263
- }
1264
- getSpreadOrdersArchive(params) {
1265
- return this.getPrivate('/api/v5/sprd/orders-history-archive', params);
1266
- }
1267
- getSpreadTrades(params) {
1268
- return this.getPrivate('/api/v5/sprd/trades', params);
1269
- }
1270
- getSpreads(params) {
1271
- return this.get('/api/v5/sprd/spreads', params);
1283
+ getLendingOffers(params) {
1284
+ return this.get('/api/v5/finance/fixed-loan/lending-offers', params);
1272
1285
  }
1273
- getSpreadOrderBook(params) {
1274
- return this.get('/api/v5/sprd/books', params);
1286
+ getLendingAPYHistory(params) {
1287
+ return this.get('/api/v5/finance/fixed-loan/lending-apy-history', params);
1275
1288
  }
1276
- getSpreadTicker(params) {
1277
- return this.get('/api/v5/market/sprd-ticker', params);
1289
+ getLendingVolume(params) {
1290
+ return this.get('/api/v5/finance/fixed-loan/pending-lending-volume', params);
1278
1291
  }
1279
- getSpreadPublicTrades(params) {
1280
- return this.get('/api/v5/sprd/public-trades', params);
1292
+ placeLendingOrder(params) {
1293
+ return this.postPrivate('/api/v5/finance/fixed-loan/lending-order', params);
1281
1294
  }
1282
- getSpreadCandles(params) {
1283
- return this.get('/api/v5/market/sprd-candles', params);
1295
+ amendLendingOrder(params) {
1296
+ return this.postPrivate('/api/v5/finance/fixed-loan/lending-order', params);
1284
1297
  }
1285
- getSpreadHistoryCandles(params) {
1286
- return this.get('/api/v5/market/sprd-history-candles', params);
1298
+ getLendingOrders(params) {
1299
+ return this.getPrivate('/api/v5/finance/fixed-loan/lending-orders-list', params);
1287
1300
  }
1288
- cancelSpreadAllAfter(params) {
1289
- return this.postPrivate('/api/v5/sprd/cancel-all-after', params);
1301
+ getLendingSubOrders(params) {
1302
+ return this.getPrivate('/api/v5/finance/fixed-loan/lending-sub-orders', params);
1290
1303
  }
1291
1304
  /**
1292
1305
  *