okx-api 1.3.7 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/rest-client.d.ts +707 -213
- package/lib/rest-client.js +977 -409
- 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
|
/**
|
|
@@ -10,137 +10,10 @@ export declare class RestClient extends BaseRestClient {
|
|
|
10
10
|
getServerTime(): Promise<number>;
|
|
11
11
|
/**
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
submitOrder(params: OrderRequest): Promise<OrderResult[]>;
|
|
17
|
-
submitMultipleOrders(params: OrderRequest[]): Promise<OrderResult[]>;
|
|
18
|
-
cancelOrder(params: OrderIdRequest): Promise<CancelledOrderResult[]>;
|
|
19
|
-
cancelMultipleOrders(params: OrderIdRequest[]): Promise<CancelledOrderResult[]>;
|
|
20
|
-
amendOrder(params: AmendOrderRequest): Promise<AmendedOrder[]>;
|
|
21
|
-
amendMultipleOrders(params: AmendOrderRequest[]): Promise<AmendedOrder[]>;
|
|
22
|
-
closePositions(params: ClosePositionRequest): Promise<ClosedPositions[]>;
|
|
23
|
-
getOrderDetails(params: OrderIdRequest): Promise<OrderDetails[]>;
|
|
24
|
-
getOrderList(params?: OrderHistoryRequest): Promise<OrderListItem[]>;
|
|
25
|
-
/**
|
|
26
|
-
* Get history for last 7 days
|
|
27
|
-
*/
|
|
28
|
-
getOrderHistory(params: OrderHistoryRequest): Promise<HistoricOrder[]>;
|
|
29
|
-
/**
|
|
30
|
-
* Get history for last 3 months
|
|
31
|
-
*/
|
|
32
|
-
getOrderHistoryArchive(params: OrderHistoryRequest): Promise<HistoricOrder[]>;
|
|
33
|
-
/**
|
|
34
|
-
* Get history for last 7 days
|
|
35
|
-
*/
|
|
36
|
-
getFills(params?: FillsHistoryRequest): Promise<OrderFill[]>;
|
|
37
|
-
/**
|
|
38
|
-
* Get history for last 3 months
|
|
39
|
-
*/
|
|
40
|
-
getFillsHistory(params: FillsHistoryRequest): Promise<OrderFill[]>;
|
|
41
|
-
placeAlgoOrder(params: AlgoOrderRequest): Promise<AlgoOrderResult[]>;
|
|
42
|
-
getAlgoOrderDetails(params: AlgoOrderDetailsRequest): Promise<AlgoOrderDetailsResult[]>;
|
|
43
|
-
amendAlgoOrder(params: AmendAlgoOrderRequest): Promise<AmendAlgoOrderResult[]>;
|
|
44
|
-
cancelAlgoOrder(params: CancelAlgoOrderRequest[]): Promise<AlgoOrderResult[]>;
|
|
45
|
-
cancelAdvanceAlgoOrder(params: CancelAlgoOrderRequest[]): Promise<AlgoOrderResult[]>;
|
|
46
|
-
getAlgoOrderList(params: AlgoRecentHistoryRequest): Promise<AlgoOrderListItem[]>;
|
|
47
|
-
getAlgoOrderHistory(params: AlgoLongHistoryRequest): Promise<HistoricAlgoOrder[]>;
|
|
48
|
-
/** Get easy convert currency list */
|
|
49
|
-
getEasyConvertCurrencies(): Promise<any>;
|
|
50
|
-
/**
|
|
51
|
-
* Place easy convert : Convert small currencies to mainstream currencies.
|
|
52
|
-
* Only applicable to the crypto balance less than $10.
|
|
53
|
-
*
|
|
54
|
-
* Maximum 5 currencies can be selected in one order.
|
|
55
|
-
* If there are multiple currencies, separate them with commas in the "from" field.
|
|
56
|
-
*/
|
|
57
|
-
submitEasyConvert(fromCcys: string[], toCcy: string): Promise<APIResponse<any>>;
|
|
58
|
-
/** Get easy convert history : Get the history and status of easy convert trades. */
|
|
59
|
-
getEasyConvertHistory(params?: Pagination): Promise<APIResponse<any>>;
|
|
60
|
-
/**
|
|
61
|
-
* Get one-click repay currency list : Get list of debt currency data and repay currencies.
|
|
62
|
-
* Debt currencies include both cross and isolated debts.
|
|
63
|
-
*/
|
|
64
|
-
getOneClickRepayCurrencyList(debtType?: 'cross' | 'isolated'): Promise<APIResponse<any>>;
|
|
65
|
-
/**
|
|
66
|
-
* Trade one-click repay to repay cross debts.
|
|
67
|
-
* Isolated debts are not applicable.
|
|
68
|
-
* The maximum repayment amount is based on the remaining available balance of funding and trading accounts.
|
|
69
|
-
*/
|
|
70
|
-
submitOneClickRepay(debtCcys: string[], repayCcy: string): Promise<APIResponse<any>>;
|
|
71
|
-
/** Get the history and status of one-click repay trades. */
|
|
72
|
-
getOneClickRepayHistory(params?: Pagination): Promise<APIResponse<any>>;
|
|
73
|
-
/**
|
|
74
|
-
*
|
|
75
|
-
* Block trading endpoints (private)
|
|
76
|
-
*
|
|
77
|
-
*/
|
|
78
|
-
getBlockCounterParties(): Promise<BlockCounterParty[]>;
|
|
79
|
-
createBlockRFQ(params: CreateBlockRFQRequest): Promise<CreateRFQResult[]>;
|
|
80
|
-
cancelBlockRFQ(params: CancelBlockRFQRequest): Promise<CancelBlockRFQResult[]>;
|
|
81
|
-
cancelMultipleBlockRFQs(params: CancelMultipleBlockRFQRequest): Promise<CancelBlockRFQResult[]>;
|
|
82
|
-
cancelAllRFQs(): Promise<TimestampObject[]>;
|
|
83
|
-
executeBlockQuote(params: ExecuteBlockQuoteRequest): Promise<ExecuteBlockQuoteResult[]>;
|
|
84
|
-
createBlockQuote(params: CreateBlockQuoteRequest): Promise<CreateBlockQuoteResult[]>;
|
|
85
|
-
cancelBlockQuote(params: CancelBlockQuoteRequest): Promise<CancelBlockQuoteResult[]>;
|
|
86
|
-
cancelMultipleBlockQuotes(params: CancelMultipleBlockQuoteRequest): Promise<CancelBlockQuoteResult[]>;
|
|
87
|
-
cancelAllBlockQuotes(): Promise<TimestampObject[]>;
|
|
88
|
-
getBlockRFQs(params?: GetBlockRFQSParams): Promise<BlockRFQResult[]>;
|
|
89
|
-
getBlockQuotes(params?: GetBlockQuoteParams): Promise<GetBlockQuoteResult[]>;
|
|
90
|
-
getBlockTrades(params?: any): Promise<any[]>;
|
|
91
|
-
getPublicRFQBlockTrades(params?: any): Promise<any[]>;
|
|
92
|
-
/**
|
|
93
|
-
*
|
|
94
|
-
* Funding endpoints (private)
|
|
95
|
-
*
|
|
96
|
-
*/
|
|
97
|
-
getCurrencies(ccy?: string): Promise<FundingCurrency[]>;
|
|
98
|
-
getBalances(ccy?: string): Promise<FundingBalance[]>;
|
|
99
|
-
getAccountAssetValuation(ccy?: string): Promise<AccountAssetValuation[]>;
|
|
100
|
-
fundsTransfer(params: FundsTransferRequest): Promise<FundTransferResult[]>;
|
|
101
|
-
/** Either parameter transId or clientId is required. */
|
|
102
|
-
getFundsTransferState(params: {
|
|
103
|
-
transId?: string;
|
|
104
|
-
clientId?: string;
|
|
105
|
-
type?: '0' | '1' | '2';
|
|
106
|
-
}): Promise<FundTransferState[]>;
|
|
107
|
-
getAssetBillsDetails(params?: {
|
|
108
|
-
ccy?: string;
|
|
109
|
-
type?: `${ASSET_BILL_TYPE}`;
|
|
110
|
-
clientId?: string;
|
|
111
|
-
after?: numberInString;
|
|
112
|
-
before?: numberInString;
|
|
113
|
-
limit?: numberInString;
|
|
114
|
-
}): Promise<AssetBillDetails[]>;
|
|
115
|
-
getLightningDeposits(ccy: string, amt: numberInString, to?: '6' | '18'): Promise<any[]>;
|
|
116
|
-
getDepositAddress(ccy: string): Promise<any[]>;
|
|
117
|
-
getDepositHistory(params?: any): Promise<any[]>;
|
|
118
|
-
submitWithdraw(params: WithdrawRequest): Promise<WithdrawResponse[]>;
|
|
119
|
-
submitWithdrawLightning(ccy: string, invoice: string, memo?: string): Promise<any[]>;
|
|
120
|
-
cancelWithdrawal(wdId: string): Promise<any[]>;
|
|
121
|
-
getWithdrawalHistory(params?: WithdrawalHistoryRequest): Promise<any[]>;
|
|
122
|
-
smallAssetsConvert(ccy: string[]): Promise<any[]>;
|
|
123
|
-
getSavingBalance(ccy?: string): Promise<any[]>;
|
|
124
|
-
savingsPurchaseRedemption(ccy: string, amt: numberInString, side: 'purchase' | 'redempt', rate: numberInString): Promise<any[]>;
|
|
125
|
-
setLendingRate(ccy: string, rate: numberInString): Promise<any[]>;
|
|
126
|
-
getLendingHistory(params?: PaginatedSymbolRequest): Promise<any[]>;
|
|
127
|
-
getPublicBorrowInfo(ccy?: string): Promise<any[]>;
|
|
128
|
-
getPublicBorrowHistory(params?: PaginatedSymbolRequest): Promise<any[]>;
|
|
129
|
-
/**
|
|
130
|
-
*
|
|
131
|
-
* Convert endpoints (private)
|
|
132
|
-
*
|
|
133
|
-
*/
|
|
134
|
-
getConvertCurrencies(): Promise<any[]>;
|
|
135
|
-
getConvertCurrencyPair(fromCcy: string, toCcy: string): Promise<any[]>;
|
|
136
|
-
estimateConvertQuote(params: ConvertQuoteEstimateRequest): Promise<any[]>;
|
|
137
|
-
convertTrade(params: ConvertTradeRequest): Promise<any[]>;
|
|
138
|
-
getConvertHistory(params?: any): Promise<any[]>;
|
|
139
|
-
/**
|
|
140
|
-
*
|
|
141
|
-
* Account endpoints (private)
|
|
13
|
+
* Trading account endpoints
|
|
142
14
|
*
|
|
143
15
|
*/
|
|
16
|
+
getAccountInstruments(params: GetInstrumentsRequest): Promise<AccountInstrument[]>;
|
|
144
17
|
getBalance(ccy?: string): Promise<AccountBalance[]>;
|
|
145
18
|
getPositions(params?: GetPositionsParams): Promise<AccountPosition[]>;
|
|
146
19
|
getPositionsHistory(params?: GetHistoricPositionParams): Promise<HistoricAccountPosition[]>;
|
|
@@ -151,12 +24,6 @@ export declare class RestClient extends BaseRestClient {
|
|
|
151
24
|
getBillsArchive(params?: any): Promise<AccountBill[]>;
|
|
152
25
|
getAccountConfiguration(): Promise<AccountConfiguration[]>;
|
|
153
26
|
setPositionMode(posMode: PosMode): Promise<AccountPositionModeResult[]>;
|
|
154
|
-
setAccountMode(params: {
|
|
155
|
-
acctLv: AccountLevel;
|
|
156
|
-
}): Promise<AccountModeResult[]>;
|
|
157
|
-
setAutoLoan(params: {
|
|
158
|
-
autoLoan: boolean;
|
|
159
|
-
}): Promise<AutoLoanResult[]>;
|
|
160
27
|
setLeverage(params: SetLeverageRequest): Promise<AccountLeverageResult[]>;
|
|
161
28
|
/** Max buy/sell amount or open amount */
|
|
162
29
|
getMaxBuySellAmount(params: {
|
|
@@ -200,53 +67,168 @@ export declare class RestClient extends BaseRestClient {
|
|
|
200
67
|
setIsolatedMode(isoMode: 'automatic' | 'autonomy', type: 'MARGIN' | 'CONTRACTS'): Promise<AccountIsolatedMode[]>;
|
|
201
68
|
getMaxWithdrawals(ccy?: string): Promise<MaxWithdrawal[]>;
|
|
202
69
|
getAccountRiskState(): Promise<AccountRiskState[]>;
|
|
70
|
+
submitQuickMarginBorrowRepay(params: QuickMarginBorrowRepayRequest): Promise<QuickMarginBorrowRepayResult[]>;
|
|
71
|
+
getQuickMarginBorrowRepayHistory(params: GetQuickMarginBorrowRepayHistoryRequest): Promise<QuickMarginBorrowRepayRecord[]>;
|
|
203
72
|
borrowRepayVIPLoan(ccy: string, side: 'borrow' | 'repay', amt: numberInString, ordId?: string): Promise<any[]>;
|
|
204
73
|
getVIPLoanBorrowRepayHistory(params?: any): Promise<any[]>;
|
|
74
|
+
getVIPInterestAccrued(params: GetVIPInterestRequest): Promise<VIPInterest[]>;
|
|
75
|
+
getVIPInterestDeducted(params: GetVIPInterestRequest): Promise<VIPInterest[]>;
|
|
76
|
+
getVIPLoanOrders(params: GetVIPLoanOrderListRequest): Promise<VIPLoanOrder[]>;
|
|
77
|
+
getVIPLoanOrder(params: GetVIPLoanOrderDetailRequest): Promise<VIPLoanOrderDetail[]>;
|
|
205
78
|
getBorrowInterestLimits(params?: {
|
|
206
79
|
type?: '1' | '2';
|
|
207
80
|
ccy?: string;
|
|
208
81
|
}): Promise<any[]>;
|
|
82
|
+
getFixedLoanBorrowLimit(): Promise<FixedLoanBorrowingLimit[]>;
|
|
83
|
+
getFixedLoanBorrowQuote(params: GetFixedLoanBorrowQuoteRequest): Promise<FixedLoanBorrowQuote[]>;
|
|
84
|
+
submitFixedLoanBorrowOrder(params: SubmitFixedLoanBorrowingOrderRequest): Promise<{
|
|
85
|
+
ordId: string;
|
|
86
|
+
}[]>;
|
|
87
|
+
updateFixedLoanBorrowOrder(params: UpdateFixedLoanBorrowingOrderRequest): Promise<{
|
|
88
|
+
ordId: string;
|
|
89
|
+
}[]>;
|
|
90
|
+
manualRenewFixedLoanBorrowOrder(params: {
|
|
91
|
+
ordId: string;
|
|
92
|
+
maxRate: string;
|
|
93
|
+
}): Promise<{
|
|
94
|
+
ordId: string;
|
|
95
|
+
}[]>;
|
|
96
|
+
repayFixedLoanBorrowOrder(params: {
|
|
97
|
+
ordId: string;
|
|
98
|
+
}): Promise<{
|
|
99
|
+
ordId: string;
|
|
100
|
+
}[]>;
|
|
101
|
+
getFixedLoanBorrowOrders(params: GetFixedLoanBorrowingOrdersListRequest): Promise<any[]>;
|
|
102
|
+
positionBuilder(params: PositionBuilderRequest): Promise<any[]>;
|
|
103
|
+
updateRiskOffsetAmount(params: {
|
|
104
|
+
ccy: string;
|
|
105
|
+
clSpotInUseAmt: string;
|
|
106
|
+
}): Promise<{
|
|
107
|
+
ccy: string;
|
|
108
|
+
clSpotInUseAmt: string;
|
|
109
|
+
}[]>;
|
|
209
110
|
getGreeks(ccy?: string): Promise<any[]>;
|
|
210
111
|
getPMLimitation(params: {
|
|
211
112
|
instType: 'SWAP' | 'FUTURES' | 'OPTION';
|
|
212
113
|
uly?: string;
|
|
213
114
|
instFamily?: string;
|
|
214
115
|
}): Promise<any[]>;
|
|
116
|
+
updateRiskOffsetType(params: {
|
|
117
|
+
type: '1' | '2' | '3' | '4';
|
|
118
|
+
}): Promise<{
|
|
119
|
+
type: '1' | '2' | '3' | '4';
|
|
120
|
+
}[]>;
|
|
121
|
+
activateOption(): Promise<{
|
|
122
|
+
ts: string;
|
|
123
|
+
}[]>;
|
|
124
|
+
setAutoLoan(params: {
|
|
125
|
+
autoLoan: boolean;
|
|
126
|
+
}): Promise<AutoLoanResult[]>;
|
|
127
|
+
setAccountMode(params: {
|
|
128
|
+
acctLv: AccountLevel;
|
|
129
|
+
}): Promise<AccountModeResult[]>;
|
|
130
|
+
resetMMPStatus(params: {
|
|
131
|
+
instType?: 'OPTION';
|
|
132
|
+
instFamily: string;
|
|
133
|
+
}): Promise<{
|
|
134
|
+
result: boolean;
|
|
135
|
+
}[]>;
|
|
136
|
+
setMMPConfig(params: SetMMPConfigRequest): Promise<SetMMPConfigResult[]>;
|
|
137
|
+
getMMPConfig(params?: {
|
|
138
|
+
instFamily?: string;
|
|
139
|
+
}): Promise<MMPConfig[]>;
|
|
215
140
|
/**
|
|
216
141
|
*
|
|
217
|
-
*
|
|
142
|
+
* Orderbook trading - trade endpoints
|
|
218
143
|
*
|
|
219
144
|
*/
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
145
|
+
submitOrder(params: OrderRequest): Promise<OrderResult[]>;
|
|
146
|
+
submitMultipleOrders(params: OrderRequest[]): Promise<OrderResult[]>;
|
|
147
|
+
cancelOrder(params: OrderIdRequest): Promise<CancelledOrderResult[]>;
|
|
148
|
+
cancelMultipleOrders(params: OrderIdRequest[]): Promise<CancelledOrderResult[]>;
|
|
149
|
+
amendOrder(params: AmendOrderRequest): Promise<AmendedOrder[]>;
|
|
150
|
+
amendMultipleOrders(params: AmendOrderRequest[]): Promise<AmendedOrder[]>;
|
|
151
|
+
closePositions(params: ClosePositionRequest): Promise<ClosedPositions[]>;
|
|
152
|
+
getOrderDetails(params: OrderIdRequest): Promise<OrderDetails[]>;
|
|
153
|
+
getOrderList(params?: OrderHistoryRequest): Promise<OrderListItem[]>;
|
|
154
|
+
/**
|
|
155
|
+
* Get history for last 7 days
|
|
156
|
+
*/
|
|
157
|
+
getOrderHistory(params: OrderHistoryRequest): Promise<HistoricOrder[]>;
|
|
158
|
+
/**
|
|
159
|
+
* Get history for last 3 months
|
|
160
|
+
*/
|
|
161
|
+
getOrderHistoryArchive(params: OrderHistoryRequest): Promise<HistoricOrder[]>;
|
|
162
|
+
/**
|
|
163
|
+
* Get history for last 7 days
|
|
164
|
+
*/
|
|
165
|
+
getFills(params?: FillsHistoryRequest): Promise<OrderFill[]>;
|
|
166
|
+
/**
|
|
167
|
+
* Get history for last 3 months
|
|
168
|
+
*/
|
|
169
|
+
getFillsHistory(params: FillsHistoryRequest): Promise<OrderFill[]>;
|
|
170
|
+
applyTransactionDetailsArchive(params: {
|
|
171
|
+
year: string;
|
|
172
|
+
quarter: 'Q1' | 'Q2' | 'Q3' | 'Q4';
|
|
173
|
+
}): Promise<{
|
|
174
|
+
result: string;
|
|
175
|
+
ts: string;
|
|
176
|
+
}[]>;
|
|
177
|
+
getTransactionDetailsArchiveLink(params: {
|
|
178
|
+
year: string;
|
|
179
|
+
quarter: 'Q1' | 'Q2' | 'Q3' | 'Q4';
|
|
240
180
|
}): Promise<any[]>;
|
|
241
|
-
/**
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
181
|
+
/** Get easy convert currency list */
|
|
182
|
+
getEasyConvertCurrencies(): Promise<any>;
|
|
183
|
+
/**
|
|
184
|
+
* Place easy convert : Convert small currencies to mainstream currencies.
|
|
185
|
+
* Only applicable to the crypto balance less than $10.
|
|
186
|
+
*
|
|
187
|
+
* Maximum 5 currencies can be selected in one order.
|
|
188
|
+
* If there are multiple currencies, separate them with commas in the "from" field.
|
|
189
|
+
*/
|
|
190
|
+
submitEasyConvert(fromCcys: string[], toCcy: string): Promise<APIResponse<any>>;
|
|
191
|
+
/** Get easy convert history : Get the history and status of easy convert trades. */
|
|
192
|
+
getEasyConvertHistory(params?: Pagination): Promise<APIResponse<any>>;
|
|
193
|
+
/**
|
|
194
|
+
* Get one-click repay currency list : Get list of debt currency data and repay currencies.
|
|
195
|
+
* Debt currencies include both cross and isolated debts.
|
|
196
|
+
*/
|
|
197
|
+
getOneClickRepayCurrencyList(debtType?: 'cross' | 'isolated'): Promise<APIResponse<any>>;
|
|
198
|
+
/**
|
|
199
|
+
* Trade one-click repay to repay cross debts.
|
|
200
|
+
* Isolated debts are not applicable.
|
|
201
|
+
* The maximum repayment amount is based on the remaining available balance of funding and trading accounts.
|
|
202
|
+
*/
|
|
203
|
+
submitOneClickRepay(debtCcys: string[], repayCcy: string): Promise<APIResponse<any>>;
|
|
204
|
+
/** Get the history and status of one-click repay trades. */
|
|
205
|
+
getOneClickRepayHistory(params?: Pagination): Promise<APIResponse<any>>;
|
|
206
|
+
cancelMassOrder(params: {
|
|
207
|
+
instType: string;
|
|
208
|
+
instFamily: string;
|
|
209
|
+
}): Promise<{
|
|
210
|
+
result: boolean;
|
|
211
|
+
}[]>;
|
|
212
|
+
cancelAllAfter(params: {
|
|
213
|
+
timeOut: string;
|
|
214
|
+
tag?: string;
|
|
215
|
+
}): Promise<CancelAllAfterResponse[]>;
|
|
216
|
+
getAccountRateLimit(): Promise<any[]>;
|
|
217
|
+
/**
|
|
218
|
+
*
|
|
219
|
+
* Orderbook trading - Algo trading endpoints
|
|
220
|
+
*
|
|
221
|
+
*/
|
|
222
|
+
placeAlgoOrder(params: AlgoOrderRequest): Promise<AlgoOrderResult[]>;
|
|
223
|
+
cancelAlgoOrder(params: CancelAlgoOrderRequest[]): Promise<AlgoOrderResult[]>;
|
|
224
|
+
amendAlgoOrder(params: AmendAlgoOrderRequest): Promise<AmendAlgoOrderResult[]>;
|
|
225
|
+
cancelAdvanceAlgoOrder(params: CancelAlgoOrderRequest[]): Promise<AlgoOrderResult[]>;
|
|
226
|
+
getAlgoOrderDetails(params: AlgoOrderDetailsRequest): Promise<AlgoOrderDetailsResult[]>;
|
|
227
|
+
getAlgoOrderList(params: AlgoRecentHistoryRequest): Promise<AlgoOrderListItem[]>;
|
|
228
|
+
getAlgoOrderHistory(params: AlgoLongHistoryRequest): Promise<HistoricAlgoOrder[]>;
|
|
247
229
|
/**
|
|
248
230
|
*
|
|
249
|
-
* Grid trading endpoints
|
|
231
|
+
* Orderbook trading - Grid trading endpoints
|
|
250
232
|
*
|
|
251
233
|
*/
|
|
252
234
|
placeGridAlgoOrder(params: GridAlgoOrderRequest): Promise<any[]>;
|
|
@@ -255,6 +237,17 @@ export declare class RestClient extends BaseRestClient {
|
|
|
255
237
|
tpTriggerPx?: numberInString;
|
|
256
238
|
}): Promise<any[]>;
|
|
257
239
|
stopGridAlgoOrder(orders: StopGridAlgoOrderRequest[]): Promise<any[]>;
|
|
240
|
+
closeGridContractPosition(params: CloseContractGridPositionRequest): Promise<any[]>;
|
|
241
|
+
cancelGridContractCloseOrder(params: {
|
|
242
|
+
algoId: string;
|
|
243
|
+
ordId: string;
|
|
244
|
+
}): Promise<any[]>;
|
|
245
|
+
instantTriggerGridAlgoOrder(params: {
|
|
246
|
+
algoId: string;
|
|
247
|
+
}): Promise<{
|
|
248
|
+
algoId: string;
|
|
249
|
+
algoClOrdId: string;
|
|
250
|
+
}[]>;
|
|
258
251
|
getGridAlgoOrderList(params: GetGridAlgoOrdersRequest): Promise<any[]>;
|
|
259
252
|
getGridAlgoOrderHistory(params: GetGridAlgoOrdersRequest): Promise<any[]>;
|
|
260
253
|
getGridAlgoOrderDetails(algoOrdType: GridAlgoOrderType, algoId: string): Promise<any[]>;
|
|
@@ -271,61 +264,219 @@ export declare class RestClient extends BaseRestClient {
|
|
|
271
264
|
amt?: numberInString;
|
|
272
265
|
percent?: numberInString;
|
|
273
266
|
}): Promise<any[]>;
|
|
267
|
+
adjustGridInvestment(params: {
|
|
268
|
+
algoId: string;
|
|
269
|
+
amt: string;
|
|
270
|
+
}): Promise<{
|
|
271
|
+
algoId: string;
|
|
272
|
+
}[]>;
|
|
274
273
|
getGridAIParameter(algoOrdType: GridAlgoOrderType, instId: string, direction: ContractGridDirection, duration?: '7D' | '30D' | '180D'): Promise<any[]>;
|
|
274
|
+
computeGridMinInvestment(params: {
|
|
275
|
+
amt: string;
|
|
276
|
+
ccy: string;
|
|
277
|
+
}): Promise<any[]>;
|
|
278
|
+
getRSIBackTesting(params: GetRSIBackTestingRequest): Promise<{
|
|
279
|
+
triggerNum: string;
|
|
280
|
+
}[]>;
|
|
275
281
|
/**
|
|
276
282
|
*
|
|
277
|
-
*
|
|
283
|
+
* Orderbook trading - Signal bot trading endpoints
|
|
278
284
|
*
|
|
279
285
|
*/
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}): Promise<
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
286
|
+
createSignal(params: CreateSignalRequest): Promise<CreateSignalResult[]>;
|
|
287
|
+
getSignals(params: GetSignalsRequest): Promise<GetSignalsResult[]>;
|
|
288
|
+
createSignalBot(params: CreateSignalBotRequest): Promise<CreateSignalBotResult[]>;
|
|
289
|
+
cancelSignalBots(params: {
|
|
290
|
+
algoId: string;
|
|
291
|
+
}): Promise<CancelSignalBotsResult[]>;
|
|
292
|
+
updateSignalMargin(params: AdjustMarginBalanceRequest): Promise<{
|
|
293
|
+
algoId: string;
|
|
294
|
+
}[]>;
|
|
295
|
+
updateSignalTPSL(params: AmendTPSLRequest): Promise<{
|
|
296
|
+
algoId: string;
|
|
297
|
+
}[]>;
|
|
298
|
+
setSignalInstruments(params: SetSignalInstrumentsRequest): Promise<{
|
|
299
|
+
algoId: string;
|
|
300
|
+
}[]>;
|
|
301
|
+
getSignalBotOrder(params: {
|
|
302
|
+
algoOrdType: string;
|
|
303
|
+
algoId: string;
|
|
304
|
+
}): Promise<any[]>;
|
|
305
|
+
getActiveSignalBot(params: GetSignalBotRequest): Promise<any[]>;
|
|
306
|
+
getSignalBotHistory(params: GetSignalBotRequest): Promise<any[]>;
|
|
307
|
+
getSignalBotPositions(params: {
|
|
308
|
+
algoOrdType: string;
|
|
309
|
+
algoId: string;
|
|
310
|
+
}): Promise<any[]>;
|
|
311
|
+
getSignalBotPositionHistory(params: GetSignalBotPositionHistoryRequest): Promise<any[]>;
|
|
312
|
+
closeSignalBotPosition(params: {
|
|
313
|
+
algoId: string;
|
|
314
|
+
instId: string;
|
|
315
|
+
}): Promise<{
|
|
316
|
+
algoId: string;
|
|
317
|
+
}[]>;
|
|
318
|
+
placeSignalBotSubOrder(params: PlaceSubOrderRequest): Promise<any[]>;
|
|
319
|
+
cancelSubOrder(params: CancelSubOrderRequest): Promise<any[]>;
|
|
320
|
+
getSignalBotSubOrders(params: GetSignalBotSubOrdersRequest): Promise<any[]>;
|
|
321
|
+
getSignalBotEventHistory(params: GetSignalBotEventHistoryRequest): Promise<any[]>;
|
|
322
|
+
/**
|
|
323
|
+
*
|
|
324
|
+
* Orderbook trading - Recurring buy endpoints
|
|
325
|
+
*
|
|
326
|
+
*/
|
|
327
|
+
submitRecurringBuyOrder(params: PlaceRecurringBuyOrderRequest): Promise<RecurringBuyOrderResult[]>;
|
|
328
|
+
amendRecurringBuyOrder(params: AmendRecurringBuyOrderRequest): Promise<RecurringBuyOrderResult[]>;
|
|
329
|
+
stopRecurringBuyOrder(params: {
|
|
330
|
+
algoId: string;
|
|
331
|
+
}): Promise<RecurringBuyOrderResult[]>;
|
|
332
|
+
getRecurringBuyOrders(params: GetRecurringBuyOrderListRequest): Promise<RecurringBuyOrder[]>;
|
|
333
|
+
getRecurringBuyOrderHistory(params: GetRecurringBuyOrderListRequest): Promise<RecurringBuyOrder[]>;
|
|
334
|
+
getRecurringBuyOrderDetails(params: {
|
|
335
|
+
algoId: string;
|
|
336
|
+
}): Promise<RecurringBuyOrder[]>;
|
|
337
|
+
getRecurringBuySubOrders(params: GetRecurringBuyOrderListRequest): Promise<RecurringBuySubOrder[]>;
|
|
311
338
|
/**
|
|
312
339
|
*
|
|
313
|
-
*
|
|
340
|
+
* Orderbook trading - Copy trading endpoints
|
|
341
|
+
*
|
|
342
|
+
*/
|
|
343
|
+
getCopytradingSubpositions(params?: GetCurrentSubpositionsRequest): Promise<CurrentSubposition[]>;
|
|
344
|
+
getCopytradingSubpositionsHistory(params?: GetSubpositionsHistoryRequest): Promise<SubpositionsHistory[]>;
|
|
345
|
+
submitCopytradingAlgoOrder(params: PlaceCTAlgoOrderRequest): Promise<PlaceCTAlgoOrderResult[]>;
|
|
346
|
+
closeCopytradingSubposition(params: CloseSubpositionRequest): Promise<{
|
|
347
|
+
subPosId: string;
|
|
348
|
+
tag: string;
|
|
349
|
+
}[]>;
|
|
350
|
+
getCopytradingInstruments(params?: {
|
|
351
|
+
instType?: 'SPOT' | 'SWAP';
|
|
352
|
+
}): Promise<{
|
|
353
|
+
instId: string;
|
|
354
|
+
enabled: boolean;
|
|
355
|
+
}[]>;
|
|
356
|
+
setCopytradingInstruments(params: {
|
|
357
|
+
instType?: 'SPOT' | 'SWAP';
|
|
358
|
+
instId: string;
|
|
359
|
+
}): Promise<{
|
|
360
|
+
instId: string;
|
|
361
|
+
enabled: boolean;
|
|
362
|
+
}[]>;
|
|
363
|
+
getCopytradingProfitDetails(params?: GetCTProfitDetailsRequest): Promise<GetCTProfitDetailsResult[]>;
|
|
364
|
+
getCopytradingTotalProfit(params?: {
|
|
365
|
+
instType?: 'SPOT' | 'SWAP';
|
|
366
|
+
}): Promise<GetCTTotalProfitResult[]>;
|
|
367
|
+
getCopytradingUnrealizedProfit(params?: {
|
|
368
|
+
instType?: 'SPOT' | 'SWAP';
|
|
369
|
+
}): Promise<GetCTUnrealizedProfitResult[]>;
|
|
370
|
+
getCopytradingTotalUnrealizedProfit(params?: {
|
|
371
|
+
instType?: 'SWAP';
|
|
372
|
+
}): Promise<{
|
|
373
|
+
instType?: 'SWAP';
|
|
374
|
+
instId: string;
|
|
375
|
+
}[]>;
|
|
376
|
+
applyCopytradingLeadTrading(params: {
|
|
377
|
+
profitSharingTs: string;
|
|
378
|
+
totalUnrealizedProfitSharingAmt: string;
|
|
379
|
+
}): Promise<{
|
|
380
|
+
result: boolean;
|
|
381
|
+
}[]>;
|
|
382
|
+
stopCopytradingLeadTrading(params: {
|
|
383
|
+
instType?: 'SWAP';
|
|
384
|
+
}): Promise<{
|
|
385
|
+
result: boolean;
|
|
386
|
+
}[]>;
|
|
387
|
+
updateCopytradingProfitSharing(params: {
|
|
388
|
+
instType?: 'SWAP';
|
|
389
|
+
profitSharingRatio: string;
|
|
390
|
+
}): Promise<{
|
|
391
|
+
result: boolean;
|
|
392
|
+
}[]>;
|
|
393
|
+
getCopytradingAccount(): Promise<GetAccountConfigurationResult[]>;
|
|
394
|
+
setCopytradingFirstCopy(params: CopySettingsRequest): Promise<{
|
|
395
|
+
result: boolean;
|
|
396
|
+
}[]>;
|
|
397
|
+
updateCopytradingCopySettings(params: CopySettingsRequest): Promise<{
|
|
398
|
+
result: boolean;
|
|
399
|
+
}[]>;
|
|
400
|
+
stopCopytradingCopy(params: {
|
|
401
|
+
instType?: 'SWAP';
|
|
402
|
+
uniqueCode: string;
|
|
403
|
+
subPosCloseType: 'market_close' | 'copy_close' | 'manual_close';
|
|
404
|
+
}): Promise<{
|
|
405
|
+
result: boolean;
|
|
406
|
+
}[]>;
|
|
407
|
+
getCopytradingCopySettings(params: {
|
|
408
|
+
instType?: 'SWAP';
|
|
409
|
+
uniqueCode: string;
|
|
410
|
+
}): Promise<GetCopySettingsResult[]>;
|
|
411
|
+
getCopytradingBatchLeverageInfo(params: GetCTBatchLeverageInfoRequest): Promise<GetCTBatchLeverageInfoResult[]>;
|
|
412
|
+
setCopytradingBatchLeverage(params: SetCTBatchLeverageRequest): Promise<SetCTBatchLeverageResult[]>;
|
|
413
|
+
getCopytradingMyLeadTraders(params?: {
|
|
414
|
+
instType?: 'SWAP';
|
|
415
|
+
}): Promise<GetCTMyLeadTradersResult[]>;
|
|
416
|
+
getCopytradingLeadTradersHistory(params?: GetCTHistoryLeadTradersRequest): Promise<GetCTHistoryLeadTradersResult[]>;
|
|
417
|
+
getCopytradingConfig(params?: {
|
|
418
|
+
instType?: 'SWAP';
|
|
419
|
+
}): Promise<GetCopyTradingConfigResult[]>;
|
|
420
|
+
getCopytradingLeadRanks(params?: GetLeadTraderRanksRequest): Promise<GetLeadTraderRanksResult[]>;
|
|
421
|
+
getCopytradingLeadWeeklyPnl(params: {
|
|
422
|
+
instType?: 'SWAP';
|
|
423
|
+
uniqueCode: string;
|
|
424
|
+
}): Promise<LeadTraderPnl[]>;
|
|
425
|
+
getCopytradingLeadDailyPnl(params: GetLeadTraderStatsRequest): Promise<LeadTraderPnl[]>;
|
|
426
|
+
getCopytradingLeadStats(params: GetLeadTraderStatsRequest): Promise<LeadTraderStats[]>;
|
|
427
|
+
getCopytradingLeadPreferences(params: {
|
|
428
|
+
instType?: 'SWAP';
|
|
429
|
+
uniqueCode: string;
|
|
430
|
+
}): Promise<LeadTraderPreference[]>;
|
|
431
|
+
getCopytradingLeadOpenPositions(params: GetLeadTraderPositionsRequest): Promise<LeadTraderCurrentPosition[]>;
|
|
432
|
+
getCopytradingLeadPositionHistory(params: GetLeadTraderPositionsRequest): Promise<LeadTraderPositionHistory[]>;
|
|
433
|
+
getCopyTraders(params: GetCopyTradersRequest): Promise<GetCopyTradersResult[]>;
|
|
434
|
+
getCopytradingLeadPrivateRanks(params?: GetPrivateLeadTraderRanksRequest): Promise<GetPrivateLeadTraderRanksResult[]>;
|
|
435
|
+
getCopytradingLeadPrivateWeeklyPnl(params: {
|
|
436
|
+
instType?: 'SWAP';
|
|
437
|
+
uniqueCode: string;
|
|
438
|
+
}): Promise<LeadTraderPnl[]>;
|
|
439
|
+
getCopytradingPLeadPrivateDailyPnl(params: GetLeadTraderStatsRequest): Promise<LeadTraderPnl[]>;
|
|
440
|
+
geCopytradingLeadPrivateStats(params: GetLeadTraderStatsRequest): Promise<LeadTraderStats[]>;
|
|
441
|
+
getCopytradingLeadPrivatePreferences(params: {
|
|
442
|
+
instType?: 'SWAP';
|
|
443
|
+
uniqueCode: string;
|
|
444
|
+
}): Promise<LeadTraderPreference[]>;
|
|
445
|
+
getCopytradingLeadPrivateOpenPositions(params: GetLeadTraderPositionsRequest): Promise<LeadTraderCurrentPosition[]>;
|
|
446
|
+
getCopytradingLeadPrivatePositionHistory(params: GetLeadTraderPositionsRequest): Promise<LeadTraderPositionHistory[]>;
|
|
447
|
+
getCopyTradersPrivate(params: GetCopyTradersRequest): Promise<GetCopyTradersResult[]>;
|
|
448
|
+
/**
|
|
449
|
+
*
|
|
450
|
+
* Orderbook trading - Market data endpoints
|
|
314
451
|
*
|
|
315
452
|
*/
|
|
316
453
|
getTickers(instrumentType: InstrumentType, uly?: string): Promise<Ticker[]>;
|
|
317
454
|
getTicker(instId: string): Promise<Ticker[]>;
|
|
318
|
-
getIndexTickers(params: {
|
|
319
|
-
quoteCcy?: string;
|
|
320
|
-
instId?: string;
|
|
321
|
-
}): Promise<IndexTicker[]>;
|
|
322
455
|
getOrderBook(instId: string, sz?: numberInString): Promise<OrderBook[]>;
|
|
456
|
+
getFullOrderBook(params: {
|
|
457
|
+
instId: string;
|
|
458
|
+
sz?: string;
|
|
459
|
+
}): Promise<OrderBook[]>;
|
|
460
|
+
/**
|
|
461
|
+
* @deprecated this method's parameters will change to an object in the next release. Use getCandlesV2 instead.
|
|
462
|
+
*
|
|
463
|
+
* @param instId
|
|
464
|
+
* @param bar
|
|
465
|
+
* @param pagination
|
|
466
|
+
* @returns
|
|
467
|
+
*/
|
|
323
468
|
getCandles(instId: string, bar?: string, pagination?: Pagination): Promise<Candle[]>;
|
|
469
|
+
getCandlesV2(params: CandleRequest): Promise<Candle[]>;
|
|
470
|
+
/**
|
|
471
|
+
* @deprecated this method's parameters will change to an object in the next release. Use getHistoricCandlesV2 instead.
|
|
472
|
+
*
|
|
473
|
+
* @param instId
|
|
474
|
+
* @param bar
|
|
475
|
+
* @param pagination
|
|
476
|
+
* @returns
|
|
477
|
+
*/
|
|
324
478
|
getHistoricCandles(instId: string, bar?: string, pagination?: Pagination): Promise<Candle[]>;
|
|
325
|
-
|
|
326
|
-
getHistoricIndexCandles(instId: string, bar?: string, pagination?: Pagination): Promise<CandleNoVolume[]>;
|
|
327
|
-
getMarkPriceCandles(instId: string, bar?: string, pagination?: Pagination): Promise<CandleNoVolume[]>;
|
|
328
|
-
getHistoricMarkPriceCandles(instId: string, bar?: string, pagination?: Pagination): Promise<CandleNoVolume[]>;
|
|
479
|
+
getHistoricCandlesV2(params: CandleRequest): Promise<Candle[]>;
|
|
329
480
|
getTrades(instId: string, limit?: number): Promise<Trade[]>;
|
|
330
481
|
getHistoricTrades(instId: string, pagination?: {
|
|
331
482
|
after?: numberInString;
|
|
@@ -333,16 +484,96 @@ export declare class RestClient extends BaseRestClient {
|
|
|
333
484
|
limit?: numberInString;
|
|
334
485
|
type?: '1' | '2';
|
|
335
486
|
}): Promise<Trade[]>;
|
|
487
|
+
getOptionTradesByInstrument(params: {
|
|
488
|
+
instFamily: string;
|
|
489
|
+
}): Promise<OptionTrade[]>;
|
|
490
|
+
getOptionTrades(params: GetOptionTradesRequest): Promise<OptionTrades[]>;
|
|
336
491
|
get24hrTotalVolume(): Promise<any[]>;
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
492
|
+
/**
|
|
493
|
+
*
|
|
494
|
+
* Block trading - REST endpoints
|
|
495
|
+
*
|
|
496
|
+
*/
|
|
497
|
+
getBlockCounterParties(): Promise<BlockCounterParty[]>;
|
|
498
|
+
createBlockRFQ(params: CreateBlockRFQRequest): Promise<CreateRFQResult[]>;
|
|
499
|
+
cancelBlockRFQ(params: CancelBlockRFQRequest): Promise<CancelBlockRFQResult[]>;
|
|
500
|
+
cancelMultipleBlockRFQs(params: CancelMultipleBlockRFQRequest): Promise<CancelBlockRFQResult[]>;
|
|
501
|
+
cancelAllRFQs(): Promise<TimestampObject[]>;
|
|
502
|
+
executeBlockQuote(params: ExecuteBlockQuoteRequest): Promise<ExecuteBlockQuoteResult[]>;
|
|
503
|
+
getQuoteProducts(): Promise<BlockMakerInstrumentSettings[]>;
|
|
504
|
+
updateBlockQuoteProducts(params: SetQuoteProductsRequest): Promise<{
|
|
505
|
+
result: boolean;
|
|
506
|
+
}[]>;
|
|
507
|
+
resetBlockMmp(): Promise<{
|
|
508
|
+
ts: string;
|
|
509
|
+
}[]>;
|
|
510
|
+
updateBlockMmpConfig(params: SetMmpConfigRequest): Promise<SetMmpConfigResult[]>;
|
|
511
|
+
getBlockMmpConfig(): Promise<BlockMMPConfig[]>;
|
|
512
|
+
createBlockQuote(params: CreateBlockQuoteRequest): Promise<CreateBlockQuoteResult[]>;
|
|
513
|
+
cancelBlockQuote(params: CancelBlockQuoteRequest): Promise<CancelBlockQuoteResult[]>;
|
|
514
|
+
cancelMultipleBlockQuotes(params: CancelMultipleBlockQuoteRequest): Promise<CancelBlockQuoteResult[]>;
|
|
515
|
+
cancelAllBlockQuotes(): Promise<TimestampObject[]>;
|
|
516
|
+
cancelAllBlockAfter(params: {
|
|
517
|
+
timeOut: string;
|
|
518
|
+
}): Promise<{
|
|
519
|
+
triggerTime: string;
|
|
520
|
+
ts: string;
|
|
521
|
+
}[]>;
|
|
522
|
+
getBlockRFQs(params?: GetBlockRFQSParams): Promise<BlockRFQResult[]>;
|
|
523
|
+
getBlockQuotes(params?: GetBlockQuoteParams): Promise<GetBlockQuoteResult[]>;
|
|
524
|
+
getBlockTrades(params?: any): Promise<any[]>;
|
|
525
|
+
getPublicRFQBlockTrades(params?: any): Promise<any[]>;
|
|
340
526
|
getBlockTickers(instType: InstrumentType, uly?: string): Promise<any[]>;
|
|
341
527
|
getBlockTicker(instId: string): Promise<any[]>;
|
|
342
|
-
|
|
528
|
+
getBlockPublicTrades(params: {
|
|
529
|
+
instId: string;
|
|
530
|
+
}): Promise<PublicBlockTrade[]>;
|
|
343
531
|
/**
|
|
344
532
|
*
|
|
345
|
-
*
|
|
533
|
+
* Spread trading - REST endpoints
|
|
534
|
+
*
|
|
535
|
+
*/
|
|
536
|
+
submitSpreadOrder(params: PlaceSpreadOrderRequest): Promise<PlaceSpreadOrderResponse[]>;
|
|
537
|
+
cancelSpreadOrder(params?: {
|
|
538
|
+
ordId?: string;
|
|
539
|
+
clOrdId?: string;
|
|
540
|
+
}): Promise<CancelSpreadOrderResponse[]>;
|
|
541
|
+
cancelAllSpreadOrders(params: {
|
|
542
|
+
sprdId?: string;
|
|
543
|
+
}): Promise<{
|
|
544
|
+
result: boolean;
|
|
545
|
+
}[]>;
|
|
546
|
+
updateSpreadOrder(params: UpdateSpreadOrderRequest): Promise<UpdateSpreadOrderResponse[]>;
|
|
547
|
+
getSpreadOrder(params: {
|
|
548
|
+
ordId?: string;
|
|
549
|
+
clOrdId?: string;
|
|
550
|
+
}): Promise<SpreadOrder[]>;
|
|
551
|
+
getSpreadActiveOrders(params?: GetActiveSpreadOrdersRequest): Promise<SpreadOrder[]>;
|
|
552
|
+
getSpreadOrdersRecent(params?: GetSpreadOrderHistoryRequest): Promise<SpreadOrder[]>;
|
|
553
|
+
getSpreadOrdersArchive(params?: GetSpreadOrderHistoryArchiveRequest): Promise<SpreadOrder[]>;
|
|
554
|
+
getSpreadTrades(params?: GetSpreadTradesRequest): Promise<SpreadTrade[]>;
|
|
555
|
+
getSpreads(params?: GetSpreadsRequest): Promise<SpreadDetails[]>;
|
|
556
|
+
getSpreadOrderBook(params: {
|
|
557
|
+
sprdId: string;
|
|
558
|
+
sz?: string;
|
|
559
|
+
}): Promise<SpreadOrderBook[]>;
|
|
560
|
+
getSpreadTicker(params: {
|
|
561
|
+
sprdId: string;
|
|
562
|
+
}): Promise<SpreadTicker[]>;
|
|
563
|
+
getSpreadPublicTrades(params?: {
|
|
564
|
+
sprdId?: string;
|
|
565
|
+
}): Promise<PublicSpreadTrade[]>;
|
|
566
|
+
getSpreadCandles(params: GetSpreadCandlesRequest): Promise<SpreadCandle[]>;
|
|
567
|
+
getSpreadHistoryCandles(params: GetSpreadCandlesRequest): Promise<SpreadCandle[]>;
|
|
568
|
+
cancelSpreadAllAfter(params: {
|
|
569
|
+
timeOut: string;
|
|
570
|
+
}): Promise<{
|
|
571
|
+
triggerTime: string;
|
|
572
|
+
ts: string;
|
|
573
|
+
}[]>;
|
|
574
|
+
/**
|
|
575
|
+
*
|
|
576
|
+
* Public data - rest endpoints
|
|
346
577
|
*
|
|
347
578
|
*/
|
|
348
579
|
getInstruments(instType: InstrumentType, uly?: string, instFamily?: string, instId?: string): Promise<Instrument[]>;
|
|
@@ -355,7 +586,6 @@ export declare class RestClient extends BaseRestClient {
|
|
|
355
586
|
getEstimatedDeliveryExercisePrice(params: any): Promise<any[]>;
|
|
356
587
|
getDiscountRateAndInterestFreeQuota(params: any): Promise<any[]>;
|
|
357
588
|
getSystemTime(params: any): Promise<SystemTime[]>;
|
|
358
|
-
getLiquidationOrders(params: any): Promise<any[]>;
|
|
359
589
|
getMarkPrice(params: any): Promise<any[]>;
|
|
360
590
|
getPositionTiers(params: any): Promise<any[]>;
|
|
361
591
|
getInterestRateAndLoanQuota(params: any): Promise<any[]>;
|
|
@@ -363,20 +593,91 @@ export declare class RestClient extends BaseRestClient {
|
|
|
363
593
|
getUnderlying(params: any): Promise<any[]>;
|
|
364
594
|
getInsuranceFund(params: any): Promise<any[]>;
|
|
365
595
|
getUnitConvert(params: UnitConvertRequest): Promise<UnitConvertData[]>;
|
|
596
|
+
getOptionTickBands(params: {
|
|
597
|
+
instType: string;
|
|
598
|
+
instFamily?: string;
|
|
599
|
+
}): Promise<any[]>;
|
|
600
|
+
getPremiumHistory(params: GetPremiumHistoryRequest): Promise<any[]>;
|
|
601
|
+
getIndexTickers(params: {
|
|
602
|
+
quoteCcy?: string;
|
|
603
|
+
instId?: string;
|
|
604
|
+
}): Promise<IndexTicker[]>;
|
|
605
|
+
/**
|
|
606
|
+
* @deprecated this method's parameters will change to an object in the next release. Use getIndexCandlesV2 instead.
|
|
607
|
+
*
|
|
608
|
+
* @param instId
|
|
609
|
+
* @param bar
|
|
610
|
+
* @param pagination
|
|
611
|
+
* @returns
|
|
612
|
+
*/
|
|
613
|
+
getIndexCandles(instId: string, bar?: string, pagination?: Pagination): Promise<CandleNoVolume[]>;
|
|
614
|
+
getIndexCandlesV2(params: CandleRequest): Promise<CandleNoVolume[]>;
|
|
615
|
+
/**
|
|
616
|
+
* @deprecated this method's parameters will change to an object in the next release. Use getHistoricIndexCandlesV2 instead.
|
|
617
|
+
*
|
|
618
|
+
* @param instId
|
|
619
|
+
* @param bar
|
|
620
|
+
* @param pagination
|
|
621
|
+
* @returns
|
|
622
|
+
*/
|
|
623
|
+
getHistoricIndexCandles(instId: string, bar?: string, pagination?: Pagination): Promise<CandleNoVolume[]>;
|
|
624
|
+
getHistoricIndexCandlesV2(params: CandleRequest): Promise<CandleNoVolume[]>;
|
|
625
|
+
/**
|
|
626
|
+
* @deprecated this method's parameters will change to an object in the next release. Use getMarkPriceCandlesV2 instead.
|
|
627
|
+
*
|
|
628
|
+
* @param instId
|
|
629
|
+
* @param bar
|
|
630
|
+
* @param pagination
|
|
631
|
+
* @returns
|
|
632
|
+
*/
|
|
633
|
+
getMarkPriceCandles(instId: string, bar?: string, pagination?: Pagination): Promise<CandleNoVolume[]>;
|
|
634
|
+
getMarkPriceCandlesV2(params: CandleRequest): Promise<CandleNoVolume[]>;
|
|
635
|
+
/**
|
|
636
|
+
* @deprecated this method's parameters will change to an object in the next release. Use getHistoricMarkPriceCandlesV2 instead.
|
|
637
|
+
*
|
|
638
|
+
* @param instId
|
|
639
|
+
* @param bar
|
|
640
|
+
* @param pagination
|
|
641
|
+
* @returns
|
|
642
|
+
*/
|
|
643
|
+
getHistoricMarkPriceCandles(instId: string, bar?: string, pagination?: Pagination): Promise<CandleNoVolume[]>;
|
|
644
|
+
getHistoricMarkPriceCandlesV2(params: CandleRequest): Promise<CandleNoVolume[]>;
|
|
645
|
+
getOracle(): Promise<any[]>;
|
|
646
|
+
getExchangeRate(): Promise<any[]>;
|
|
647
|
+
getIndexComponents(index: string): Promise<any[]>;
|
|
366
648
|
getEconomicCalendar(params: EconomicCalendarRequest): Promise<EconomicCalendarData[]>;
|
|
649
|
+
/**
|
|
650
|
+
* @deprecated
|
|
651
|
+
*/
|
|
652
|
+
getPublicBlockTrades(instId: string): Promise<any[]>;
|
|
653
|
+
/**
|
|
654
|
+
* @deprecated
|
|
655
|
+
*/
|
|
656
|
+
getLiquidationOrders(params: any): Promise<any[]>;
|
|
367
657
|
/**
|
|
368
658
|
*
|
|
369
|
-
* Trading
|
|
659
|
+
* Trading statistics - REST endpoints
|
|
370
660
|
*
|
|
371
661
|
*/
|
|
372
662
|
getSupportCoin(): Promise<any[]>;
|
|
373
|
-
|
|
663
|
+
getOpenInterestHistory(params: GetContractOpenInterestHistoryRequest): Promise<any[]>;
|
|
664
|
+
getTakerVolume(params: {
|
|
665
|
+
instType: string;
|
|
666
|
+
ccy: string;
|
|
667
|
+
period?: string;
|
|
668
|
+
end?: string;
|
|
669
|
+
begin?: string;
|
|
670
|
+
}): Promise<any[]>;
|
|
671
|
+
getContractTakerVolume(params: GetContractTakerVolumeRequest): Promise<any[]>;
|
|
374
672
|
getMarginLendingRatio(params: {
|
|
375
673
|
ccy: string;
|
|
376
674
|
begin?: numberInString;
|
|
377
675
|
end?: numberInString;
|
|
378
676
|
period: '5m' | '1H' | '1D';
|
|
379
677
|
}): Promise<any[]>;
|
|
678
|
+
getTopTradersAccountRatio(params: GetTopTradersContractLongShortRatioRequest): Promise<any[]>;
|
|
679
|
+
getTopTradersContractPositionRatio(params: GetTopTradersContractLongShortRatioRequest): Promise<any[]>;
|
|
680
|
+
getLongShortContractRatio(params: GetTopTradersContractLongShortRatioRequest): Promise<any[]>;
|
|
380
681
|
getLongShortRatio(params: {
|
|
381
682
|
ccy: string;
|
|
382
683
|
begin?: numberInString;
|
|
@@ -410,6 +711,195 @@ export declare class RestClient extends BaseRestClient {
|
|
|
410
711
|
ccy: string;
|
|
411
712
|
period: '8H' | '1D';
|
|
412
713
|
}): Promise<any[]>;
|
|
714
|
+
/**
|
|
715
|
+
*
|
|
716
|
+
* Funding account - REST endpoints
|
|
717
|
+
*
|
|
718
|
+
*/
|
|
719
|
+
getCurrencies(ccy?: string): Promise<FundingCurrency[]>;
|
|
720
|
+
getBalances(ccy?: string): Promise<FundingBalance[]>;
|
|
721
|
+
getNonTradableAssets(params?: {
|
|
722
|
+
ccy?: string;
|
|
723
|
+
}): Promise<NonTradableAsset[]>;
|
|
724
|
+
getAccountAssetValuation(ccy?: string): Promise<AccountAssetValuation[]>;
|
|
725
|
+
fundsTransfer(params: FundsTransferRequest): Promise<FundTransferResult[]>;
|
|
726
|
+
/** Either parameter transId or clientId is required. */
|
|
727
|
+
getFundsTransferState(params: {
|
|
728
|
+
transId?: string;
|
|
729
|
+
clientId?: string;
|
|
730
|
+
type?: '0' | '1' | '2';
|
|
731
|
+
}): Promise<FundTransferState[]>;
|
|
732
|
+
getAssetBillsDetails(params?: {
|
|
733
|
+
ccy?: string;
|
|
734
|
+
type?: `${ASSET_BILL_TYPE}`;
|
|
735
|
+
clientId?: string;
|
|
736
|
+
after?: numberInString;
|
|
737
|
+
before?: numberInString;
|
|
738
|
+
limit?: numberInString;
|
|
739
|
+
}): Promise<AssetBillDetails[]>;
|
|
740
|
+
getLightningDeposits(ccy: string, amt: numberInString, to?: '6' | '18'): Promise<any[]>;
|
|
741
|
+
getDepositAddress(ccy: string): Promise<any[]>;
|
|
742
|
+
getDepositHistory(params?: any): Promise<any[]>;
|
|
743
|
+
submitWithdraw(params: WithdrawRequest): Promise<WithdrawResponse[]>;
|
|
744
|
+
submitWithdrawLightning(ccy: string, invoice: string, memo?: string): Promise<any[]>;
|
|
745
|
+
cancelWithdrawal(wdId: string): Promise<any[]>;
|
|
746
|
+
getWithdrawalHistory(params?: WithdrawalHistoryRequest): Promise<any[]>;
|
|
747
|
+
getDepositWithdrawStatus(params: GetDepositWithdrawStatusRequest): Promise<any[]>;
|
|
748
|
+
smallAssetsConvert(ccy: string[]): Promise<any[]>;
|
|
749
|
+
getExchanges(): Promise<any[]>;
|
|
750
|
+
applyForMonthlyStatement(params?: {
|
|
751
|
+
month?: string;
|
|
752
|
+
}): Promise<any[]>;
|
|
753
|
+
getMonthlyStatement(params: {
|
|
754
|
+
month: string;
|
|
755
|
+
}): Promise<any[]>;
|
|
756
|
+
getConvertCurrencies(): Promise<any[]>;
|
|
757
|
+
getConvertCurrencyPair(fromCcy: string, toCcy: string): Promise<any[]>;
|
|
758
|
+
estimateConvertQuote(params: ConvertQuoteEstimateRequest): Promise<any[]>;
|
|
759
|
+
convertTrade(params: ConvertTradeRequest): Promise<any[]>;
|
|
760
|
+
getConvertHistory(params?: any): Promise<any[]>;
|
|
761
|
+
/**
|
|
762
|
+
*
|
|
763
|
+
* Subaccount - REST endpoints
|
|
764
|
+
*
|
|
765
|
+
*/
|
|
766
|
+
/** View sub-account list */
|
|
767
|
+
getSubAccountList(params?: any): Promise<SubAccount[]>;
|
|
768
|
+
/** Reset the APIKey of a sub-account */
|
|
769
|
+
resetSubAccountAPIKey(subAcct: string, apiKey: string, options?: {
|
|
770
|
+
label?: string;
|
|
771
|
+
perm?: string;
|
|
772
|
+
ip?: string;
|
|
773
|
+
}): Promise<SubAccountAPIReset[]>;
|
|
774
|
+
/** Get sub-account trading balance */
|
|
775
|
+
getSubAccountBalances(subAcct: string): Promise<SubAccountBalances[]>;
|
|
776
|
+
/** Get sub-account funding balance */
|
|
777
|
+
getSubAccountFundingBalances(subAcct: string, ccy?: string): Promise<FundingBalance[]>;
|
|
778
|
+
getSubAccountMaxWithdrawal(params: GetSubAccountMaxWithdrawalsRequest): Promise<SubAccountMaxWithdrawal[]>;
|
|
779
|
+
/** History of sub-account transfer */
|
|
780
|
+
getSubAccountTransferHistory(params?: {
|
|
781
|
+
ccy?: string;
|
|
782
|
+
type?: '0' | '1';
|
|
783
|
+
subAcct?: string;
|
|
784
|
+
after?: string;
|
|
785
|
+
before?: string;
|
|
786
|
+
limit?: string;
|
|
787
|
+
}): Promise<any[]>;
|
|
788
|
+
getManagedSubAccountTransferHistory(params: GetManagedSubAccountTransferHistoryRequest): Promise<ManagedSubAccountTransfer[]>;
|
|
789
|
+
/** Master accounts manage the transfers between sub-accounts */
|
|
790
|
+
transferSubAccountBalance(params: SubAccountTransferRequest): Promise<SubAccountTransferResult[]>;
|
|
791
|
+
/** Set Permission Of Transfer Out */
|
|
792
|
+
setSubAccountTransferOutPermission(subAcct: string, canTransOut?: boolean): Promise<any[]>;
|
|
793
|
+
/** Get custody trading sub-account list */
|
|
794
|
+
getSubAccountCustodyTradingList(subAcct?: string): Promise<any[]>;
|
|
795
|
+
setSubAccountLoanAllocation(params: SetSubAccountLoanAllocationRequest): Promise<{
|
|
796
|
+
result: boolean;
|
|
797
|
+
}[]>;
|
|
798
|
+
getSubAccountBorrowInterestAndLimit(params: {
|
|
799
|
+
subAcct: string;
|
|
800
|
+
ccy?: string;
|
|
801
|
+
}): Promise<any[]>;
|
|
802
|
+
/**
|
|
803
|
+
*
|
|
804
|
+
* Financial product - on chain earn endpoints
|
|
805
|
+
*
|
|
806
|
+
*/
|
|
807
|
+
/** Get earn offers */
|
|
808
|
+
getStakingOffers(params?: {
|
|
809
|
+
productId?: string;
|
|
810
|
+
protocolType?: 'staking' | 'defi';
|
|
811
|
+
ccy?: string;
|
|
812
|
+
}): Promise<any[]>;
|
|
813
|
+
/** Earn/staking purchase */
|
|
814
|
+
submitStake(productId: string, investData: {
|
|
815
|
+
ccy: string;
|
|
816
|
+
amt: string;
|
|
817
|
+
}[], term?: string): Promise<any[]>;
|
|
818
|
+
/** Earn/staking redeem */
|
|
819
|
+
redeemStake(ordId: string, protocolType: 'staking' | 'defi', allowEarlyRedeem?: boolean): Promise<any[]>;
|
|
820
|
+
/** Earn/staking cancel purchases/redemptions */
|
|
821
|
+
cancelStakingRequest(ordId: string, protocolType: 'staking' | 'defi'): Promise<any[]>;
|
|
822
|
+
/** Earn/staking get active orders */
|
|
823
|
+
getActiveStakingOrders(params?: {
|
|
824
|
+
productId?: string;
|
|
825
|
+
protocolType?: 'staking' | 'defi';
|
|
826
|
+
ccy?: string;
|
|
827
|
+
state?: '8' | '13' | '9' | '1' | '2';
|
|
828
|
+
}): Promise<any[]>;
|
|
829
|
+
/** Earn/staking get order history */
|
|
830
|
+
getStakingOrderHistory(params?: {
|
|
831
|
+
productId?: string;
|
|
832
|
+
protocolType?: string;
|
|
833
|
+
ccy?: string;
|
|
834
|
+
after?: string;
|
|
835
|
+
before?: string;
|
|
836
|
+
limit?: string;
|
|
837
|
+
}): Promise<any[]>;
|
|
838
|
+
/**
|
|
839
|
+
*
|
|
840
|
+
* Financial product - ETH staking endpoints
|
|
841
|
+
*
|
|
842
|
+
*/
|
|
843
|
+
purchaseETHStaking(params: {
|
|
844
|
+
amt: string;
|
|
845
|
+
}): Promise<any[]>;
|
|
846
|
+
redeemETHStaking(params: {
|
|
847
|
+
amt: string;
|
|
848
|
+
}): Promise<any[]>;
|
|
849
|
+
getETHStakingBalance(): Promise<any[]>;
|
|
850
|
+
getETHStakingHistory(params: {
|
|
851
|
+
type: 'purchase' | 'redeem';
|
|
852
|
+
status?: 'pending' | 'success' | 'failed';
|
|
853
|
+
after?: string;
|
|
854
|
+
before?: string;
|
|
855
|
+
limit?: string;
|
|
856
|
+
}): Promise<any[]>;
|
|
857
|
+
getAPYHistory(params: {
|
|
858
|
+
days: string;
|
|
859
|
+
}): Promise<any[]>;
|
|
860
|
+
/**
|
|
861
|
+
*
|
|
862
|
+
* Financial product - simple earn flexible endpoints
|
|
863
|
+
*
|
|
864
|
+
*/
|
|
865
|
+
getSavingBalance(ccy?: string): Promise<any[]>;
|
|
866
|
+
savingsPurchaseRedemption(ccy: string, amt: numberInString, side: 'purchase' | 'redempt', rate: numberInString): Promise<any[]>;
|
|
867
|
+
setLendingRate(ccy: string, rate: numberInString): Promise<any[]>;
|
|
868
|
+
getLendingHistory(params?: PaginatedSymbolRequest): Promise<any[]>;
|
|
869
|
+
getPublicBorrowInfo(ccy?: string): Promise<any[]>;
|
|
870
|
+
getPublicBorrowHistory(params?: PaginatedSymbolRequest): Promise<any[]>;
|
|
871
|
+
/**
|
|
872
|
+
*
|
|
873
|
+
* Financial product - simple earn fixed endpoints
|
|
874
|
+
*
|
|
875
|
+
*/
|
|
876
|
+
getLendingOffers(params?: {
|
|
877
|
+
ccy?: string;
|
|
878
|
+
term?: string;
|
|
879
|
+
}): Promise<any[]>;
|
|
880
|
+
getLendingAPYHistory(params: {
|
|
881
|
+
ccy: string;
|
|
882
|
+
term: string;
|
|
883
|
+
}): Promise<any[]>;
|
|
884
|
+
getLendingVolume(params: {
|
|
885
|
+
ccy: string;
|
|
886
|
+
term: string;
|
|
887
|
+
}): Promise<any[]>;
|
|
888
|
+
placeLendingOrder(params: LendingOrder): Promise<any[]>;
|
|
889
|
+
amendLendingOrder(params: LendingOrder): Promise<any[]>;
|
|
890
|
+
getLendingOrders(params: GetLendingOrderListRequest): Promise<any[]>;
|
|
891
|
+
getLendingSubOrders(params: GetLendingSubOrderListRequest): Promise<any[]>;
|
|
892
|
+
/**
|
|
893
|
+
*
|
|
894
|
+
* Affiliate endpoints
|
|
895
|
+
*
|
|
896
|
+
*/
|
|
897
|
+
getInviteeDetail(params: {
|
|
898
|
+
uid: string;
|
|
899
|
+
}): Promise<any[]>;
|
|
900
|
+
getAffiliateRebateInfo(params: {
|
|
901
|
+
apiKey: string;
|
|
902
|
+
}): Promise<any[]>;
|
|
413
903
|
/**
|
|
414
904
|
*
|
|
415
905
|
* Status endpoints (public)
|
|
@@ -421,6 +911,10 @@ export declare class RestClient extends BaseRestClient {
|
|
|
421
911
|
* Broker endpoints (private)
|
|
422
912
|
*
|
|
423
913
|
*/
|
|
914
|
+
/**
|
|
915
|
+
*
|
|
916
|
+
* @deprecated
|
|
917
|
+
*/
|
|
424
918
|
getBrokerAccountInformation(): Promise<any[]>;
|
|
425
919
|
createSubAccount(params: {
|
|
426
920
|
subAcct: string;
|