okx-api 1.5.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/rest-client.d.ts +217 -328
- package/lib/rest-client.js +113 -504
- package/lib/rest-client.js.map +1 -1
- package/package.json +1 -1
package/lib/rest-client.d.ts
CHANGED
|
@@ -33,18 +33,14 @@ export declare class RestClient extends BaseRestClient {
|
|
|
33
33
|
*
|
|
34
34
|
*/
|
|
35
35
|
getAccountInstruments(params: GetInstrumentsRequest): Promise<AccountInstrument[]>;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
*/
|
|
40
|
-
getBalance(ccy?: string): Promise<AccountBalance[]>;
|
|
36
|
+
getBalance(params?: {
|
|
37
|
+
ccy?: string;
|
|
38
|
+
}): Promise<AccountBalance[]>;
|
|
41
39
|
getPositions(params?: GetPositionsParams): Promise<AccountPosition[]>;
|
|
42
40
|
getPositionsHistory(params?: GetHistoricPositionParams): Promise<HistoricAccountPosition[]>;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
*/
|
|
47
|
-
getAccountPositionRisk(instType?: Omit<'SPOT', InstrumentType>): Promise<AccountPositionRisk[]>;
|
|
41
|
+
getAccountPositionRisk(params?: {
|
|
42
|
+
instType?: Omit<'SPOT', InstrumentType>;
|
|
43
|
+
}): Promise<AccountPositionRisk[]>;
|
|
48
44
|
/** Up to last 7 days */
|
|
49
45
|
getBills(params?: any): Promise<AccountBill[]>;
|
|
50
46
|
/** Last 3 months */
|
|
@@ -70,11 +66,9 @@ export declare class RestClient extends BaseRestClient {
|
|
|
70
66
|
quarter: 'Q1' | 'Q2' | 'Q3' | 'Q4';
|
|
71
67
|
}): Promise<AccountHistoryBill[]>;
|
|
72
68
|
getAccountConfiguration(): Promise<AccountConfiguration[]>;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
*/
|
|
77
|
-
setPositionMode(posMode: PosMode): Promise<AccountPositionModeResult[]>;
|
|
69
|
+
setPositionMode(params: {
|
|
70
|
+
posMode: PosMode;
|
|
71
|
+
}): Promise<AccountPositionModeResult[]>;
|
|
78
72
|
setLeverage(params: SetLeverageRequest): Promise<AccountLeverageResult[]>;
|
|
79
73
|
/** Max buy/sell amount or open amount */
|
|
80
74
|
getMaxBuySellAmount(params: {
|
|
@@ -93,11 +87,10 @@ export declare class RestClient extends BaseRestClient {
|
|
|
93
87
|
unSpotOffset?: boolean;
|
|
94
88
|
}): Promise<AccountMaxTradableAmount[]>;
|
|
95
89
|
changePositionMargin(params: ChangePositionMarginRequest): Promise<AccountChangeMarginResult[]>;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
getLeverage(instId: string, mgnMode: MarginMode): Promise<AccountLeverage[]>;
|
|
90
|
+
getLeverage(params: {
|
|
91
|
+
instId: string;
|
|
92
|
+
mgnMode: MarginMode;
|
|
93
|
+
}): Promise<AccountLeverage[]>;
|
|
101
94
|
getLeverageV2(params: {
|
|
102
95
|
instId?: string;
|
|
103
96
|
ccy?: string;
|
|
@@ -111,23 +104,13 @@ export declare class RestClient extends BaseRestClient {
|
|
|
111
104
|
ccy?: string;
|
|
112
105
|
posSide: PositionSide;
|
|
113
106
|
}): Promise<AdjustLeverageInfo[]>;
|
|
114
|
-
|
|
115
|
-
* @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
|
|
116
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
117
|
-
*/
|
|
118
|
-
getMaxLoan(instId: string, mgnMode: MarginMode, mgnCcy?: string | undefined, ccy?: string): Promise<AccountMaxLoan[]>;
|
|
119
|
-
getMaxLoanV2(params: {
|
|
107
|
+
getMaxLoan(params: {
|
|
120
108
|
instId: string;
|
|
121
109
|
mgnMode: MarginMode;
|
|
122
110
|
mgnCcy?: string;
|
|
123
111
|
ccy?: string;
|
|
124
112
|
}): Promise<AccountMaxLoan[]>;
|
|
125
|
-
|
|
126
|
-
* @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
|
|
127
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
128
|
-
*/
|
|
129
|
-
getFeeRates(instType: InstrumentType, instId?: string, uly?: string, instFamily?: string, ruleType?: string): Promise<AccountFeeRate[]>;
|
|
130
|
-
getFeeRatesV2(params: {
|
|
113
|
+
getFeeRates(params: {
|
|
131
114
|
instType: InstrumentType;
|
|
132
115
|
instId?: string;
|
|
133
116
|
uly?: string;
|
|
@@ -143,34 +126,28 @@ export declare class RestClient extends BaseRestClient {
|
|
|
143
126
|
before?: string;
|
|
144
127
|
limit?: string;
|
|
145
128
|
}): Promise<InterestAccrued[]>;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
*/
|
|
160
|
-
setIsolatedMode(isoMode: 'automatic' | 'autonomy', type: 'MARGIN' | 'CONTRACTS'): Promise<AccountIsolatedMode[]>;
|
|
161
|
-
/**
|
|
162
|
-
* @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
|
|
163
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
164
|
-
*/
|
|
165
|
-
getMaxWithdrawals(ccy?: string): Promise<MaxWithdrawal[]>;
|
|
129
|
+
getInterestRate(params?: {
|
|
130
|
+
ccy?: string;
|
|
131
|
+
}): Promise<InterestRate[]>;
|
|
132
|
+
setGreeksDisplayType(params: {
|
|
133
|
+
greeksType: 'PA' | 'BS';
|
|
134
|
+
}): Promise<Greeks[]>;
|
|
135
|
+
setIsolatedMode(params: {
|
|
136
|
+
isoMode: 'automatic' | 'autonomy';
|
|
137
|
+
type: 'MARGIN' | 'CONTRACTS';
|
|
138
|
+
}): Promise<AccountIsolatedMode[]>;
|
|
139
|
+
getMaxWithdrawals(params?: {
|
|
140
|
+
ccy?: string;
|
|
141
|
+
}): Promise<MaxWithdrawal[]>;
|
|
166
142
|
getAccountRiskState(): Promise<AccountRiskState[]>;
|
|
167
143
|
submitQuickMarginBorrowRepay(params: QuickMarginBorrowRepayRequest): Promise<QuickMarginBorrowRepayResult[]>;
|
|
168
144
|
getQuickMarginBorrowRepayHistory(params: GetQuickMarginBorrowRepayHistoryRequest): Promise<QuickMarginBorrowRepayRecord[]>;
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
145
|
+
borrowRepayVIPLoan(params: {
|
|
146
|
+
ccy: string;
|
|
147
|
+
side: 'borrow' | 'repay';
|
|
148
|
+
amt: numberInString;
|
|
149
|
+
ordId?: string;
|
|
150
|
+
}): Promise<any[]>;
|
|
174
151
|
getVIPLoanBorrowRepayHistory(params?: any): Promise<any[]>;
|
|
175
152
|
getVIPInterestAccrued(params: GetVIPInterestRequest): Promise<VIPInterest[]>;
|
|
176
153
|
getVIPInterestDeducted(params: GetVIPInterestRequest): Promise<VIPInterest[]>;
|
|
@@ -235,11 +212,9 @@ export declare class RestClient extends BaseRestClient {
|
|
|
235
212
|
ccy: string;
|
|
236
213
|
clSpotInUseAmt: string;
|
|
237
214
|
}[]>;
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
*/
|
|
242
|
-
getGreeks(ccy?: string): Promise<any[]>;
|
|
215
|
+
getGreeks(params?: {
|
|
216
|
+
ccy?: string;
|
|
217
|
+
}): Promise<any[]>;
|
|
243
218
|
getPMLimitation(params: {
|
|
244
219
|
instType: 'SWAP' | 'FUTURES' | 'OPTION';
|
|
245
220
|
uly?: string;
|
|
@@ -312,9 +287,6 @@ export declare class RestClient extends BaseRestClient {
|
|
|
312
287
|
source?: string;
|
|
313
288
|
}): Promise<any>;
|
|
314
289
|
/**
|
|
315
|
-
*
|
|
316
|
-
* @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
|
|
317
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
318
290
|
*
|
|
319
291
|
* Place easy convert : Convert small currencies to mainstream currencies.
|
|
320
292
|
* Only applicable to the crypto balance less than $10.
|
|
@@ -323,27 +295,30 @@ export declare class RestClient extends BaseRestClient {
|
|
|
323
295
|
* If there are multiple currencies, separate them with commas in the "from" field.
|
|
324
296
|
*
|
|
325
297
|
*/
|
|
326
|
-
submitEasyConvert(
|
|
298
|
+
submitEasyConvert(params: {
|
|
299
|
+
fromCcys: string[];
|
|
300
|
+
toCcy: string;
|
|
301
|
+
source?: string;
|
|
302
|
+
}): Promise<APIResponse<any>>;
|
|
327
303
|
/** Get easy convert history : Get the history and status of easy convert trades. */
|
|
328
304
|
getEasyConvertHistory(params?: Pagination): Promise<APIResponse<any>>;
|
|
329
305
|
/**
|
|
330
|
-
*
|
|
331
|
-
* @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
|
|
332
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
333
306
|
*
|
|
334
307
|
* Get one-click repay currency list : Get list of debt currency data and repay currencies.
|
|
335
308
|
* Debt currencies include both cross and isolated debts.
|
|
336
309
|
*/
|
|
337
|
-
getOneClickRepayCurrencyList(
|
|
310
|
+
getOneClickRepayCurrencyList(params?: {
|
|
311
|
+
debtType?: 'cross' | 'isolated';
|
|
312
|
+
}): Promise<APIResponse<any>>;
|
|
338
313
|
/**
|
|
339
|
-
* @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
|
|
340
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
341
|
-
*
|
|
342
314
|
* Trade one-click repay to repay cross debts.
|
|
343
315
|
* Isolated debts are not applicable.
|
|
344
316
|
* The maximum repayment amount is based on the remaining available balance of funding and trading accounts.
|
|
345
317
|
*/
|
|
346
|
-
submitOneClickRepay(
|
|
318
|
+
submitOneClickRepay(params: {
|
|
319
|
+
debtCcys: string[];
|
|
320
|
+
repayCcy: string;
|
|
321
|
+
}): Promise<APIResponse<any>>;
|
|
347
322
|
/** Get the history and status of one-click repay trades. */
|
|
348
323
|
getOneClickRepayHistory(params?: Pagination): Promise<APIResponse<any>>;
|
|
349
324
|
cancelMassOrder(params: {
|
|
@@ -377,13 +352,19 @@ export declare class RestClient extends BaseRestClient {
|
|
|
377
352
|
*
|
|
378
353
|
*/
|
|
379
354
|
placeGridAlgoOrder(params: GridAlgoOrderRequest): Promise<any[]>;
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
355
|
+
amendGridAlgoOrder(params: {
|
|
356
|
+
algoId: string;
|
|
357
|
+
instId: string;
|
|
358
|
+
slTriggerPx?: string;
|
|
359
|
+
tpTriggerPx?: string;
|
|
360
|
+
tpRatio?: string;
|
|
361
|
+
slRatio?: string;
|
|
362
|
+
triggerParams?: {
|
|
363
|
+
triggerAction?: string;
|
|
364
|
+
triggerStrategy?: string;
|
|
365
|
+
triggerPx?: string;
|
|
366
|
+
stopType?: string;
|
|
367
|
+
}[];
|
|
387
368
|
}): Promise<any[]>;
|
|
388
369
|
stopGridAlgoOrder(orders: StopGridAlgoOrderRequest[]): Promise<any[]>;
|
|
389
370
|
closeGridContractPosition(params: CloseContractGridPositionRequest): Promise<any[]>;
|
|
@@ -399,40 +380,34 @@ export declare class RestClient extends BaseRestClient {
|
|
|
399
380
|
}[]>;
|
|
400
381
|
getGridAlgoOrderList(params: GetGridAlgoOrdersRequest): Promise<any[]>;
|
|
401
382
|
getGridAlgoOrderHistory(params: GetGridAlgoOrdersRequest): Promise<any[]>;
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
getGridAlgoSubOrders(algoOrdType: GridAlgoOrderType, algoId: string, type: GridAlgoSubOrderType, groupId?: string, pagination?: {
|
|
383
|
+
getGridAlgoOrderDetails(params: {
|
|
384
|
+
algoOrdType: GridAlgoOrderType;
|
|
385
|
+
algoId: string;
|
|
386
|
+
}): Promise<any[]>;
|
|
387
|
+
getGridAlgoSubOrders(params: {
|
|
388
|
+
algoOrdType: GridAlgoOrderType;
|
|
389
|
+
algoId: string;
|
|
390
|
+
type: GridAlgoSubOrderType;
|
|
391
|
+
groupId?: string;
|
|
412
392
|
after?: numberInString;
|
|
413
393
|
before?: numberInString;
|
|
414
394
|
limit?: number;
|
|
415
395
|
}): Promise<any[]>;
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
/**
|
|
432
|
-
* @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
|
|
433
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
434
|
-
*/
|
|
435
|
-
adjustGridMarginBalance(algoId: string, type: 'add' | 'reduce', change: {
|
|
396
|
+
getGridAlgoOrderPositions(params: {
|
|
397
|
+
algoOrdType: 'contract_grid';
|
|
398
|
+
algoId: string;
|
|
399
|
+
}): Promise<any[]>;
|
|
400
|
+
spotGridWithdrawIncome(params: {
|
|
401
|
+
algoId: string;
|
|
402
|
+
}): Promise<any[]>;
|
|
403
|
+
computeGridMarginBalance(params: {
|
|
404
|
+
algoId: string;
|
|
405
|
+
type: 'add' | 'reduce';
|
|
406
|
+
amt?: numberInString;
|
|
407
|
+
}): Promise<any[]>;
|
|
408
|
+
adjustGridMarginBalance(params: {
|
|
409
|
+
algoId: string;
|
|
410
|
+
type: 'add' | 'reduce';
|
|
436
411
|
amt?: numberInString;
|
|
437
412
|
percent?: numberInString;
|
|
438
413
|
}): Promise<any[]>;
|
|
@@ -442,11 +417,12 @@ export declare class RestClient extends BaseRestClient {
|
|
|
442
417
|
}): Promise<{
|
|
443
418
|
algoId: string;
|
|
444
419
|
}[]>;
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
420
|
+
getGridAIParameter(params: {
|
|
421
|
+
algoOrdType: GridAlgoOrderType;
|
|
422
|
+
instId: string;
|
|
423
|
+
direction: ContractGridDirection;
|
|
424
|
+
duration?: '7D' | '30D' | '180D';
|
|
425
|
+
}): Promise<any[]>;
|
|
450
426
|
computeGridMinInvestment(params: {
|
|
451
427
|
amt: string;
|
|
452
428
|
ccy: string;
|
|
@@ -629,47 +605,30 @@ export declare class RestClient extends BaseRestClient {
|
|
|
629
605
|
* Orderbook trading - Market data endpoints
|
|
630
606
|
*
|
|
631
607
|
*/
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
645
|
-
*/
|
|
646
|
-
getOrderBook(instId: string, sz?: numberInString): Promise<OrderBook[]>;
|
|
608
|
+
getTickers(params: {
|
|
609
|
+
instType: InstrumentType;
|
|
610
|
+
uly?: string;
|
|
611
|
+
instFamily?: string;
|
|
612
|
+
}): Promise<Ticker[]>;
|
|
613
|
+
getTicker(params: {
|
|
614
|
+
instId: string;
|
|
615
|
+
}): Promise<Ticker[]>;
|
|
616
|
+
getOrderBook(params: {
|
|
617
|
+
instId: string;
|
|
618
|
+
sz?: numberInString;
|
|
619
|
+
}): Promise<OrderBook[]>;
|
|
647
620
|
getFullOrderBook(params: {
|
|
648
621
|
instId: string;
|
|
649
622
|
sz?: string;
|
|
650
623
|
}): Promise<OrderBook[]>;
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
660
|
-
*/
|
|
661
|
-
getHistoricCandles(instId: string, bar?: string, pagination?: Pagination): Promise<Candle[]>;
|
|
662
|
-
getHistoricCandlesV2(params: CandleRequest): Promise<Candle[]>;
|
|
663
|
-
/**
|
|
664
|
-
* @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
|
|
665
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
666
|
-
*/
|
|
667
|
-
getTrades(instId: string, limit?: number): Promise<Trade[]>;
|
|
668
|
-
/**
|
|
669
|
-
* @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
|
|
670
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
671
|
-
*/
|
|
672
|
-
getHistoricTrades(instId: string, pagination?: {
|
|
624
|
+
getCandles(params: CandleRequest): Promise<Candle[]>;
|
|
625
|
+
getHistoricCandles(params: CandleRequest): Promise<Candle[]>;
|
|
626
|
+
getTrades(params: {
|
|
627
|
+
instId: string;
|
|
628
|
+
limit?: number;
|
|
629
|
+
}): Promise<Trade[]>;
|
|
630
|
+
getHistoricTrades(params: {
|
|
631
|
+
instId: string;
|
|
673
632
|
after?: numberInString;
|
|
674
633
|
before?: numberInString;
|
|
675
634
|
limit?: numberInString;
|
|
@@ -714,16 +673,13 @@ export declare class RestClient extends BaseRestClient {
|
|
|
714
673
|
getBlockQuotes(params?: GetBlockQuoteParams): Promise<GetBlockQuoteResult[]>;
|
|
715
674
|
getBlockTrades(params?: any): Promise<any[]>;
|
|
716
675
|
getPublicRFQBlockTrades(params?: any): Promise<any[]>;
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
725
|
-
*/
|
|
726
|
-
getBlockTicker(instId: string): Promise<any[]>;
|
|
676
|
+
getBlockTickers(params: {
|
|
677
|
+
instType: InstrumentType;
|
|
678
|
+
uly?: string;
|
|
679
|
+
}): Promise<any[]>;
|
|
680
|
+
getBlockTicker(params: {
|
|
681
|
+
instId: string;
|
|
682
|
+
}): Promise<any[]>;
|
|
727
683
|
getBlockPublicTrades(params: {
|
|
728
684
|
instId: string;
|
|
729
685
|
}): Promise<PublicBlockTrade[]>;
|
|
@@ -775,11 +731,12 @@ export declare class RestClient extends BaseRestClient {
|
|
|
775
731
|
* Public data - rest endpoints
|
|
776
732
|
*
|
|
777
733
|
*/
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
734
|
+
getInstruments(params: {
|
|
735
|
+
instType: InstrumentType;
|
|
736
|
+
uly?: string;
|
|
737
|
+
instFamily?: string;
|
|
738
|
+
instId?: string;
|
|
739
|
+
}): Promise<Instrument[]>;
|
|
783
740
|
getDeliveryExerciseHistory(params: any): Promise<any[]>;
|
|
784
741
|
getOpenInterest(params: any): Promise<any[]>;
|
|
785
742
|
getFundingRate(params: any): Promise<any[]>;
|
|
@@ -801,55 +758,23 @@ export declare class RestClient extends BaseRestClient {
|
|
|
801
758
|
instFamily?: string;
|
|
802
759
|
}): Promise<any[]>;
|
|
803
760
|
getPremiumHistory(params: GetPremiumHistoryRequest): Promise<any[]>;
|
|
804
|
-
/**
|
|
805
|
-
* @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
|
|
806
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
807
|
-
*/
|
|
808
761
|
getIndexTickers(params: {
|
|
809
762
|
quoteCcy?: string;
|
|
810
763
|
instId?: string;
|
|
811
764
|
}): Promise<IndexTicker[]>;
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
getIndexCandles(instId: string, bar?: string, pagination?: Pagination): Promise<CandleNoVolume[]>;
|
|
817
|
-
getIndexCandlesV2(params: CandleRequest): Promise<CandleNoVolume[]>;
|
|
818
|
-
/**
|
|
819
|
-
* @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
|
|
820
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
821
|
-
*/
|
|
822
|
-
getHistoricIndexCandles(instId: string, bar?: string, pagination?: Pagination): Promise<CandleNoVolume[]>;
|
|
823
|
-
getHistoricIndexCandlesV2(params: CandleRequest): Promise<CandleNoVolume[]>;
|
|
824
|
-
/**
|
|
825
|
-
* @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
|
|
826
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
827
|
-
*/
|
|
828
|
-
getMarkPriceCandles(instId: string, bar?: string, pagination?: Pagination): Promise<CandleNoVolume[]>;
|
|
829
|
-
getMarkPriceCandlesV2(params: CandleRequest): Promise<CandleNoVolume[]>;
|
|
830
|
-
/**
|
|
831
|
-
* @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
|
|
832
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
833
|
-
*/
|
|
834
|
-
getHistoricMarkPriceCandles(instId: string, bar?: string, pagination?: Pagination): Promise<CandleNoVolume[]>;
|
|
835
|
-
getHistoricMarkPriceCandlesV2(params: CandleRequest): Promise<CandleNoVolume[]>;
|
|
765
|
+
getIndexCandles(params: CandleRequest): Promise<CandleNoVolume[]>;
|
|
766
|
+
getHistoricIndexCandles(params: CandleRequest): Promise<CandleNoVolume[]>;
|
|
767
|
+
getMarkPriceCandles(params: CandleRequest): Promise<CandleNoVolume[]>;
|
|
768
|
+
getHistoricMarkPriceCandles(params: CandleRequest): Promise<CandleNoVolume[]>;
|
|
836
769
|
getOracle(): Promise<any[]>;
|
|
837
770
|
getExchangeRate(): Promise<any[]>;
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
*/
|
|
842
|
-
getIndexComponents(index: string): Promise<any[]>;
|
|
771
|
+
getIndexComponents(params: {
|
|
772
|
+
index: string;
|
|
773
|
+
}): Promise<any[]>;
|
|
843
774
|
getEconomicCalendar(params: EconomicCalendarRequest): Promise<EconomicCalendarData[]>;
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
*/
|
|
848
|
-
getPublicBlockTrades(instId: string): Promise<any[]>;
|
|
849
|
-
/**
|
|
850
|
-
* @deprecated
|
|
851
|
-
*/
|
|
852
|
-
getLiquidationOrders(params: any): Promise<any[]>;
|
|
775
|
+
getPublicBlockTrades(params: {
|
|
776
|
+
instId: string;
|
|
777
|
+
}): Promise<any[]>;
|
|
853
778
|
/**
|
|
854
779
|
*
|
|
855
780
|
* Trading statistics - REST endpoints
|
|
@@ -912,24 +837,18 @@ export declare class RestClient extends BaseRestClient {
|
|
|
912
837
|
* Funding account - REST endpoints
|
|
913
838
|
*
|
|
914
839
|
*/
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
* @deprecated Breaking change: this function will change soon to accept a single object for all REST API parameters.
|
|
922
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
923
|
-
*/
|
|
924
|
-
getBalances(ccy?: string): Promise<FundingBalance[]>;
|
|
840
|
+
getCurrencies(params: {
|
|
841
|
+
ccy?: string;
|
|
842
|
+
}): Promise<FundingCurrency[]>;
|
|
843
|
+
getBalances(params: {
|
|
844
|
+
ccy?: string;
|
|
845
|
+
}): Promise<FundingBalance[]>;
|
|
925
846
|
getNonTradableAssets(params?: {
|
|
926
847
|
ccy?: string;
|
|
927
848
|
}): Promise<NonTradableAsset[]>;
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
*/
|
|
932
|
-
getAccountAssetValuation(ccy?: string): Promise<AccountAssetValuation[]>;
|
|
849
|
+
getAccountAssetValuation(params: {
|
|
850
|
+
ccy?: string;
|
|
851
|
+
}): Promise<AccountAssetValuation[]>;
|
|
933
852
|
fundsTransfer(params: FundsTransferRequest): Promise<FundTransferResult[]>;
|
|
934
853
|
/** Either parameter transId or clientId is required. */
|
|
935
854
|
getFundsTransferState(params: {
|
|
@@ -945,35 +864,26 @@ export declare class RestClient extends BaseRestClient {
|
|
|
945
864
|
before?: numberInString;
|
|
946
865
|
limit?: numberInString;
|
|
947
866
|
}): Promise<AssetBillDetails[]>;
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
*/
|
|
957
|
-
getDepositAddress(ccy: string): Promise<any[]>;
|
|
867
|
+
getLightningDeposits(params: {
|
|
868
|
+
ccy: string;
|
|
869
|
+
amt: numberInString;
|
|
870
|
+
to?: '6' | '18';
|
|
871
|
+
}): Promise<any[]>;
|
|
872
|
+
getDepositAddress(params: {
|
|
873
|
+
ccy: string;
|
|
874
|
+
}): Promise<any[]>;
|
|
958
875
|
getDepositHistory(params?: any): Promise<any[]>;
|
|
959
876
|
submitWithdraw(params: WithdrawRequest): Promise<WithdrawResponse[]>;
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
*/
|
|
969
|
-
cancelWithdrawal(wdId: string): Promise<any[]>;
|
|
877
|
+
submitWithdrawLightning(params: {
|
|
878
|
+
ccy: string;
|
|
879
|
+
invoice: string;
|
|
880
|
+
memo?: string;
|
|
881
|
+
}): Promise<any[]>;
|
|
882
|
+
cancelWithdrawal(params: {
|
|
883
|
+
wdId: string;
|
|
884
|
+
}): Promise<any[]>;
|
|
970
885
|
getWithdrawalHistory(params?: WithdrawalHistoryRequest): Promise<any[]>;
|
|
971
886
|
getDepositWithdrawStatus(params: GetDepositWithdrawStatusRequest): Promise<any[]>;
|
|
972
|
-
/**
|
|
973
|
-
* @deprecated
|
|
974
|
-
* use submitEasyConvert() instead
|
|
975
|
-
*/
|
|
976
|
-
smallAssetsConvert(ccy: string[]): Promise<any[]>;
|
|
977
887
|
getExchanges(): Promise<any[]>;
|
|
978
888
|
applyForMonthlyStatement(params?: {
|
|
979
889
|
month?: string;
|
|
@@ -982,11 +892,10 @@ export declare class RestClient extends BaseRestClient {
|
|
|
982
892
|
month: string;
|
|
983
893
|
}): Promise<any[]>;
|
|
984
894
|
getConvertCurrencies(): Promise<any[]>;
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
getConvertCurrencyPair(fromCcy: string, toCcy: string): Promise<any[]>;
|
|
895
|
+
getConvertCurrencyPair(params: {
|
|
896
|
+
fromCcy: string;
|
|
897
|
+
toCcy: string;
|
|
898
|
+
}): Promise<any[]>;
|
|
990
899
|
estimateConvertQuote(params: ConvertQuoteEstimateRequest): Promise<any[]>;
|
|
991
900
|
convertTrade(params: ConvertTradeRequest): Promise<any[]>;
|
|
992
901
|
getConvertHistory(params?: any): Promise<any[]>;
|
|
@@ -997,25 +906,20 @@ export declare class RestClient extends BaseRestClient {
|
|
|
997
906
|
*/
|
|
998
907
|
/** View sub-account list */
|
|
999
908
|
getSubAccountList(params?: any): Promise<SubAccount[]>;
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
*/
|
|
1004
|
-
resetSubAccountAPIKey(subAcct: string, apiKey: string, options?: {
|
|
909
|
+
resetSubAccountAPIKey(params: {
|
|
910
|
+
subAcct: string;
|
|
911
|
+
apiKey: string;
|
|
1005
912
|
label?: string;
|
|
1006
913
|
perm?: string;
|
|
1007
914
|
ip?: string;
|
|
1008
915
|
}): Promise<SubAccountAPIReset[]>;
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
1017
|
-
*/
|
|
1018
|
-
getSubAccountFundingBalances(subAcct: string, ccy?: string): Promise<FundingBalance[]>;
|
|
916
|
+
getSubAccountBalances(params: {
|
|
917
|
+
subAcct: string;
|
|
918
|
+
}): Promise<SubAccountBalances[]>;
|
|
919
|
+
getSubAccountFundingBalances(params: {
|
|
920
|
+
subAcct: string;
|
|
921
|
+
ccy?: string;
|
|
922
|
+
}): Promise<FundingBalance[]>;
|
|
1019
923
|
getSubAccountMaxWithdrawal(params: GetSubAccountMaxWithdrawalsRequest): Promise<SubAccountMaxWithdrawal[]>;
|
|
1020
924
|
/** History of sub-account transfer */
|
|
1021
925
|
getSubAccountTransferHistory(params?: {
|
|
@@ -1029,16 +933,13 @@ export declare class RestClient extends BaseRestClient {
|
|
|
1029
933
|
getManagedSubAccountTransferHistory(params: GetManagedSubAccountTransferHistoryRequest): Promise<ManagedSubAccountTransfer[]>;
|
|
1030
934
|
/** Master accounts manage the transfers between sub-accounts */
|
|
1031
935
|
transferSubAccountBalance(params: SubAccountTransferRequest): Promise<SubAccountTransferResult[]>;
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
* See issue https://github.com/tiagosiebler/okx-api/issues/88 for more details.
|
|
1040
|
-
*/
|
|
1041
|
-
getSubAccountCustodyTradingList(subAcct?: string): Promise<any[]>;
|
|
936
|
+
setSubAccountTransferOutPermission(params: {
|
|
937
|
+
subAcct: string;
|
|
938
|
+
canTransOut: boolean;
|
|
939
|
+
}): Promise<any[]>;
|
|
940
|
+
getSubAccountCustodyTradingList(params: {
|
|
941
|
+
subAcct?: string;
|
|
942
|
+
}): Promise<any[]>;
|
|
1042
943
|
setSubAccountLoanAllocation(params: SetSubAccountLoanAllocationRequest): Promise<{
|
|
1043
944
|
result: boolean;
|
|
1044
945
|
}[]>;
|
|
@@ -1057,24 +958,23 @@ export declare class RestClient extends BaseRestClient {
|
|
|
1057
958
|
protocolType?: 'staking' | 'defi';
|
|
1058
959
|
ccy?: string;
|
|
1059
960
|
}): Promise<any[]>;
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
}
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
cancelStakingRequest(ordId: string, protocolType: 'staking' | 'defi'): Promise<any[]>;
|
|
961
|
+
submitStake(params: {
|
|
962
|
+
productId: string;
|
|
963
|
+
investData: {
|
|
964
|
+
ccy: string;
|
|
965
|
+
amt: string;
|
|
966
|
+
}[];
|
|
967
|
+
term?: string;
|
|
968
|
+
}): Promise<any[]>;
|
|
969
|
+
redeemStake(params: {
|
|
970
|
+
ordId: string;
|
|
971
|
+
protocolType: 'staking' | 'defi';
|
|
972
|
+
allowEarlyRedeem?: boolean;
|
|
973
|
+
}): Promise<any[]>;
|
|
974
|
+
cancelStakingRequest(params: {
|
|
975
|
+
ordId: string;
|
|
976
|
+
protocolType: 'staking' | 'defi';
|
|
977
|
+
}): Promise<any[]>;
|
|
1078
978
|
/** Earn/staking get active orders */
|
|
1079
979
|
getActiveStakingOrders(params?: {
|
|
1080
980
|
productId?: string;
|
|
@@ -1119,27 +1019,23 @@ export declare class RestClient extends BaseRestClient {
|
|
|
1119
1019
|
* Financial product - simple earn flexible endpoints
|
|
1120
1020
|
*
|
|
1121
1021
|
*/
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
*/
|
|
1136
|
-
setLendingRate(ccy: string, rate: numberInString): Promise<any[]>;
|
|
1022
|
+
getSavingBalance(params: {
|
|
1023
|
+
ccy?: string;
|
|
1024
|
+
}): Promise<any[]>;
|
|
1025
|
+
savingsPurchaseRedemption(params: {
|
|
1026
|
+
ccy: string;
|
|
1027
|
+
amt: numberInString;
|
|
1028
|
+
side: 'purchase' | 'redempt';
|
|
1029
|
+
rate: numberInString;
|
|
1030
|
+
}): Promise<any[]>;
|
|
1031
|
+
setLendingRate(params: {
|
|
1032
|
+
ccy: string;
|
|
1033
|
+
rate: numberInString;
|
|
1034
|
+
}): Promise<any[]>;
|
|
1137
1035
|
getLendingHistory(params?: PaginatedSymbolRequest): Promise<any[]>;
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
*/
|
|
1142
|
-
getPublicBorrowInfo(ccy?: string): Promise<any[]>;
|
|
1036
|
+
getPublicBorrowInfo(params: {
|
|
1037
|
+
ccy?: string;
|
|
1038
|
+
}): Promise<any[]>;
|
|
1143
1039
|
getPublicBorrowHistory(params?: PaginatedSymbolRequest): Promise<any[]>;
|
|
1144
1040
|
/**
|
|
1145
1041
|
*
|
|
@@ -1194,11 +1090,9 @@ export declare class RestClient extends BaseRestClient {
|
|
|
1194
1090
|
* Status endpoints (public)
|
|
1195
1091
|
*
|
|
1196
1092
|
*/
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
*/
|
|
1201
|
-
getSystemStatus(state?: 'scheduled' | 'ongoing' | 'pre_open' | 'completed' | 'canceled'): Promise<any[]>;
|
|
1093
|
+
getSystemStatus(params: {
|
|
1094
|
+
state?: 'scheduled' | 'ongoing' | 'pre_open' | 'completed' | 'canceled';
|
|
1095
|
+
}): Promise<any[]>;
|
|
1202
1096
|
/**
|
|
1203
1097
|
*
|
|
1204
1098
|
* Announcement endpoints
|
|
@@ -1220,11 +1114,6 @@ export declare class RestClient extends BaseRestClient {
|
|
|
1220
1114
|
* Broker endpoints (private)
|
|
1221
1115
|
*
|
|
1222
1116
|
*/
|
|
1223
|
-
/**
|
|
1224
|
-
*
|
|
1225
|
-
* @deprecated
|
|
1226
|
-
*/
|
|
1227
|
-
getBrokerAccountInformation(): Promise<any[]>;
|
|
1228
1117
|
createSubAccount(params: {
|
|
1229
1118
|
subAcct: string;
|
|
1230
1119
|
label?: string;
|