okx-api 1.5.8 → 2.0.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.
@@ -99,12 +99,8 @@ class RestClient extends BaseRestClient_1.default {
99
99
  getAccountInstruments(params) {
100
100
  return this.getPrivate('/api/v5/account/instruments', params);
101
101
  }
102
- /**
103
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
104
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
105
- */
106
- getBalance(ccy) {
107
- return this.getPrivate('/api/v5/account/balance', { ccy });
102
+ getBalance(params) {
103
+ return this.getPrivate('/api/v5/account/balance', params);
108
104
  }
109
105
  getPositions(params) {
110
106
  return this.getPrivate('/api/v5/account/positions', params);
@@ -112,14 +108,8 @@ class RestClient extends BaseRestClient_1.default {
112
108
  getPositionsHistory(params) {
113
109
  return this.getPrivate('/api/v5/account/positions-history', params);
114
110
  }
115
- /**
116
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
117
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
118
- */
119
- getAccountPositionRisk(instType) {
120
- return this.getPrivate('/api/v5/account/account-position-risk', {
121
- instType,
122
- });
111
+ getAccountPositionRisk(params = {}) {
112
+ return this.getPrivate('/api/v5/account/account-position-risk', params);
123
113
  }
124
114
  /** Up to last 7 days */
125
115
  getBills(params) {
@@ -150,12 +140,8 @@ class RestClient extends BaseRestClient_1.default {
150
140
  getAccountConfiguration() {
151
141
  return this.getPrivate('/api/v5/account/config');
152
142
  }
153
- /**
154
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
155
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
156
- */
157
- setPositionMode(posMode) {
158
- return this.postPrivate('/api/v5/account/set-position-mode', { posMode });
143
+ setPositionMode(params) {
144
+ return this.postPrivate('/api/v5/account/set-position-mode', params);
159
145
  }
160
146
  setLeverage(params) {
161
147
  return this.postPrivate('/api/v5/account/set-leverage', params);
@@ -170,15 +156,8 @@ class RestClient extends BaseRestClient_1.default {
170
156
  changePositionMargin(params) {
171
157
  return this.postPrivate('/api/v5/account/position/margin-balance', params);
172
158
  }
173
- /**
174
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
175
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
176
- */
177
- getLeverage(instId, mgnMode) {
178
- return this.getPrivate('/api/v5/account/leverage-info', {
179
- instId,
180
- mgnMode,
181
- });
159
+ getLeverage(params) {
160
+ return this.getPrivate('/api/v5/account/leverage-info', params);
182
161
  }
183
162
  getLeverageV2(params) {
184
163
  return this.getPrivate('/api/v5/account/leverage-info', params);
@@ -186,70 +165,26 @@ class RestClient extends BaseRestClient_1.default {
186
165
  getLeverageEstimatedInfo(params) {
187
166
  return this.getPrivate('/api/v5/account/adjust-leverage-info', params);
188
167
  }
189
- /**
190
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
191
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
192
- */
193
- getMaxLoan(instId, mgnMode, mgnCcy, ccy) {
194
- return this.getPrivate('/api/v5/account/max-loan', {
195
- instId,
196
- mgnMode,
197
- mgnCcy,
198
- ccy,
199
- });
200
- }
201
- getMaxLoanV2(params) {
168
+ getMaxLoan(params) {
202
169
  return this.getPrivate('/api/v5/account/max-loan', params);
203
170
  }
204
- /**
205
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
206
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
207
- */
208
- getFeeRates(instType, instId, uly, instFamily, ruleType) {
209
- return this.getPrivate('/api/v5/account/trade-fee', {
210
- instType,
211
- instId,
212
- uly,
213
- instFamily,
214
- ruleType,
215
- });
216
- }
217
- getFeeRatesV2(params) {
171
+ getFeeRates(params) {
218
172
  return this.getPrivate('/api/v5/account/trade-fee', params);
219
173
  }
220
174
  getInterestAccrued(params) {
221
175
  return this.getPrivate('/api/v5/account/interest-accrued', params);
222
176
  }
223
- /**
224
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
225
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
226
- */
227
- getInterestRate(ccy) {
228
- return this.getPrivate('/api/v5/account/interest-rate', { ccy });
177
+ getInterestRate(params) {
178
+ return this.getPrivate('/api/v5/account/interest-rate', params);
229
179
  }
230
- /**
231
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
232
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
233
- */
234
- setGreeksDisplayType(greeksType) {
235
- return this.postPrivate('/api/v5/account/set-greeks', { greeksType });
180
+ setGreeksDisplayType(params) {
181
+ return this.postPrivate('/api/v5/account/set-greeks', params);
236
182
  }
237
- /**
238
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
239
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
240
- */
241
- setIsolatedMode(isoMode, type) {
242
- return this.postPrivate('/api/v5/account/set-isolated-mode', {
243
- isoMode,
244
- type,
245
- });
183
+ setIsolatedMode(params) {
184
+ return this.postPrivate('/api/v5/account/set-isolated-mode', params);
246
185
  }
247
- /**
248
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
249
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
250
- */
251
- getMaxWithdrawals(ccy) {
252
- return this.getPrivate('/api/v5/account/max-withdrawal', { ccy });
186
+ getMaxWithdrawals(params) {
187
+ return this.getPrivate('/api/v5/account/max-withdrawal', params);
253
188
  }
254
189
  getAccountRiskState() {
255
190
  return this.getPrivate('/api/v5/account/risk-state');
@@ -260,17 +195,8 @@ class RestClient extends BaseRestClient_1.default {
260
195
  getQuickMarginBorrowRepayHistory(params) {
261
196
  return this.getPrivate('/api/v5/account/quick-margin-borrow-repay-history', params);
262
197
  }
263
- /**
264
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
265
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
266
- */
267
- borrowRepayVIPLoan(ccy, side, amt, ordId) {
268
- return this.postPrivate('/api/v5/account/borrow-repay', {
269
- ccy,
270
- side,
271
- amt,
272
- ordId,
273
- });
198
+ borrowRepayVIPLoan(params) {
199
+ return this.postPrivate('/api/v5/account/borrow-repay', params);
274
200
  }
275
201
  getVIPLoanBorrowRepayHistory(params) {
276
202
  return this.getPrivate('/api/v5/account/borrow-repay-history', params);
@@ -332,12 +258,8 @@ class RestClient extends BaseRestClient_1.default {
332
258
  updateRiskOffsetAmount(params) {
333
259
  return this.postPrivate('/api/v5/account/set-riskOffset-amt', params);
334
260
  }
335
- /**
336
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
337
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
338
- */
339
- getGreeks(ccy) {
340
- return this.getPrivate('/api/v5/account/greeks', { ccy });
261
+ getGreeks(params) {
262
+ return this.getPrivate('/api/v5/account/greeks', params);
341
263
  }
342
264
  getPMLimitation(params) {
343
265
  return this.getPrivate('/api/v5/account/position-tiers', params);
@@ -430,9 +352,6 @@ class RestClient extends BaseRestClient_1.default {
430
352
  return this.getPrivate('/api/v5/trade/easy-convert-currency-list', params);
431
353
  }
432
354
  /**
433
- *
434
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
435
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
436
355
  *
437
356
  * Place easy convert : Convert small currencies to mainstream currencies.
438
357
  * Only applicable to the crypto balance less than $10.
@@ -441,43 +360,28 @@ class RestClient extends BaseRestClient_1.default {
441
360
  * If there are multiple currencies, separate them with commas in the "from" field.
442
361
  *
443
362
  */
444
- submitEasyConvert(fromCcys, toCcy, source) {
445
- return this.postPrivate('/api/v5/trade/easy-convert', {
446
- fromCcy: fromCcys,
447
- toCcy,
448
- source,
449
- });
363
+ submitEasyConvert(params) {
364
+ return this.postPrivate('/api/v5/trade/easy-convert', params);
450
365
  }
451
366
  /** Get easy convert history : Get the history and status of easy convert trades. */
452
367
  getEasyConvertHistory(params) {
453
368
  return this.getPrivate('/api/v5/trade/easy-convert-history', params);
454
369
  }
455
370
  /**
456
- *
457
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
458
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
459
371
  *
460
372
  * Get one-click repay currency list : Get list of debt currency data and repay currencies.
461
373
  * Debt currencies include both cross and isolated debts.
462
374
  */
463
- getOneClickRepayCurrencyList(debtType) {
464
- return this.getPrivate('/api/v5/trade/one-click-repay-currency-list', {
465
- debtType,
466
- });
375
+ getOneClickRepayCurrencyList(params) {
376
+ return this.getPrivate('/api/v5/trade/one-click-repay-currency-list', params);
467
377
  }
468
378
  /**
469
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
470
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
471
- *
472
379
  * Trade one-click repay to repay cross debts.
473
380
  * Isolated debts are not applicable.
474
381
  * The maximum repayment amount is based on the remaining available balance of funding and trading accounts.
475
382
  */
476
- submitOneClickRepay(debtCcys, repayCcy) {
477
- return this.postPrivate('/api/v5/trade/one-click-repay', {
478
- debtCcy: debtCcys.join(','),
479
- repayCcy,
480
- });
383
+ submitOneClickRepay(params) {
384
+ return this.postPrivate('/api/v5/trade/one-click-repay', params);
481
385
  }
482
386
  /** Get the history and status of one-click repay trades. */
483
387
  getOneClickRepayHistory(params) {
@@ -529,13 +433,8 @@ class RestClient extends BaseRestClient_1.default {
529
433
  placeGridAlgoOrder(params) {
530
434
  return this.postPrivate('/api/v5/tradingBot/grid/order-algo', params);
531
435
  }
532
- /**
533
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
534
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
535
- */
536
- amendGridAlgoOrder(algoId, instId, triggerPx) {
537
- return this.postPrivate('/api/v5/tradingBot/grid/amend-order-algo', Object.assign({ algoId,
538
- instId }, triggerPx));
436
+ amendGridAlgoOrder(params) {
437
+ return this.postPrivate('/api/v5/tradingBot/grid/amend-order-algo', params);
539
438
  }
540
439
  stopGridAlgoOrder(orders) {
541
440
  return this.postPrivate('/api/v5/tradingBot/grid/stop-order-algo', orders);
@@ -555,78 +454,29 @@ class RestClient extends BaseRestClient_1.default {
555
454
  getGridAlgoOrderHistory(params) {
556
455
  return this.getPrivate('/api/v5/tradingBot/grid/orders-algo-history', params);
557
456
  }
558
- /**
559
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
560
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
561
- */
562
- getGridAlgoOrderDetails(algoOrdType, algoId) {
563
- return this.getPrivate('/api/v5/tradingBot/grid/orders-algo-details', {
564
- algoOrdType,
565
- algoId,
566
- });
457
+ getGridAlgoOrderDetails(params) {
458
+ return this.getPrivate('/api/v5/tradingBot/grid/orders-algo-details', params);
567
459
  }
568
- /**
569
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
570
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
571
- */
572
- getGridAlgoSubOrders(algoOrdType, algoId, type, groupId, pagination) {
573
- return this.getPrivate('/api/v5/tradingBot/grid/sub-orders', Object.assign({ algoOrdType,
574
- algoId,
575
- type,
576
- groupId }, pagination));
460
+ getGridAlgoSubOrders(params) {
461
+ return this.getPrivate('/api/v5/tradingBot/grid/sub-orders', params);
577
462
  }
578
- /**
579
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
580
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
581
- */
582
- getGridAlgoOrderPositions(algoOrdType, algoId) {
583
- return this.getPrivate('/api/v5/tradingBot/grid/positions', {
584
- algoOrdType,
585
- algoId,
586
- });
463
+ getGridAlgoOrderPositions(params) {
464
+ return this.getPrivate('/api/v5/tradingBot/grid/positions', params);
587
465
  }
588
- /**
589
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
590
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
591
- */
592
- spotGridWithdrawIncome(algoId) {
593
- return this.postPrivate('/api/v5/tradingBot/grid/withdraw-income', {
594
- algoId,
595
- });
466
+ spotGridWithdrawIncome(params) {
467
+ return this.postPrivate('/api/v5/tradingBot/grid/withdraw-income', params);
596
468
  }
597
- /**
598
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
599
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
600
- */
601
- computeGridMarginBalance(algoId, type, amt) {
602
- return this.postPrivate('/api/v5/tradingBot/grid/compute-margin-balance', {
603
- algoId,
604
- type,
605
- amt,
606
- });
469
+ computeGridMarginBalance(params) {
470
+ return this.postPrivate('/api/v5/tradingBot/grid/compute-margin-balance', params);
607
471
  }
608
- /**
609
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
610
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
611
- */
612
- adjustGridMarginBalance(algoId, type, change) {
613
- return this.postPrivate('/api/v5/tradingBot/grid/margin-balance', Object.assign({ algoId,
614
- type }, change));
472
+ adjustGridMarginBalance(params) {
473
+ return this.postPrivate('/api/v5/tradingBot/grid/margin-balance', params);
615
474
  }
616
475
  adjustGridInvestment(params) {
617
476
  return this.postPrivate('/api/v5/tradingBot/grid/adjust-investment', params);
618
477
  }
619
- /**
620
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
621
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
622
- */
623
- getGridAIParameter(algoOrdType, instId, direction, duration) {
624
- return this.get('/api/v5/tradingBot/grid/ai-param', {
625
- algoOrdType,
626
- instId,
627
- direction,
628
- duration,
629
- });
478
+ getGridAIParameter(params) {
479
+ return this.get('/api/v5/tradingBot/grid/ai-param', params);
630
480
  }
631
481
  computeGridMinInvestment(params) {
632
482
  return this.post('/api/v5/tradingBot/grid/min-investment', params);
@@ -846,70 +696,29 @@ class RestClient extends BaseRestClient_1.default {
846
696
  * Orderbook trading - Market data endpoints
847
697
  *
848
698
  */
849
- /**
850
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
851
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
852
- */
853
- getTickers(instrumentType, uly) {
854
- return this.get('/api/v5/market/tickers', {
855
- instType: instrumentType,
856
- uly,
857
- });
699
+ getTickers(params) {
700
+ return this.get('/api/v5/market/tickers', params);
858
701
  }
859
- /**
860
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
861
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
862
- */
863
- getTicker(instId) {
864
- return this.get('/api/v5/market/ticker', {
865
- instId,
866
- });
702
+ getTicker(params) {
703
+ return this.get('/api/v5/market/ticker', params);
867
704
  }
868
- /**
869
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
870
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
871
- */
872
- getOrderBook(instId, sz) {
873
- return this.get('/api/v5/market/books', { instId, sz });
705
+ getOrderBook(params) {
706
+ return this.get('/api/v5/market/books', params);
874
707
  }
875
708
  getFullOrderBook(params) {
876
709
  return this.get('/api/v5/market/books-full', params);
877
710
  }
878
- /**
879
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
880
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
881
- */
882
- getCandles(instId, bar = '1m', pagination) {
883
- return this.get('/api/v5/market/candles', Object.assign({ instId,
884
- bar }, pagination));
885
- }
886
- getCandlesV2(params) {
711
+ getCandles(params) {
887
712
  return this.get('/api/v5/market/candles', params);
888
713
  }
889
- /**
890
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
891
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
892
- */
893
- getHistoricCandles(instId, bar = '1m', pagination) {
894
- return this.get('/api/v5/market/history-candles', Object.assign({ instId,
895
- bar }, pagination));
896
- }
897
- getHistoricCandlesV2(params) {
714
+ getHistoricCandles(params) {
898
715
  return this.get('/api/v5/market/history-candles', params);
899
716
  }
900
- /**
901
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
902
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
903
- */
904
- getTrades(instId, limit) {
905
- return this.get('/api/v5/market/trades', { instId, limit });
717
+ getTrades(params) {
718
+ return this.get('/api/v5/market/trades', params);
906
719
  }
907
- /**
908
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
909
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
910
- */
911
- getHistoricTrades(instId, pagination) {
912
- return this.get('/api/v5/market/history-trades', Object.assign({ instId }, pagination));
720
+ getHistoricTrades(params) {
721
+ return this.get('/api/v5/market/history-trades', params);
913
722
  }
914
723
  getOptionTradesByInstrument(params) {
915
724
  return this.get('/api/v5/market/option/instrument-family-trades', params);
@@ -985,19 +794,11 @@ class RestClient extends BaseRestClient_1.default {
985
794
  getPublicRFQBlockTrades(params) {
986
795
  return this.get('/api/v5/rfq/public-trades', params);
987
796
  }
988
- /**
989
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
990
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
991
- */
992
- getBlockTickers(instType, uly) {
993
- return this.get('/api/v5/market/block-tickers', { instType, uly });
797
+ getBlockTickers(params) {
798
+ return this.get('/api/v5/market/block-tickers', params);
994
799
  }
995
- /**
996
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
997
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
998
- */
999
- getBlockTicker(instId) {
1000
- return this.get('/api/v5/market/block-ticker', { instId });
800
+ getBlockTicker(params) {
801
+ return this.get('/api/v5/market/block-ticker', params);
1001
802
  }
1002
803
  getBlockPublicTrades(params) {
1003
804
  return this.get('/api/v5/public/block-trades', params);
@@ -1060,17 +861,8 @@ class RestClient extends BaseRestClient_1.default {
1060
861
  * Public data - rest endpoints
1061
862
  *
1062
863
  */
1063
- /**
1064
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1065
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1066
- */
1067
- getInstruments(instType, uly, instFamily, instId) {
1068
- return this.get('/api/v5/public/instruments', {
1069
- instType,
1070
- uly,
1071
- instFamily,
1072
- instId,
1073
- });
864
+ getInstruments(params) {
865
+ return this.get('/api/v5/public/instruments', params);
1074
866
  }
1075
867
  getDeliveryExerciseHistory(params) {
1076
868
  return this.get('/api/v5/public/delivery-exercise-history', params);
@@ -1126,55 +918,19 @@ class RestClient extends BaseRestClient_1.default {
1126
918
  getPremiumHistory(params) {
1127
919
  return this.get('/api/v5/public/premium-history', params);
1128
920
  }
1129
- /**
1130
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1131
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1132
- */
1133
921
  getIndexTickers(params) {
1134
- return this.get('/api/v5/market/index-tickers', Object.assign({}, params));
922
+ return this.get('/api/v5/market/index-tickers', params);
1135
923
  }
1136
- /**
1137
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1138
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1139
- */
1140
- getIndexCandles(instId, bar = '1m', pagination) {
1141
- return this.get('/api/v5/market/index-candles', Object.assign({ instId,
1142
- bar }, pagination));
1143
- }
1144
- getIndexCandlesV2(params) {
924
+ getIndexCandles(params) {
1145
925
  return this.get('/api/v5/market/index-candles', params);
1146
926
  }
1147
- /**
1148
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1149
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1150
- */
1151
- getHistoricIndexCandles(instId, bar = '1m', pagination) {
1152
- return this.get('/api/v5/market/history-index-candles', Object.assign({ instId,
1153
- bar }, pagination));
1154
- }
1155
- getHistoricIndexCandlesV2(params) {
927
+ getHistoricIndexCandles(params) {
1156
928
  return this.get('/api/v5/market/history-index-candles', params);
1157
929
  }
1158
- /**
1159
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1160
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1161
- */
1162
- getMarkPriceCandles(instId, bar = '1m', pagination) {
1163
- return this.get('/api/v5/market/mark-price-candles', Object.assign({ instId,
1164
- bar }, pagination));
1165
- }
1166
- getMarkPriceCandlesV2(params) {
930
+ getMarkPriceCandles(params) {
1167
931
  return this.get('/api/v5/market/mark-price-candles', params);
1168
932
  }
1169
- /**
1170
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1171
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1172
- */
1173
- getHistoricMarkPriceCandles(instId, bar = '1m', pagination) {
1174
- return this.get('/api/v5/market/historic-mark-price-candles', Object.assign({ instId,
1175
- bar }, pagination));
1176
- }
1177
- getHistoricMarkPriceCandlesV2(params) {
933
+ getHistoricMarkPriceCandles(params) {
1178
934
  return this.get('/api/v5/market/history-mark-price-candles', params);
1179
935
  }
1180
936
  getOracle() {
@@ -1183,28 +939,14 @@ class RestClient extends BaseRestClient_1.default {
1183
939
  getExchangeRate() {
1184
940
  return this.get('/api/v5/market/exchange-rate');
1185
941
  }
1186
- /**
1187
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1188
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1189
- */
1190
- getIndexComponents(index) {
1191
- return this.get('/api/v5/market/index-components', { index });
942
+ getIndexComponents(params) {
943
+ return this.get('/api/v5/market/index-components', params);
1192
944
  }
1193
945
  getEconomicCalendar(params) {
1194
946
  return this.getPrivate('/api/v5/public/economic-calendar', params);
1195
947
  }
1196
- /**
1197
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1198
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1199
- */
1200
- getPublicBlockTrades(instId) {
1201
- return this.get('/api/v5/market/block-trades', { instId });
1202
- }
1203
- /**
1204
- * @deprecated
1205
- */
1206
- getLiquidationOrders(params) {
1207
- return this.get('/api/v5/public/liquidation-orders', params);
948
+ getPublicBlockTrades(params) {
949
+ return this.get('/api/v5/market/block-trades', params);
1208
950
  }
1209
951
  /**
1210
952
  *
@@ -1261,29 +1003,17 @@ class RestClient extends BaseRestClient_1.default {
1261
1003
  * Funding account - REST endpoints
1262
1004
  *
1263
1005
  */
1264
- /**
1265
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1266
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1267
- */
1268
- getCurrencies(ccy) {
1269
- return this.getPrivate('/api/v5/asset/currencies', { ccy });
1006
+ getCurrencies(params) {
1007
+ return this.getPrivate('/api/v5/asset/currencies', params);
1270
1008
  }
1271
- /**
1272
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1273
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1274
- */
1275
- getBalances(ccy) {
1276
- return this.getPrivate('/api/v5/asset/balances', { ccy });
1009
+ getBalances(params) {
1010
+ return this.getPrivate('/api/v5/asset/balances', params);
1277
1011
  }
1278
1012
  getNonTradableAssets(params) {
1279
1013
  return this.getPrivate('/api/v5/asset/non-tradable-assets', params);
1280
1014
  }
1281
- /**
1282
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1283
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1284
- */
1285
- getAccountAssetValuation(ccy) {
1286
- return this.getPrivate('/api/v5/asset/asset-valuation', { ccy });
1015
+ getAccountAssetValuation(params) {
1016
+ return this.getPrivate('/api/v5/asset/asset-valuation', params);
1287
1017
  }
1288
1018
  fundsTransfer(params) {
1289
1019
  return this.postPrivate('/api/v5/asset/transfer', params);
@@ -1295,19 +1025,11 @@ class RestClient extends BaseRestClient_1.default {
1295
1025
  getAssetBillsDetails(params) {
1296
1026
  return this.getPrivate('/api/v5/asset/bills', params);
1297
1027
  }
1298
- /**
1299
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1300
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1301
- */
1302
- getLightningDeposits(ccy, amt, to) {
1303
- return this.getPrivate('/api/v5/asset/deposit-lightning', { ccy, amt, to });
1028
+ getLightningDeposits(params) {
1029
+ return this.getPrivate('/api/v5/asset/deposit-lightning', params);
1304
1030
  }
1305
- /**
1306
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1307
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1308
- */
1309
- getDepositAddress(ccy) {
1310
- return this.getPrivate('/api/v5/asset/deposit-address', { ccy });
1031
+ getDepositAddress(params) {
1032
+ return this.getPrivate('/api/v5/asset/deposit-address', params);
1311
1033
  }
1312
1034
  getDepositHistory(params) {
1313
1035
  return this.getPrivate('/api/v5/asset/deposit-history', params);
@@ -1315,23 +1037,11 @@ class RestClient extends BaseRestClient_1.default {
1315
1037
  submitWithdraw(params) {
1316
1038
  return this.postPrivate('/api/v5/asset/withdrawal', params);
1317
1039
  }
1318
- /**
1319
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1320
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1321
- */
1322
- submitWithdrawLightning(ccy, invoice, memo) {
1323
- return this.postPrivate('/api/v5/asset/withdrawal-lightning', {
1324
- ccy,
1325
- invoice,
1326
- memo,
1327
- });
1040
+ submitWithdrawLightning(params) {
1041
+ return this.postPrivate('/api/v5/asset/withdrawal-lightning', params);
1328
1042
  }
1329
- /**
1330
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1331
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1332
- */
1333
- cancelWithdrawal(wdId) {
1334
- return this.postPrivate('/api/v5/asset/cancel-withdrawal', { wdId });
1043
+ cancelWithdrawal(params) {
1044
+ return this.postPrivate('/api/v5/asset/cancel-withdrawal', params);
1335
1045
  }
1336
1046
  getWithdrawalHistory(params) {
1337
1047
  return this.getPrivate('/api/v5/asset/withdrawal-history', params);
@@ -1339,13 +1049,6 @@ class RestClient extends BaseRestClient_1.default {
1339
1049
  getDepositWithdrawStatus(params) {
1340
1050
  return this.getPrivate('/api/v5/asset/deposit-withdraw-status', params);
1341
1051
  }
1342
- /**
1343
- * @deprecated
1344
- * use submitEasyConvert() instead
1345
- */
1346
- smallAssetsConvert(ccy) {
1347
- return this.postPrivate('/api/v5/asset/convert-dust-assets', { ccy });
1348
- }
1349
1052
  getExchanges() {
1350
1053
  return this.get('/api/v5/asset/exchange-list');
1351
1054
  }
@@ -1358,15 +1061,8 @@ class RestClient extends BaseRestClient_1.default {
1358
1061
  getConvertCurrencies() {
1359
1062
  return this.getPrivate('/api/v5/asset/convert/currencies');
1360
1063
  }
1361
- /**
1362
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1363
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1364
- */
1365
- getConvertCurrencyPair(fromCcy, toCcy) {
1366
- return this.getPrivate('/api/v5/asset/convert/currency-pair', {
1367
- fromCcy,
1368
- toCcy,
1369
- });
1064
+ getConvertCurrencyPair(params) {
1065
+ return this.getPrivate('/api/v5/asset/convert/currency-pair', params);
1370
1066
  }
1371
1067
  estimateConvertQuote(params) {
1372
1068
  return this.postPrivate('/api/v5/asset/convert/estimate-quote', params);
@@ -1386,30 +1082,14 @@ class RestClient extends BaseRestClient_1.default {
1386
1082
  getSubAccountList(params) {
1387
1083
  return this.getPrivate('/api/v5/users/subaccount/list', params);
1388
1084
  }
1389
- /**
1390
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1391
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1392
- */
1393
- resetSubAccountAPIKey(subAcct, apiKey, options) {
1394
- return this.postPrivate('/api/v5/users/subaccount/modify-apikey', Object.assign({ subAcct,
1395
- apiKey }, options));
1085
+ resetSubAccountAPIKey(params) {
1086
+ return this.postPrivate('/api/v5/users/subaccount/modify-apikey', params);
1396
1087
  }
1397
- /**
1398
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1399
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1400
- */
1401
- getSubAccountBalances(subAcct) {
1402
- return this.getPrivate('/api/v5/account/subaccount/balances', { subAcct });
1088
+ getSubAccountBalances(params) {
1089
+ return this.getPrivate('/api/v5/account/subaccount/balances', params);
1403
1090
  }
1404
- /**
1405
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1406
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1407
- */
1408
- getSubAccountFundingBalances(subAcct, ccy) {
1409
- return this.getPrivate('/api/v5/asset/subaccount/balances', {
1410
- subAcct,
1411
- ccy,
1412
- });
1091
+ getSubAccountFundingBalances(params) {
1092
+ return this.getPrivate('/api/v5/asset/subaccount/balances', params);
1413
1093
  }
1414
1094
  getSubAccountMaxWithdrawal(params) {
1415
1095
  return this.getPrivate('/api/v5/account/subaccount/max-withdrawal', params);
@@ -1425,24 +1105,11 @@ class RestClient extends BaseRestClient_1.default {
1425
1105
  transferSubAccountBalance(params) {
1426
1106
  return this.postPrivate('/api/v5/asset/subaccount/transfer', params);
1427
1107
  }
1428
- /**
1429
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1430
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1431
- */
1432
- setSubAccountTransferOutPermission(subAcct, canTransOut = true) {
1433
- return this.postPrivate('/api/v5/users/subaccount/set-transfer-out', {
1434
- subAcct,
1435
- canTransOut,
1436
- });
1108
+ setSubAccountTransferOutPermission(params) {
1109
+ return this.postPrivate('/api/v5/users/subaccount/set-transfer-out', params);
1437
1110
  }
1438
- /**
1439
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1440
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1441
- */
1442
- getSubAccountCustodyTradingList(subAcct) {
1443
- return this.getPrivate('/api/v5/users/entrust-subaccount-list', {
1444
- subAcct,
1445
- });
1111
+ getSubAccountCustodyTradingList(params) {
1112
+ return this.getPrivate('/api/v5/users/entrust-subaccount-list', params);
1446
1113
  }
1447
1114
  setSubAccountLoanAllocation(params) {
1448
1115
  return this.postPrivate('/api/v5/account/subaccount/set-loan-allocation', params);
@@ -1459,37 +1126,14 @@ class RestClient extends BaseRestClient_1.default {
1459
1126
  getStakingOffers(params) {
1460
1127
  return this.getPrivate('/api/v5/finance/staking-defi/offers', params);
1461
1128
  }
1462
- /**
1463
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1464
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1465
- */
1466
- submitStake(productId, investData, term) {
1467
- return this.postPrivate('/api/v5/finance/staking-defi/purchase', {
1468
- productId,
1469
- investData,
1470
- term,
1471
- });
1129
+ submitStake(params) {
1130
+ return this.postPrivate('/api/v5/finance/staking-defi/purchase', params);
1472
1131
  }
1473
- /**
1474
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1475
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1476
- */
1477
- redeemStake(ordId, protocolType, allowEarlyRedeem) {
1478
- return this.postPrivate('/api/v5/finance/staking-defi/redeem', {
1479
- ordId,
1480
- protocolType,
1481
- allowEarlyRedeem,
1482
- });
1132
+ redeemStake(params) {
1133
+ return this.postPrivate('/api/v5/finance/staking-defi/redeem', params);
1483
1134
  }
1484
- /**
1485
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1486
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1487
- */
1488
- cancelStakingRequest(ordId, protocolType) {
1489
- return this.postPrivate('/api/v5/finance/staking-defi/cancel', {
1490
- ordId,
1491
- protocolType,
1492
- });
1135
+ cancelStakingRequest(params) {
1136
+ return this.postPrivate('/api/v5/finance/staking-defi/cancel', params);
1493
1137
  }
1494
1138
  /** Earn/staking get active orders */
1495
1139
  getActiveStakingOrders(params) {
@@ -1527,44 +1171,20 @@ class RestClient extends BaseRestClient_1.default {
1527
1171
  * Financial product - simple earn flexible endpoints
1528
1172
  *
1529
1173
  */
1530
- /**
1531
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1532
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1533
- */
1534
- getSavingBalance(ccy) {
1535
- return this.getPrivate('/api/v5/finance/savings/balance', { ccy });
1174
+ getSavingBalance(params) {
1175
+ return this.getPrivate('/api/v5/finance/savings/balance', params);
1536
1176
  }
1537
- /**
1538
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1539
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1540
- */
1541
- savingsPurchaseRedemption(ccy, amt, side, rate) {
1542
- return this.postPrivate('/api/v5/finance/savings/purchase-redempt', {
1543
- ccy,
1544
- amt,
1545
- side,
1546
- rate,
1547
- });
1177
+ savingsPurchaseRedemption(params) {
1178
+ return this.postPrivate('/api/v5/finance/savings/purchase-redempt', params);
1548
1179
  }
1549
- /**
1550
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1551
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1552
- */
1553
- setLendingRate(ccy, rate) {
1554
- return this.postPrivate('/api/v5/finance/savings/set-lending-rate', {
1555
- ccy,
1556
- rate,
1557
- });
1180
+ setLendingRate(params) {
1181
+ return this.postPrivate('/api/v5/finance/savings/set-lending-rate', params);
1558
1182
  }
1559
1183
  getLendingHistory(params) {
1560
1184
  return this.getPrivate('/api/v5/finance/savings/lending-history', params);
1561
1185
  }
1562
- /**
1563
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1564
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1565
- */
1566
- getPublicBorrowInfo(ccy) {
1567
- return this.get('/api/v5/finance/savings/lending-rate-summary', { ccy });
1186
+ getPublicBorrowInfo(params) {
1187
+ return this.get('/api/v5/finance/savings/lending-rate-summary', params);
1568
1188
  }
1569
1189
  getPublicBorrowHistory(params) {
1570
1190
  return this.get('/api/v5/finance/savings/lending-rate-history', params);
@@ -1637,12 +1257,8 @@ class RestClient extends BaseRestClient_1.default {
1637
1257
  * Status endpoints (public)
1638
1258
  *
1639
1259
  */
1640
- /**
1641
- * @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
1642
- * See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
1643
- */
1644
- getSystemStatus(state) {
1645
- return this.get('/api/v5/system/status', { state });
1260
+ getSystemStatus(params) {
1261
+ return this.get('/api/v5/system/status', params);
1646
1262
  }
1647
1263
  /**
1648
1264
  *
@@ -1660,13 +1276,6 @@ class RestClient extends BaseRestClient_1.default {
1660
1276
  * Broker endpoints (private)
1661
1277
  *
1662
1278
  */
1663
- /**
1664
- *
1665
- * @deprecated
1666
- */
1667
- getBrokerAccountInformation() {
1668
- return this.getPrivate('/api/v5/broker/nd/info');
1669
- }
1670
1279
  createSubAccount(params) {
1671
1280
  return this.postPrivate('/api/v5/broker/nd/create-subaccount', params);
1672
1281
  }