okx-api 1.3.6 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -11
- package/lib/rest-client.d.ts +523 -43
- package/lib/rest-client.js +600 -48
- package/lib/rest-client.js.map +1 -1
- package/lib/types/rest/request/account.d.ts +93 -0
- package/lib/types/rest/request/block-trading.d.ts +16 -0
- package/lib/types/rest/request/copy-trading.d.ts +117 -0
- package/lib/types/rest/request/copy-trading.js +3 -0
- package/lib/types/rest/request/copy-trading.js.map +1 -0
- package/lib/types/rest/request/funding.d.ts +7 -0
- package/lib/types/rest/request/grid-trading.d.ts +14 -0
- package/lib/types/rest/request/index.d.ts +5 -0
- package/lib/types/rest/request/index.js +5 -0
- package/lib/types/rest/request/index.js.map +1 -1
- package/lib/types/rest/request/public.d.ts +40 -0
- package/lib/types/rest/request/recurring-buy.d.ts +28 -0
- package/lib/types/rest/request/recurring-buy.js +3 -0
- package/lib/types/rest/request/recurring-buy.js.map +1 -0
- package/lib/types/rest/request/signal-bot.d.ts +97 -0
- package/lib/types/rest/request/signal-bot.js +3 -0
- package/lib/types/rest/request/signal-bot.js.map +1 -0
- package/lib/types/rest/request/simple-earn.d.ts +23 -0
- package/lib/types/rest/request/simple-earn.js +3 -0
- package/lib/types/rest/request/simple-earn.js.map +1 -0
- package/lib/types/rest/request/spread-trading.d.ts +69 -0
- package/lib/types/rest/request/spread-trading.js +3 -0
- package/lib/types/rest/request/spread-trading.js.map +1 -0
- package/lib/types/rest/request/subaccount.d.ts +21 -0
- package/lib/types/rest/request/trade.d.ts +4 -0
- package/lib/types/rest/response/index.d.ts +4 -0
- package/lib/types/rest/response/index.js +4 -0
- package/lib/types/rest/response/index.js.map +1 -1
- package/lib/types/rest/response/private-account.d.ts +113 -0
- package/lib/types/rest/response/private-block-trading.d.ts +35 -0
- package/lib/types/rest/response/private-copy-trading.d.ts +259 -0
- package/lib/types/rest/response/private-copy-trading.js +3 -0
- package/lib/types/rest/response/private-copy-trading.js.map +1 -0
- package/lib/types/rest/response/private-funding.d.ts +14 -0
- package/lib/types/rest/response/private-recurring-buy.d.ts +63 -0
- package/lib/types/rest/response/private-recurring-buy.js +3 -0
- package/lib/types/rest/response/private-recurring-buy.js.map +1 -0
- package/lib/types/rest/response/private-signal-bot.d.ts +22 -0
- package/lib/types/rest/response/private-signal-bot.js +3 -0
- package/lib/types/rest/response/private-signal-bot.js.map +1 -0
- package/lib/types/rest/response/private-spread-trading.d.ts +125 -0
- package/lib/types/rest/response/private-spread-trading.js +3 -0
- package/lib/types/rest/response/private-spread-trading.js.map +1 -0
- package/lib/types/rest/response/private-subaccount.d.ts +16 -0
- package/lib/types/rest/response/private-trade.d.ts +5 -0
- package/lib/types/rest/response/public-data.d.ts +27 -0
- package/package.json +1 -1
package/lib/rest-client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
2
|
import BaseRestClient from './util/BaseRestClient';
|
|
3
|
-
import { ContractGridDirection, GridAlgoOrderType, GridAlgoSubOrderType, InstrumentType, MarginMode, numberInString, Ticker, AmendOrderRequest, CancelAlgoOrderRequest, OrderIdRequest, ClosePositionRequest, OrderRequest, OrderHistoryRequest, FillsHistoryRequest, AlgoRecentHistoryRequest, AlgoLongHistoryRequest, PaginatedSymbolRequest, OrderResult, CancelledOrderResult, AmendedOrder, ClosedPositions, OrderDetails, OrderListItem, HistoricOrder, OrderFill, AlgoOrderResult, AlgoOrderListItem, HistoricAlgoOrder, BlockCounterParty, CreateBlockRFQRequest, CreateRFQResult, CancelBlockRFQRequest, CancelBlockQuoteResult, CancelMultipleBlockRFQRequest, TimestampObject, ExecuteBlockQuoteResult, ExecuteBlockQuoteRequest, CreateBlockQuoteRequest, CreateBlockQuoteResult, CancelBlockRFQResult, CancelBlockQuoteRequest, CancelMultipleBlockQuoteRequest, BlockRFQResult, GetBlockRFQSParams, GetBlockQuoteParams, GetBlockQuoteResult, FundingCurrency, FundingBalance, AccountAssetValuation, FundTransferResult, FundTransferState, AssetBillDetails, AccountBalance, GetPositionsParams, AccountPosition, GetHistoricPositionParams, HistoricAccountPosition, AccountPositionRisk, AccountBill, AccountConfiguration, AccountPositionModeResult, AccountLeverageResult, AccountMaxOrderAmount, AccountMaxTradableAmount, AccountChangeMarginResult, AccountLevel, AccountLeverage, AccountMaxLoan, AccountModeResult, AccountFeeRate, AccountIsolatedMode, AutoLoanResult, SubAccount, SubAccountAPIReset, SubAccountBalances, SubAccountTransferResult, IndexTicker, OrderBook, Candle, CandleNoVolume, Trade, Pagination, APIResponse, GetGridAlgoOrdersRequest, FundsTransferRequest, WithdrawRequest, WithdrawResponse, ConvertTradeRequest, ConvertQuoteEstimateRequest, SetLeverageRequest, ChangePositionMarginRequest, SubAccountTransferRequest, GridAlgoOrderRequest, StopGridAlgoOrderRequest, APICredentials, RestClientOptions, APIMarket, Instrument, PosMode, AlgoOrderDetailsRequest, AlgoOrderDetailsResult, AmendAlgoOrderRequest, AmendAlgoOrderResult, AlgoOrderRequest, EconomicCalendarData, UnitConvertData, EconomicCalendarRequest, UnitConvertRequest, PositionSide, AdjustLeverageInfo, InterestAccrued, InterestRate, Greeks, AccountRiskState, SystemTime, MaxWithdrawal, WithdrawalHistoryRequest, FundingRateRequest } from './types';
|
|
3
|
+
import { ContractGridDirection, GridAlgoOrderType, GridAlgoSubOrderType, InstrumentType, MarginMode, numberInString, Ticker, AmendOrderRequest, CancelAlgoOrderRequest, OrderIdRequest, ClosePositionRequest, OrderRequest, OrderHistoryRequest, FillsHistoryRequest, AlgoRecentHistoryRequest, AlgoLongHistoryRequest, PaginatedSymbolRequest, OrderResult, CancelledOrderResult, AmendedOrder, ClosedPositions, OrderDetails, OrderListItem, HistoricOrder, OrderFill, AlgoOrderResult, AlgoOrderListItem, HistoricAlgoOrder, BlockCounterParty, CreateBlockRFQRequest, CreateRFQResult, CancelBlockRFQRequest, CancelBlockQuoteResult, CancelMultipleBlockRFQRequest, TimestampObject, ExecuteBlockQuoteResult, ExecuteBlockQuoteRequest, CreateBlockQuoteRequest, CreateBlockQuoteResult, CancelBlockRFQResult, CancelBlockQuoteRequest, CancelMultipleBlockQuoteRequest, BlockRFQResult, GetBlockRFQSParams, GetBlockQuoteParams, GetBlockQuoteResult, FundingCurrency, FundingBalance, AccountAssetValuation, FundTransferResult, FundTransferState, AssetBillDetails, AccountBalance, GetPositionsParams, AccountPosition, GetHistoricPositionParams, HistoricAccountPosition, AccountPositionRisk, AccountBill, AccountConfiguration, AccountPositionModeResult, AccountLeverageResult, AccountMaxOrderAmount, AccountMaxTradableAmount, AccountChangeMarginResult, AccountLevel, AccountLeverage, AccountMaxLoan, AccountModeResult, AccountFeeRate, AccountIsolatedMode, AutoLoanResult, SubAccount, SubAccountAPIReset, SubAccountBalances, SubAccountTransferResult, IndexTicker, OrderBook, Candle, CandleNoVolume, Trade, Pagination, APIResponse, GetGridAlgoOrdersRequest, FundsTransferRequest, WithdrawRequest, WithdrawResponse, ConvertTradeRequest, ConvertQuoteEstimateRequest, SetLeverageRequest, ChangePositionMarginRequest, SubAccountTransferRequest, GridAlgoOrderRequest, StopGridAlgoOrderRequest, APICredentials, RestClientOptions, APIMarket, Instrument, PosMode, AlgoOrderDetailsRequest, AlgoOrderDetailsResult, AmendAlgoOrderRequest, AmendAlgoOrderResult, AlgoOrderRequest, EconomicCalendarData, UnitConvertData, EconomicCalendarRequest, UnitConvertRequest, PositionSide, AdjustLeverageInfo, InterestAccrued, InterestRate, Greeks, AccountRiskState, SystemTime, MaxWithdrawal, WithdrawalHistoryRequest, FundingRateRequest, GetInstrumentsRequest, QuickMarginBorrowRepayRequest, GetQuickMarginBorrowRepayHistoryRequest, GetVIPInterestRequest, VIPInterest, GetVIPLoanOrderListRequest, VIPLoanOrder, GetVIPLoanOrderDetailRequest, VIPLoanOrderDetail, FixedLoanBorrowingLimit, GetFixedLoanBorrowQuoteRequest, FixedLoanBorrowQuote, SubmitFixedLoanBorrowingOrderRequest, UpdateFixedLoanBorrowingOrderRequest, GetFixedLoanBorrowingOrdersListRequest, PositionBuilderRequest, SetMMPConfigRequest, MMPConfig, CancelAllAfterResponse, CloseContractGridPositionRequest, GetRSIBackTestingRequest, SubAccountMaxWithdrawal, GetSubAccountMaxWithdrawalsRequest, GetManagedSubAccountTransferHistoryRequest, ManagedSubAccountTransfer, SetSubAccountLoanAllocationRequest, NonTradableAsset, GetDepositWithdrawStatusRequest, GetPremiumHistoryRequest, GetContractOpenInterestHistoryRequest, GetContractTakerVolumeRequest, GetTopTradersContractLongShortRatioRequest, GetLendingOrderListRequest, GetLendingSubOrderListRequest, LendingOrder, CreateSignalRequest, GetSignalsRequest, CreateSignalBotRequest, AdjustMarginBalanceRequest, AmendTPSLRequest, SetSignalInstrumentsRequest, GetSignalBotRequest, GetSignalBotPositionHistoryRequest, PlaceSubOrderRequest, CancelSubOrderRequest, GetSignalBotSubOrdersRequest, GetSignalBotEventHistoryRequest, GetCurrentSubpositionsRequest, GetSubpositionsHistoryRequest, PlaceCTAlgoOrderRequest, CloseSubpositionRequest, GetCTProfitDetailsRequest, CopySettingsRequest, AmendRecurringBuyOrderRequest, GetRecurringBuyOrderListRequest, PlaceRecurringBuyOrderRequest, SetCTBatchLeverageRequest, GetCTBatchLeverageInfoRequest, GetCTHistoryLeadTradersRequest, GetLeadTraderRanksRequest, LeadTraderPnl, LeadTraderStats, GetLeadTraderStatsRequest, LeadTraderPreference, LeadTraderCurrentPosition, GetLeadTraderPositionsRequest, LeadTraderPositionHistory, GetCopyTradersRequest, GetPrivateLeadTraderRanksRequest, OptionTrade, GetOptionTradesRequest, OptionTrades, BlockMakerInstrumentSettings, SetQuoteProductsRequest, SetMmpConfigRequest, PlaceSpreadOrderRequest, PlaceSpreadOrderResponse, CancelSpreadOrderResponse, UpdateSpreadOrderRequest, UpdateSpreadOrderResponse, SpreadOrder, GetActiveSpreadOrdersRequest, GetSpreadOrderHistoryRequest, GetSpreadOrderHistoryArchiveRequest, GetSpreadTradesRequest, SpreadTrade, SpreadDetails, GetSpreadsRequest, SpreadOrderBook, SpreadTicker, PublicSpreadTrade, GetSpreadCandlesRequest, SpreadCandle, CandleRequest, AccountInstrument, SetMMPConfigResult, CreateSignalResult, GetSignalsResult, CreateSignalBotResult, CancelSignalBotsResult, RecurringBuyOrderResult, RecurringBuyOrder, RecurringBuySubOrder, SubpositionsHistory, CurrentSubposition, GetAccountConfigurationResult, GetCTBatchLeverageInfoResult, GetCTHistoryLeadTradersResult, GetCTMyLeadTradersResult, GetCTProfitDetailsResult, GetCTTotalProfitResult, GetCTUnrealizedProfitResult, GetCopySettingsResult, GetCopyTradersResult, GetCopyTradingConfigResult, GetLeadTraderRanksResult, GetPrivateLeadTraderRanksResult, PlaceCTAlgoOrderResult, SetCTBatchLeverageResult, QuickMarginBorrowRepayRecord, BlockMMPConfig, PublicBlockTrade, QuickMarginBorrowRepayResult, SetMmpConfigResult } from './types';
|
|
4
4
|
import { ASSET_BILL_TYPE } from './constants';
|
|
5
5
|
export declare class RestClient extends BaseRestClient {
|
|
6
6
|
/**
|
|
@@ -8,11 +8,6 @@ export declare class RestClient extends BaseRestClient {
|
|
|
8
8
|
*/
|
|
9
9
|
constructor(credentials?: APICredentials | null, environment?: APIMarket, restClientOptions?: RestClientOptions, requestOptions?: AxiosRequestConfig);
|
|
10
10
|
getServerTime(): Promise<number>;
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* Trade endpoints (private)
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
11
|
submitOrder(params: OrderRequest): Promise<OrderResult[]>;
|
|
17
12
|
submitMultipleOrders(params: OrderRequest[]): Promise<OrderResult[]>;
|
|
18
13
|
cancelOrder(params: OrderIdRequest): Promise<CancelledOrderResult[]>;
|
|
@@ -38,6 +33,28 @@ export declare class RestClient extends BaseRestClient {
|
|
|
38
33
|
* Get history for last 3 months
|
|
39
34
|
*/
|
|
40
35
|
getFillsHistory(params: FillsHistoryRequest): Promise<OrderFill[]>;
|
|
36
|
+
applyTransactionDetailsArchive(params: {
|
|
37
|
+
year: string;
|
|
38
|
+
quarter: 'Q1' | 'Q2' | 'Q3' | 'Q4';
|
|
39
|
+
}): Promise<{
|
|
40
|
+
result: string;
|
|
41
|
+
ts: string;
|
|
42
|
+
}[]>;
|
|
43
|
+
getTransactionDetailsArchiveLink(params: {
|
|
44
|
+
year: string;
|
|
45
|
+
quarter: 'Q1' | 'Q2' | 'Q3' | 'Q4';
|
|
46
|
+
}): Promise<any[]>;
|
|
47
|
+
cancelMassOrder(params: {
|
|
48
|
+
instType: string;
|
|
49
|
+
instFamily: string;
|
|
50
|
+
}): Promise<{
|
|
51
|
+
result: boolean;
|
|
52
|
+
}[]>;
|
|
53
|
+
cancelAllAfter(params: {
|
|
54
|
+
timeOut: string;
|
|
55
|
+
tag?: string;
|
|
56
|
+
}): Promise<CancelAllAfterResponse[]>;
|
|
57
|
+
getAccountRateLimit(): Promise<any[]>;
|
|
41
58
|
placeAlgoOrder(params: AlgoOrderRequest): Promise<AlgoOrderResult[]>;
|
|
42
59
|
getAlgoOrderDetails(params: AlgoOrderDetailsRequest): Promise<AlgoOrderDetailsResult[]>;
|
|
43
60
|
amendAlgoOrder(params: AmendAlgoOrderRequest): Promise<AmendAlgoOrderResult[]>;
|
|
@@ -81,14 +98,32 @@ export declare class RestClient extends BaseRestClient {
|
|
|
81
98
|
cancelMultipleBlockRFQs(params: CancelMultipleBlockRFQRequest): Promise<CancelBlockRFQResult[]>;
|
|
82
99
|
cancelAllRFQs(): Promise<TimestampObject[]>;
|
|
83
100
|
executeBlockQuote(params: ExecuteBlockQuoteRequest): Promise<ExecuteBlockQuoteResult[]>;
|
|
101
|
+
getQuoteProducts(): Promise<BlockMakerInstrumentSettings[]>;
|
|
102
|
+
updateBlockQuoteProducts(params: SetQuoteProductsRequest): Promise<{
|
|
103
|
+
result: boolean;
|
|
104
|
+
}[]>;
|
|
105
|
+
resetBlockMmp(): Promise<{
|
|
106
|
+
ts: string;
|
|
107
|
+
}[]>;
|
|
108
|
+
updateBlockMmpConfig(params: SetMmpConfigRequest): Promise<SetMmpConfigResult[]>;
|
|
109
|
+
getBlockMmpConfig(): Promise<BlockMMPConfig[]>;
|
|
84
110
|
createBlockQuote(params: CreateBlockQuoteRequest): Promise<CreateBlockQuoteResult[]>;
|
|
85
111
|
cancelBlockQuote(params: CancelBlockQuoteRequest): Promise<CancelBlockQuoteResult[]>;
|
|
86
112
|
cancelMultipleBlockQuotes(params: CancelMultipleBlockQuoteRequest): Promise<CancelBlockQuoteResult[]>;
|
|
87
113
|
cancelAllBlockQuotes(): Promise<TimestampObject[]>;
|
|
114
|
+
cancelAllBlockAfter(params: {
|
|
115
|
+
timeOut: string;
|
|
116
|
+
}): Promise<{
|
|
117
|
+
triggerTime: string;
|
|
118
|
+
ts: string;
|
|
119
|
+
}[]>;
|
|
88
120
|
getBlockRFQs(params?: GetBlockRFQSParams): Promise<BlockRFQResult[]>;
|
|
89
121
|
getBlockQuotes(params?: GetBlockQuoteParams): Promise<GetBlockQuoteResult[]>;
|
|
90
122
|
getBlockTrades(params?: any): Promise<any[]>;
|
|
91
123
|
getPublicRFQBlockTrades(params?: any): Promise<any[]>;
|
|
124
|
+
getBlockPublicTrades(params: {
|
|
125
|
+
instId: string;
|
|
126
|
+
}): Promise<PublicBlockTrade[]>;
|
|
92
127
|
/**
|
|
93
128
|
*
|
|
94
129
|
* Funding endpoints (private)
|
|
@@ -96,6 +131,9 @@ export declare class RestClient extends BaseRestClient {
|
|
|
96
131
|
*/
|
|
97
132
|
getCurrencies(ccy?: string): Promise<FundingCurrency[]>;
|
|
98
133
|
getBalances(ccy?: string): Promise<FundingBalance[]>;
|
|
134
|
+
getNonTradableAssets(params?: {
|
|
135
|
+
ccy?: string;
|
|
136
|
+
}): Promise<NonTradableAsset[]>;
|
|
99
137
|
getAccountAssetValuation(ccy?: string): Promise<AccountAssetValuation[]>;
|
|
100
138
|
fundsTransfer(params: FundsTransferRequest): Promise<FundTransferResult[]>;
|
|
101
139
|
/** Either parameter transId or clientId is required. */
|
|
@@ -119,7 +157,15 @@ export declare class RestClient extends BaseRestClient {
|
|
|
119
157
|
submitWithdrawLightning(ccy: string, invoice: string, memo?: string): Promise<any[]>;
|
|
120
158
|
cancelWithdrawal(wdId: string): Promise<any[]>;
|
|
121
159
|
getWithdrawalHistory(params?: WithdrawalHistoryRequest): Promise<any[]>;
|
|
160
|
+
getDepositWithdrawStatus(params: GetDepositWithdrawStatusRequest): Promise<any[]>;
|
|
122
161
|
smallAssetsConvert(ccy: string[]): Promise<any[]>;
|
|
162
|
+
getExchanges(): Promise<any[]>;
|
|
163
|
+
applyForMonthlyStatement(params?: {
|
|
164
|
+
month?: string;
|
|
165
|
+
}): Promise<any[]>;
|
|
166
|
+
getMonthlyStatement(params: {
|
|
167
|
+
month: string;
|
|
168
|
+
}): Promise<any[]>;
|
|
123
169
|
getSavingBalance(ccy?: string): Promise<any[]>;
|
|
124
170
|
savingsPurchaseRedemption(ccy: string, amt: numberInString, side: 'purchase' | 'redempt', rate: numberInString): Promise<any[]>;
|
|
125
171
|
setLendingRate(ccy: string, rate: numberInString): Promise<any[]>;
|
|
@@ -141,6 +187,7 @@ export declare class RestClient extends BaseRestClient {
|
|
|
141
187
|
* Account endpoints (private)
|
|
142
188
|
*
|
|
143
189
|
*/
|
|
190
|
+
getAccountInstruments(params: GetInstrumentsRequest): Promise<AccountInstrument[]>;
|
|
144
191
|
getBalance(ccy?: string): Promise<AccountBalance[]>;
|
|
145
192
|
getPositions(params?: GetPositionsParams): Promise<AccountPosition[]>;
|
|
146
193
|
getPositionsHistory(params?: GetHistoricPositionParams): Promise<HistoricAccountPosition[]>;
|
|
@@ -200,19 +247,70 @@ export declare class RestClient extends BaseRestClient {
|
|
|
200
247
|
setIsolatedMode(isoMode: 'automatic' | 'autonomy', type: 'MARGIN' | 'CONTRACTS'): Promise<AccountIsolatedMode[]>;
|
|
201
248
|
getMaxWithdrawals(ccy?: string): Promise<MaxWithdrawal[]>;
|
|
202
249
|
getAccountRiskState(): Promise<AccountRiskState[]>;
|
|
250
|
+
submitQuickMarginBorrowRepay(params: QuickMarginBorrowRepayRequest): Promise<QuickMarginBorrowRepayResult[]>;
|
|
251
|
+
getQuickMarginBorrowRepayHistory(params: GetQuickMarginBorrowRepayHistoryRequest): Promise<QuickMarginBorrowRepayRecord[]>;
|
|
203
252
|
borrowRepayVIPLoan(ccy: string, side: 'borrow' | 'repay', amt: numberInString, ordId?: string): Promise<any[]>;
|
|
204
253
|
getVIPLoanBorrowRepayHistory(params?: any): Promise<any[]>;
|
|
254
|
+
getVIPInterestAccrued(params: GetVIPInterestRequest): Promise<VIPInterest[]>;
|
|
255
|
+
getVIPInterestDeducted(params: GetVIPInterestRequest): Promise<VIPInterest[]>;
|
|
256
|
+
getVIPLoanOrders(params: GetVIPLoanOrderListRequest): Promise<VIPLoanOrder[]>;
|
|
257
|
+
getVIPLoanOrder(params: GetVIPLoanOrderDetailRequest): Promise<VIPLoanOrderDetail[]>;
|
|
205
258
|
getBorrowInterestLimits(params?: {
|
|
206
259
|
type?: '1' | '2';
|
|
207
260
|
ccy?: string;
|
|
208
261
|
}): Promise<any[]>;
|
|
209
|
-
|
|
262
|
+
getFixedLoanBorrowLimit(): Promise<FixedLoanBorrowingLimit[]>;
|
|
263
|
+
getFixedLoanBorrowQuote(params: GetFixedLoanBorrowQuoteRequest): Promise<FixedLoanBorrowQuote[]>;
|
|
264
|
+
submitFixedLoanBorrowOrder(params: SubmitFixedLoanBorrowingOrderRequest): Promise<{
|
|
265
|
+
ordId: string;
|
|
266
|
+
}[]>;
|
|
267
|
+
updateFixedLoanBorrowOrder(params: UpdateFixedLoanBorrowingOrderRequest): Promise<{
|
|
268
|
+
ordId: string;
|
|
269
|
+
}[]>;
|
|
270
|
+
manualRenewFixedLoanBorrowOrder(params: {
|
|
271
|
+
ordId: string;
|
|
272
|
+
maxRate: string;
|
|
273
|
+
}): Promise<{
|
|
274
|
+
ordId: string;
|
|
275
|
+
}[]>;
|
|
276
|
+
repayFixedLoanBorrowOrder(params: {
|
|
277
|
+
ordId: string;
|
|
278
|
+
}): Promise<{
|
|
279
|
+
ordId: string;
|
|
280
|
+
}[]>;
|
|
281
|
+
getFixedLoanBorrowOrders(params: GetFixedLoanBorrowingOrdersListRequest): Promise<any[]>;
|
|
282
|
+
positionBuilder(params: PositionBuilderRequest): Promise<any[]>;
|
|
283
|
+
updateRiskOffsetAmount(params: {
|
|
284
|
+
ccy: string;
|
|
285
|
+
clSpotInUseAmt: string;
|
|
286
|
+
}): Promise<{
|
|
287
|
+
ccy: string;
|
|
288
|
+
clSpotInUseAmt: string;
|
|
289
|
+
}[]>;
|
|
210
290
|
getGreeks(ccy?: string): Promise<any[]>;
|
|
211
291
|
getPMLimitation(params: {
|
|
212
292
|
instType: 'SWAP' | 'FUTURES' | 'OPTION';
|
|
213
293
|
uly?: string;
|
|
214
294
|
instFamily?: string;
|
|
215
295
|
}): Promise<any[]>;
|
|
296
|
+
updateRiskOffsetType(params: {
|
|
297
|
+
type: '1' | '2' | '3' | '4';
|
|
298
|
+
}): Promise<{
|
|
299
|
+
type: '1' | '2' | '3' | '4';
|
|
300
|
+
}[]>;
|
|
301
|
+
activateOption(): Promise<{
|
|
302
|
+
ts: string;
|
|
303
|
+
}[]>;
|
|
304
|
+
resetMMPStatus(params: {
|
|
305
|
+
instType?: 'OPTION';
|
|
306
|
+
instFamily: string;
|
|
307
|
+
}): Promise<{
|
|
308
|
+
result: boolean;
|
|
309
|
+
}[]>;
|
|
310
|
+
setMMPConfig(params: SetMMPConfigRequest): Promise<SetMMPConfigResult[]>;
|
|
311
|
+
getMMPConfig(params?: {
|
|
312
|
+
instFamily?: string;
|
|
313
|
+
}): Promise<MMPConfig[]>;
|
|
216
314
|
/**
|
|
217
315
|
*
|
|
218
316
|
* SubAccount endpoints (private)
|
|
@@ -230,6 +328,7 @@ export declare class RestClient extends BaseRestClient {
|
|
|
230
328
|
getSubAccountBalances(subAcct: string): Promise<SubAccountBalances[]>;
|
|
231
329
|
/** Get sub-account funding balance */
|
|
232
330
|
getSubAccountFundingBalances(subAcct: string, ccy?: string): Promise<FundingBalance[]>;
|
|
331
|
+
getSubAccountMaxWithdrawal(params: GetSubAccountMaxWithdrawalsRequest): Promise<SubAccountMaxWithdrawal[]>;
|
|
233
332
|
/** History of sub-account transfer */
|
|
234
333
|
getSubAccountTransferHistory(params?: {
|
|
235
334
|
ccy?: string;
|
|
@@ -239,12 +338,20 @@ export declare class RestClient extends BaseRestClient {
|
|
|
239
338
|
before?: string;
|
|
240
339
|
limit?: string;
|
|
241
340
|
}): Promise<any[]>;
|
|
341
|
+
getManagedSubAccountTransferHistory(params: GetManagedSubAccountTransferHistoryRequest): Promise<ManagedSubAccountTransfer[]>;
|
|
242
342
|
/** Master accounts manage the transfers between sub-accounts */
|
|
243
343
|
transferSubAccountBalance(params: SubAccountTransferRequest): Promise<SubAccountTransferResult[]>;
|
|
244
344
|
/** Set Permission Of Transfer Out */
|
|
245
345
|
setSubAccountTransferOutPermission(subAcct: string, canTransOut?: boolean): Promise<any[]>;
|
|
246
346
|
/** Get custody trading sub-account list */
|
|
247
347
|
getSubAccountCustodyTradingList(subAcct?: string): Promise<any[]>;
|
|
348
|
+
setSubAccountLoanAllocation(params: SetSubAccountLoanAllocationRequest): Promise<{
|
|
349
|
+
result: boolean;
|
|
350
|
+
}[]>;
|
|
351
|
+
getSubAccountBorrowInterestAndLimit(params: {
|
|
352
|
+
subAcct: string;
|
|
353
|
+
ccy?: string;
|
|
354
|
+
}): Promise<any[]>;
|
|
248
355
|
/**
|
|
249
356
|
*
|
|
250
357
|
* Grid trading endpoints (private)
|
|
@@ -256,6 +363,17 @@ export declare class RestClient extends BaseRestClient {
|
|
|
256
363
|
tpTriggerPx?: numberInString;
|
|
257
364
|
}): Promise<any[]>;
|
|
258
365
|
stopGridAlgoOrder(orders: StopGridAlgoOrderRequest[]): Promise<any[]>;
|
|
366
|
+
closeGridContractPosition(params: CloseContractGridPositionRequest): Promise<any[]>;
|
|
367
|
+
cancelGridContractCloseOrder(params: {
|
|
368
|
+
algoId: string;
|
|
369
|
+
ordId: string;
|
|
370
|
+
}): Promise<any[]>;
|
|
371
|
+
instantTriggerGridAlgoOrder(params: {
|
|
372
|
+
algoId: string;
|
|
373
|
+
}): Promise<{
|
|
374
|
+
algoId: string;
|
|
375
|
+
algoClOrdId: string;
|
|
376
|
+
}[]>;
|
|
259
377
|
getGridAlgoOrderList(params: GetGridAlgoOrdersRequest): Promise<any[]>;
|
|
260
378
|
getGridAlgoOrderHistory(params: GetGridAlgoOrdersRequest): Promise<any[]>;
|
|
261
379
|
getGridAlgoOrderDetails(algoOrdType: GridAlgoOrderType, algoId: string): Promise<any[]>;
|
|
@@ -272,43 +390,20 @@ export declare class RestClient extends BaseRestClient {
|
|
|
272
390
|
amt?: numberInString;
|
|
273
391
|
percent?: numberInString;
|
|
274
392
|
}): Promise<any[]>;
|
|
393
|
+
adjustGridInvestment(params: {
|
|
394
|
+
algoId: string;
|
|
395
|
+
amt: string;
|
|
396
|
+
}): Promise<{
|
|
397
|
+
algoId: string;
|
|
398
|
+
}[]>;
|
|
275
399
|
getGridAIParameter(algoOrdType: GridAlgoOrderType, instId: string, direction: ContractGridDirection, duration?: '7D' | '30D' | '180D'): Promise<any[]>;
|
|
276
|
-
|
|
277
|
-
*
|
|
278
|
-
* Earn/staking endpoints (private)
|
|
279
|
-
*
|
|
280
|
-
*/
|
|
281
|
-
/** Get earn offers */
|
|
282
|
-
getStakingOffers(params?: {
|
|
283
|
-
productId?: string;
|
|
284
|
-
protocolType?: 'staking' | 'defi';
|
|
285
|
-
ccy?: string;
|
|
286
|
-
}): Promise<APIResponse<any>>;
|
|
287
|
-
/** Earn/staking purchase */
|
|
288
|
-
submitStake(productId: string, investData: {
|
|
289
|
-
ccy: string;
|
|
400
|
+
computeGridMinInvestment(params: {
|
|
290
401
|
amt: string;
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
/** Earn/staking get active orders */
|
|
297
|
-
getActiveStakingOrders(params?: {
|
|
298
|
-
productId?: string;
|
|
299
|
-
protocolType?: 'staking' | 'defi';
|
|
300
|
-
ccy?: string;
|
|
301
|
-
state?: '8' | '13' | '9' | '1' | '2';
|
|
302
|
-
}): Promise<APIResponse<any>>;
|
|
303
|
-
/** Earn/staking get order history */
|
|
304
|
-
getStakingOrderHistory(params?: {
|
|
305
|
-
productId?: string;
|
|
306
|
-
protocolType?: string;
|
|
307
|
-
ccy?: string;
|
|
308
|
-
after?: string;
|
|
309
|
-
before?: string;
|
|
310
|
-
limit?: string;
|
|
311
|
-
}): Promise<APIResponse<any>>;
|
|
402
|
+
ccy: string;
|
|
403
|
+
}): Promise<any[]>;
|
|
404
|
+
getRSIBackTesting(params: GetRSIBackTestingRequest): Promise<{
|
|
405
|
+
triggerNum: string;
|
|
406
|
+
}[]>;
|
|
312
407
|
/**
|
|
313
408
|
*
|
|
314
409
|
* Market data endpoints (public)
|
|
@@ -321,12 +416,70 @@ export declare class RestClient extends BaseRestClient {
|
|
|
321
416
|
instId?: string;
|
|
322
417
|
}): Promise<IndexTicker[]>;
|
|
323
418
|
getOrderBook(instId: string, sz?: numberInString): Promise<OrderBook[]>;
|
|
419
|
+
getFullOrderBook(params: {
|
|
420
|
+
instId: string;
|
|
421
|
+
sz?: string;
|
|
422
|
+
}): Promise<OrderBook[]>;
|
|
423
|
+
/**
|
|
424
|
+
* @deprecated this method's parameters will change to an object in the next release. Use getCandlesV2 instead.
|
|
425
|
+
*
|
|
426
|
+
* @param instId
|
|
427
|
+
* @param bar
|
|
428
|
+
* @param pagination
|
|
429
|
+
* @returns
|
|
430
|
+
*/
|
|
324
431
|
getCandles(instId: string, bar?: string, pagination?: Pagination): Promise<Candle[]>;
|
|
432
|
+
getCandlesV2(params: CandleRequest): Promise<Candle[]>;
|
|
433
|
+
/**
|
|
434
|
+
* @deprecated this method's parameters will change to an object in the next release. Use getHistoricCandlesV2 instead.
|
|
435
|
+
*
|
|
436
|
+
* @param instId
|
|
437
|
+
* @param bar
|
|
438
|
+
* @param pagination
|
|
439
|
+
* @returns
|
|
440
|
+
*/
|
|
325
441
|
getHistoricCandles(instId: string, bar?: string, pagination?: Pagination): Promise<Candle[]>;
|
|
442
|
+
getHistoricCandlesV2(params: CandleRequest): Promise<Candle[]>;
|
|
443
|
+
/**
|
|
444
|
+
* @deprecated this method's parameters will change to an object in the next release. Use getIndexCandlesV2 instead.
|
|
445
|
+
*
|
|
446
|
+
* @param instId
|
|
447
|
+
* @param bar
|
|
448
|
+
* @param pagination
|
|
449
|
+
* @returns
|
|
450
|
+
*/
|
|
326
451
|
getIndexCandles(instId: string, bar?: string, pagination?: Pagination): Promise<CandleNoVolume[]>;
|
|
452
|
+
getIndexCandlesV2(params: CandleRequest): Promise<CandleNoVolume[]>;
|
|
453
|
+
/**
|
|
454
|
+
* @deprecated this method's parameters will change to an object in the next release. Use getHistoricIndexCandlesV2 instead.
|
|
455
|
+
*
|
|
456
|
+
* @param instId
|
|
457
|
+
* @param bar
|
|
458
|
+
* @param pagination
|
|
459
|
+
* @returns
|
|
460
|
+
*/
|
|
327
461
|
getHistoricIndexCandles(instId: string, bar?: string, pagination?: Pagination): Promise<CandleNoVolume[]>;
|
|
462
|
+
getHistoricIndexCandlesV2(params: CandleRequest): Promise<CandleNoVolume[]>;
|
|
463
|
+
/**
|
|
464
|
+
* @deprecated this method's parameters will change to an object in the next release. Use getMarkPriceCandlesV2 instead.
|
|
465
|
+
*
|
|
466
|
+
* @param instId
|
|
467
|
+
* @param bar
|
|
468
|
+
* @param pagination
|
|
469
|
+
* @returns
|
|
470
|
+
*/
|
|
328
471
|
getMarkPriceCandles(instId: string, bar?: string, pagination?: Pagination): Promise<CandleNoVolume[]>;
|
|
472
|
+
getMarkPriceCandlesV2(params: CandleRequest): Promise<CandleNoVolume[]>;
|
|
473
|
+
/**
|
|
474
|
+
* @deprecated this method's parameters will change to an object in the next release. Use getHistoricMarkPriceCandlesV2 instead.
|
|
475
|
+
*
|
|
476
|
+
* @param instId
|
|
477
|
+
* @param bar
|
|
478
|
+
* @param pagination
|
|
479
|
+
* @returns
|
|
480
|
+
*/
|
|
329
481
|
getHistoricMarkPriceCandles(instId: string, bar?: string, pagination?: Pagination): Promise<CandleNoVolume[]>;
|
|
482
|
+
getHistoricMarkPriceCandlesV2(params: CandleRequest): Promise<CandleNoVolume[]>;
|
|
330
483
|
getTrades(instId: string, limit?: number): Promise<Trade[]>;
|
|
331
484
|
getHistoricTrades(instId: string, pagination?: {
|
|
332
485
|
after?: numberInString;
|
|
@@ -334,12 +487,19 @@ export declare class RestClient extends BaseRestClient {
|
|
|
334
487
|
limit?: numberInString;
|
|
335
488
|
type?: '1' | '2';
|
|
336
489
|
}): Promise<Trade[]>;
|
|
490
|
+
getOptionTradesByInstrument(params: {
|
|
491
|
+
instFamily: string;
|
|
492
|
+
}): Promise<OptionTrade[]>;
|
|
493
|
+
getOptionTrades(params: GetOptionTradesRequest): Promise<OptionTrades[]>;
|
|
337
494
|
get24hrTotalVolume(): Promise<any[]>;
|
|
338
495
|
getOracle(): Promise<any[]>;
|
|
339
496
|
getExchangeRate(): Promise<any[]>;
|
|
340
497
|
getIndexComponents(index: string): Promise<any[]>;
|
|
341
498
|
getBlockTickers(instType: InstrumentType, uly?: string): Promise<any[]>;
|
|
342
499
|
getBlockTicker(instId: string): Promise<any[]>;
|
|
500
|
+
/**
|
|
501
|
+
* @deprecated
|
|
502
|
+
*/
|
|
343
503
|
getPublicBlockTrades(instId: string): Promise<any[]>;
|
|
344
504
|
/**
|
|
345
505
|
*
|
|
@@ -364,6 +524,11 @@ export declare class RestClient extends BaseRestClient {
|
|
|
364
524
|
getUnderlying(params: any): Promise<any[]>;
|
|
365
525
|
getInsuranceFund(params: any): Promise<any[]>;
|
|
366
526
|
getUnitConvert(params: UnitConvertRequest): Promise<UnitConvertData[]>;
|
|
527
|
+
getOptionTickBands(params: {
|
|
528
|
+
instType: string;
|
|
529
|
+
instFamily?: string;
|
|
530
|
+
}): Promise<any[]>;
|
|
531
|
+
getPremiumHistory(params: GetPremiumHistoryRequest): Promise<any[]>;
|
|
367
532
|
getEconomicCalendar(params: EconomicCalendarRequest): Promise<EconomicCalendarData[]>;
|
|
368
533
|
/**
|
|
369
534
|
*
|
|
@@ -371,13 +536,24 @@ export declare class RestClient extends BaseRestClient {
|
|
|
371
536
|
*
|
|
372
537
|
*/
|
|
373
538
|
getSupportCoin(): Promise<any[]>;
|
|
374
|
-
|
|
539
|
+
getOpenInterestHistory(params: GetContractOpenInterestHistoryRequest): Promise<any[]>;
|
|
540
|
+
getTakerVolume(params: {
|
|
541
|
+
instType: string;
|
|
542
|
+
ccy: string;
|
|
543
|
+
period?: string;
|
|
544
|
+
end?: string;
|
|
545
|
+
begin?: string;
|
|
546
|
+
}): Promise<any[]>;
|
|
547
|
+
getContractTakerVolume(params: GetContractTakerVolumeRequest): Promise<any[]>;
|
|
375
548
|
getMarginLendingRatio(params: {
|
|
376
549
|
ccy: string;
|
|
377
550
|
begin?: numberInString;
|
|
378
551
|
end?: numberInString;
|
|
379
552
|
period: '5m' | '1H' | '1D';
|
|
380
553
|
}): Promise<any[]>;
|
|
554
|
+
getTopTradersAccountRatio(params: GetTopTradersContractLongShortRatioRequest): Promise<any[]>;
|
|
555
|
+
getTopTradersContractPositionRatio(params: GetTopTradersContractLongShortRatioRequest): Promise<any[]>;
|
|
556
|
+
getLongShortContractRatio(params: GetTopTradersContractLongShortRatioRequest): Promise<any[]>;
|
|
381
557
|
getLongShortRatio(params: {
|
|
382
558
|
ccy: string;
|
|
383
559
|
begin?: numberInString;
|
|
@@ -411,6 +587,306 @@ export declare class RestClient extends BaseRestClient {
|
|
|
411
587
|
ccy: string;
|
|
412
588
|
period: '8H' | '1D';
|
|
413
589
|
}): Promise<any[]>;
|
|
590
|
+
/**
|
|
591
|
+
*
|
|
592
|
+
* FINANCIAL PRODUCT - On-chain earn endpoints
|
|
593
|
+
*
|
|
594
|
+
*/
|
|
595
|
+
/** Get earn offers */
|
|
596
|
+
getStakingOffers(params?: {
|
|
597
|
+
productId?: string;
|
|
598
|
+
protocolType?: 'staking' | 'defi';
|
|
599
|
+
ccy?: string;
|
|
600
|
+
}): Promise<any[]>;
|
|
601
|
+
/** Earn/staking purchase */
|
|
602
|
+
submitStake(productId: string, investData: {
|
|
603
|
+
ccy: string;
|
|
604
|
+
amt: string;
|
|
605
|
+
}[], term?: string): Promise<any[]>;
|
|
606
|
+
/** Earn/staking redeem */
|
|
607
|
+
redeemStake(ordId: string, protocolType: 'staking' | 'defi', allowEarlyRedeem?: boolean): Promise<any[]>;
|
|
608
|
+
/** Earn/staking cancel purchases/redemptions */
|
|
609
|
+
cancelStakingRequest(ordId: string, protocolType: 'staking' | 'defi'): Promise<any[]>;
|
|
610
|
+
/** Earn/staking get active orders */
|
|
611
|
+
getActiveStakingOrders(params?: {
|
|
612
|
+
productId?: string;
|
|
613
|
+
protocolType?: 'staking' | 'defi';
|
|
614
|
+
ccy?: string;
|
|
615
|
+
state?: '8' | '13' | '9' | '1' | '2';
|
|
616
|
+
}): Promise<any[]>;
|
|
617
|
+
/** Earn/staking get order history */
|
|
618
|
+
getStakingOrderHistory(params?: {
|
|
619
|
+
productId?: string;
|
|
620
|
+
protocolType?: string;
|
|
621
|
+
ccy?: string;
|
|
622
|
+
after?: string;
|
|
623
|
+
before?: string;
|
|
624
|
+
limit?: string;
|
|
625
|
+
}): Promise<any[]>;
|
|
626
|
+
/**
|
|
627
|
+
*
|
|
628
|
+
* FINANCIAL PRODUCT - ETH staking endpoints
|
|
629
|
+
*
|
|
630
|
+
*/
|
|
631
|
+
purchaseETHStaking(params: {
|
|
632
|
+
amt: string;
|
|
633
|
+
}): Promise<any[]>;
|
|
634
|
+
redeemETHStaking(params: {
|
|
635
|
+
amt: string;
|
|
636
|
+
}): Promise<any[]>;
|
|
637
|
+
getETHStakingBalance(): Promise<any[]>;
|
|
638
|
+
getETHStakingHistory(params: {
|
|
639
|
+
type: 'purchase' | 'redeem';
|
|
640
|
+
status?: 'pending' | 'success' | 'failed';
|
|
641
|
+
after?: string;
|
|
642
|
+
before?: string;
|
|
643
|
+
limit?: string;
|
|
644
|
+
}): Promise<any[]>;
|
|
645
|
+
getAPYHistory(params: {
|
|
646
|
+
days: string;
|
|
647
|
+
}): Promise<any[]>;
|
|
648
|
+
/**
|
|
649
|
+
*
|
|
650
|
+
* Simple earn fixed endpoints
|
|
651
|
+
*
|
|
652
|
+
*/
|
|
653
|
+
getLendingOffers(params?: {
|
|
654
|
+
ccy?: string;
|
|
655
|
+
term?: string;
|
|
656
|
+
}): Promise<any[]>;
|
|
657
|
+
getLendingAPYHistory(params: {
|
|
658
|
+
ccy: string;
|
|
659
|
+
term: string;
|
|
660
|
+
}): Promise<any[]>;
|
|
661
|
+
getLendingVolume(params: {
|
|
662
|
+
ccy: string;
|
|
663
|
+
term: string;
|
|
664
|
+
}): Promise<any[]>;
|
|
665
|
+
placeLendingOrder(params: LendingOrder): Promise<any[]>;
|
|
666
|
+
amendLendingOrder(params: LendingOrder): Promise<any[]>;
|
|
667
|
+
getLendingOrders(params: GetLendingOrderListRequest): Promise<any[]>;
|
|
668
|
+
getLendingSubOrders(params: GetLendingSubOrderListRequest): Promise<any[]>;
|
|
669
|
+
/**
|
|
670
|
+
*
|
|
671
|
+
* Signal bot trading endpoints
|
|
672
|
+
*
|
|
673
|
+
*/
|
|
674
|
+
createSignal(params: CreateSignalRequest): Promise<CreateSignalResult[]>;
|
|
675
|
+
getSignals(params: GetSignalsRequest): Promise<GetSignalsResult[]>;
|
|
676
|
+
createSignalBot(params: CreateSignalBotRequest): Promise<CreateSignalBotResult[]>;
|
|
677
|
+
cancelSignalBots(params: {
|
|
678
|
+
algoId: string;
|
|
679
|
+
}): Promise<CancelSignalBotsResult[]>;
|
|
680
|
+
updateSignalMargin(params: AdjustMarginBalanceRequest): Promise<{
|
|
681
|
+
algoId: string;
|
|
682
|
+
}[]>;
|
|
683
|
+
updateSignalTPSL(params: AmendTPSLRequest): Promise<{
|
|
684
|
+
algoId: string;
|
|
685
|
+
}[]>;
|
|
686
|
+
setSignalInstruments(params: SetSignalInstrumentsRequest): Promise<{
|
|
687
|
+
algoId: string;
|
|
688
|
+
}[]>;
|
|
689
|
+
getSignalBotOrder(params: {
|
|
690
|
+
algoOrdType: string;
|
|
691
|
+
algoId: string;
|
|
692
|
+
}): Promise<any[]>;
|
|
693
|
+
getActiveSignalBot(params: GetSignalBotRequest): Promise<any[]>;
|
|
694
|
+
getSignalBotHistory(params: GetSignalBotRequest): Promise<any[]>;
|
|
695
|
+
getSignalBotPositions(params: {
|
|
696
|
+
algoOrdType: string;
|
|
697
|
+
algoId: string;
|
|
698
|
+
}): Promise<any[]>;
|
|
699
|
+
getSignalBotPositionHistory(params: GetSignalBotPositionHistoryRequest): Promise<any[]>;
|
|
700
|
+
closeSignalBotPosition(params: {
|
|
701
|
+
algoId: string;
|
|
702
|
+
instId: string;
|
|
703
|
+
}): Promise<{
|
|
704
|
+
algoId: string;
|
|
705
|
+
}[]>;
|
|
706
|
+
placeSignalBotSubOrder(params: PlaceSubOrderRequest): Promise<any[]>;
|
|
707
|
+
cancelSubOrder(params: CancelSubOrderRequest): Promise<any[]>;
|
|
708
|
+
getSignalBotSubOrders(params: GetSignalBotSubOrdersRequest): Promise<any[]>;
|
|
709
|
+
getSignalBotEventHistory(params: GetSignalBotEventHistoryRequest): Promise<any[]>;
|
|
710
|
+
/**
|
|
711
|
+
*
|
|
712
|
+
* Recurring buy endpoints
|
|
713
|
+
*
|
|
714
|
+
*/
|
|
715
|
+
submitRecurringBuyOrder(params: PlaceRecurringBuyOrderRequest): Promise<RecurringBuyOrderResult[]>;
|
|
716
|
+
amendRecurringBuyOrder(params: AmendRecurringBuyOrderRequest): Promise<RecurringBuyOrderResult[]>;
|
|
717
|
+
stopRecurringBuyOrder(params: {
|
|
718
|
+
algoId: string;
|
|
719
|
+
}): Promise<RecurringBuyOrderResult[]>;
|
|
720
|
+
getRecurringBuyOrders(params: GetRecurringBuyOrderListRequest): Promise<RecurringBuyOrder[]>;
|
|
721
|
+
getRecurringBuyOrderHistory(params: GetRecurringBuyOrderListRequest): Promise<RecurringBuyOrder[]>;
|
|
722
|
+
getRecurringBuyOrderDetails(params: {
|
|
723
|
+
algoId: string;
|
|
724
|
+
}): Promise<RecurringBuyOrder[]>;
|
|
725
|
+
getRecurringBuySubOrders(params: GetRecurringBuyOrderListRequest): Promise<RecurringBuySubOrder[]>;
|
|
726
|
+
/**
|
|
727
|
+
*
|
|
728
|
+
* Copy Trading endpoints
|
|
729
|
+
*
|
|
730
|
+
*/
|
|
731
|
+
getCopytradingSubpositions(params?: GetCurrentSubpositionsRequest): Promise<CurrentSubposition[]>;
|
|
732
|
+
getCopytradingSubpositionsHistory(params?: GetSubpositionsHistoryRequest): Promise<SubpositionsHistory[]>;
|
|
733
|
+
submitCopytradingAlgoOrder(params: PlaceCTAlgoOrderRequest): Promise<PlaceCTAlgoOrderResult[]>;
|
|
734
|
+
closeCopytradingSubposition(params: CloseSubpositionRequest): Promise<{
|
|
735
|
+
subPosId: string;
|
|
736
|
+
tag: string;
|
|
737
|
+
}[]>;
|
|
738
|
+
getCopytradingInstruments(params?: {
|
|
739
|
+
instType?: 'SPOT' | 'SWAP';
|
|
740
|
+
}): Promise<{
|
|
741
|
+
instId: string;
|
|
742
|
+
enabled: boolean;
|
|
743
|
+
}[]>;
|
|
744
|
+
setCopytradingInstruments(params: {
|
|
745
|
+
instType?: 'SPOT' | 'SWAP';
|
|
746
|
+
instId: string;
|
|
747
|
+
}): Promise<{
|
|
748
|
+
instId: string;
|
|
749
|
+
enabled: boolean;
|
|
750
|
+
}[]>;
|
|
751
|
+
getCopytradingProfitDetails(params?: GetCTProfitDetailsRequest): Promise<GetCTProfitDetailsResult[]>;
|
|
752
|
+
getCopytradingTotalProfit(params?: {
|
|
753
|
+
instType?: 'SPOT' | 'SWAP';
|
|
754
|
+
}): Promise<GetCTTotalProfitResult[]>;
|
|
755
|
+
getCopytradingUnrealizedProfit(params?: {
|
|
756
|
+
instType?: 'SPOT' | 'SWAP';
|
|
757
|
+
}): Promise<GetCTUnrealizedProfitResult[]>;
|
|
758
|
+
getCopytradingTotalUnrealizedProfit(params?: {
|
|
759
|
+
instType?: 'SWAP';
|
|
760
|
+
}): Promise<{
|
|
761
|
+
instType?: 'SWAP';
|
|
762
|
+
instId: string;
|
|
763
|
+
}[]>;
|
|
764
|
+
applyCopytradingLeadTrading(params: {
|
|
765
|
+
profitSharingTs: string;
|
|
766
|
+
totalUnrealizedProfitSharingAmt: string;
|
|
767
|
+
}): Promise<{
|
|
768
|
+
result: boolean;
|
|
769
|
+
}[]>;
|
|
770
|
+
stopCopytradingLeadTrading(params: {
|
|
771
|
+
instType?: 'SWAP';
|
|
772
|
+
}): Promise<{
|
|
773
|
+
result: boolean;
|
|
774
|
+
}[]>;
|
|
775
|
+
updateCopytradingProfitSharing(params: {
|
|
776
|
+
instType?: 'SWAP';
|
|
777
|
+
profitSharingRatio: string;
|
|
778
|
+
}): Promise<{
|
|
779
|
+
result: boolean;
|
|
780
|
+
}[]>;
|
|
781
|
+
getCopytradingAccount(): Promise<GetAccountConfigurationResult[]>;
|
|
782
|
+
setCopytradingFirstCopy(params: CopySettingsRequest): Promise<{
|
|
783
|
+
result: boolean;
|
|
784
|
+
}[]>;
|
|
785
|
+
updateCopytradingCopySettings(params: CopySettingsRequest): Promise<{
|
|
786
|
+
result: boolean;
|
|
787
|
+
}[]>;
|
|
788
|
+
stopCopytradingCopy(params: {
|
|
789
|
+
instType?: 'SWAP';
|
|
790
|
+
uniqueCode: string;
|
|
791
|
+
subPosCloseType: 'market_close' | 'copy_close' | 'manual_close';
|
|
792
|
+
}): Promise<{
|
|
793
|
+
result: boolean;
|
|
794
|
+
}[]>;
|
|
795
|
+
getCopytradingCopySettings(params: {
|
|
796
|
+
instType?: 'SWAP';
|
|
797
|
+
uniqueCode: string;
|
|
798
|
+
}): Promise<GetCopySettingsResult[]>;
|
|
799
|
+
getCopytradingBatchLeverageInfo(params: GetCTBatchLeverageInfoRequest): Promise<GetCTBatchLeverageInfoResult[]>;
|
|
800
|
+
setCopytradingBatchLeverage(params: SetCTBatchLeverageRequest): Promise<SetCTBatchLeverageResult[]>;
|
|
801
|
+
getCopytradingMyLeadTraders(params?: {
|
|
802
|
+
instType?: 'SWAP';
|
|
803
|
+
}): Promise<GetCTMyLeadTradersResult[]>;
|
|
804
|
+
getCopytradingLeadTradersHistory(params?: GetCTHistoryLeadTradersRequest): Promise<GetCTHistoryLeadTradersResult[]>;
|
|
805
|
+
getCopytradingConfig(params?: {
|
|
806
|
+
instType?: 'SWAP';
|
|
807
|
+
}): Promise<GetCopyTradingConfigResult[]>;
|
|
808
|
+
getCopytradingLeadRanks(params?: GetLeadTraderRanksRequest): Promise<GetLeadTraderRanksResult[]>;
|
|
809
|
+
getCopytradingLeadWeeklyPnl(params: {
|
|
810
|
+
instType?: 'SWAP';
|
|
811
|
+
uniqueCode: string;
|
|
812
|
+
}): Promise<LeadTraderPnl[]>;
|
|
813
|
+
getCopytradingLeadDailyPnl(params: GetLeadTraderStatsRequest): Promise<LeadTraderPnl[]>;
|
|
814
|
+
getCopytradingLeadStats(params: GetLeadTraderStatsRequest): Promise<LeadTraderStats[]>;
|
|
815
|
+
getCopytradingLeadPreferences(params: {
|
|
816
|
+
instType?: 'SWAP';
|
|
817
|
+
uniqueCode: string;
|
|
818
|
+
}): Promise<LeadTraderPreference[]>;
|
|
819
|
+
getCopytradingLeadOpenPositions(params: GetLeadTraderPositionsRequest): Promise<LeadTraderCurrentPosition[]>;
|
|
820
|
+
getCopytradingLeadPositionHistory(params: GetLeadTraderPositionsRequest): Promise<LeadTraderPositionHistory[]>;
|
|
821
|
+
getCopyTraders(params: GetCopyTradersRequest): Promise<GetCopyTradersResult[]>;
|
|
822
|
+
getCopytradingLeadPrivateRanks(params?: GetPrivateLeadTraderRanksRequest): Promise<GetPrivateLeadTraderRanksResult[]>;
|
|
823
|
+
getCopytradingLeadPrivateWeeklyPnl(params: {
|
|
824
|
+
instType?: 'SWAP';
|
|
825
|
+
uniqueCode: string;
|
|
826
|
+
}): Promise<LeadTraderPnl[]>;
|
|
827
|
+
getCopytradingPLeadPrivateDailyPnl(params: GetLeadTraderStatsRequest): Promise<LeadTraderPnl[]>;
|
|
828
|
+
geCopytradingLeadPrivateStats(params: GetLeadTraderStatsRequest): Promise<LeadTraderStats[]>;
|
|
829
|
+
getCopytradingLeadPrivatePreferences(params: {
|
|
830
|
+
instType?: 'SWAP';
|
|
831
|
+
uniqueCode: string;
|
|
832
|
+
}): Promise<LeadTraderPreference[]>;
|
|
833
|
+
getCopytradingLeadPrivateOpenPositions(params: GetLeadTraderPositionsRequest): Promise<LeadTraderCurrentPosition[]>;
|
|
834
|
+
getCopytradingLeadPrivatePositionHistory(params: GetLeadTraderPositionsRequest): Promise<LeadTraderPositionHistory[]>;
|
|
835
|
+
getCopyTradersPrivate(params: GetCopyTradersRequest): Promise<GetCopyTradersResult[]>;
|
|
836
|
+
/**
|
|
837
|
+
*
|
|
838
|
+
* Spread trading endpoints
|
|
839
|
+
*
|
|
840
|
+
*/
|
|
841
|
+
submitSpreadOrder(params: PlaceSpreadOrderRequest): Promise<PlaceSpreadOrderResponse[]>;
|
|
842
|
+
cancelSpreadOrder(params?: {
|
|
843
|
+
ordId?: string;
|
|
844
|
+
clOrdId?: string;
|
|
845
|
+
}): Promise<CancelSpreadOrderResponse[]>;
|
|
846
|
+
cancelAllSpreadOrders(params: {
|
|
847
|
+
sprdId?: string;
|
|
848
|
+
}): Promise<{
|
|
849
|
+
result: boolean;
|
|
850
|
+
}[]>;
|
|
851
|
+
updateSpreadOrder(params: UpdateSpreadOrderRequest): Promise<UpdateSpreadOrderResponse[]>;
|
|
852
|
+
getSpreadOrder(params: {
|
|
853
|
+
ordId?: string;
|
|
854
|
+
clOrdId?: string;
|
|
855
|
+
}): Promise<SpreadOrder[]>;
|
|
856
|
+
getSpreadActiveOrders(params?: GetActiveSpreadOrdersRequest): Promise<SpreadOrder[]>;
|
|
857
|
+
getSpreadOrdersRecent(params?: GetSpreadOrderHistoryRequest): Promise<SpreadOrder[]>;
|
|
858
|
+
getSpreadOrdersArchive(params?: GetSpreadOrderHistoryArchiveRequest): Promise<SpreadOrder[]>;
|
|
859
|
+
getSpreadTrades(params?: GetSpreadTradesRequest): Promise<SpreadTrade[]>;
|
|
860
|
+
getSpreads(params?: GetSpreadsRequest): Promise<SpreadDetails[]>;
|
|
861
|
+
getSpreadOrderBook(params: {
|
|
862
|
+
sprdId: string;
|
|
863
|
+
sz?: string;
|
|
864
|
+
}): Promise<SpreadOrderBook[]>;
|
|
865
|
+
getSpreadTicker(params: {
|
|
866
|
+
sprdId: string;
|
|
867
|
+
}): Promise<SpreadTicker[]>;
|
|
868
|
+
getSpreadPublicTrades(params?: {
|
|
869
|
+
sprdId?: string;
|
|
870
|
+
}): Promise<PublicSpreadTrade[]>;
|
|
871
|
+
getSpreadCandles(params: GetSpreadCandlesRequest): Promise<SpreadCandle[]>;
|
|
872
|
+
getSpreadHistoryCandles(params: GetSpreadCandlesRequest): Promise<SpreadCandle[]>;
|
|
873
|
+
cancelSpreadAllAfter(params: {
|
|
874
|
+
timeOut: string;
|
|
875
|
+
}): Promise<{
|
|
876
|
+
triggerTime: string;
|
|
877
|
+
ts: string;
|
|
878
|
+
}[]>;
|
|
879
|
+
/**
|
|
880
|
+
*
|
|
881
|
+
* Affiliate endpoints
|
|
882
|
+
*
|
|
883
|
+
*/
|
|
884
|
+
getInviteeDetail(params: {
|
|
885
|
+
uid: string;
|
|
886
|
+
}): Promise<any[]>;
|
|
887
|
+
getAffiliateRebateInfo(params: {
|
|
888
|
+
apiKey: string;
|
|
889
|
+
}): Promise<any[]>;
|
|
414
890
|
/**
|
|
415
891
|
*
|
|
416
892
|
* Status endpoints (public)
|
|
@@ -422,6 +898,10 @@ export declare class RestClient extends BaseRestClient {
|
|
|
422
898
|
* Broker endpoints (private)
|
|
423
899
|
*
|
|
424
900
|
*/
|
|
901
|
+
/**
|
|
902
|
+
*
|
|
903
|
+
* @deprecated
|
|
904
|
+
*/
|
|
425
905
|
getBrokerAccountInformation(): Promise<any[]>;
|
|
426
906
|
createSubAccount(params: {
|
|
427
907
|
subAcct: string;
|