feat(): added futures response types
This commit is contained in:
@@ -23,16 +23,28 @@ import {
|
|||||||
CreateVirtualSubRequestV2,
|
CreateVirtualSubRequestV2,
|
||||||
FundingAssetsV2,
|
FundingAssetsV2,
|
||||||
FuturesAccountBillRequestV2,
|
FuturesAccountBillRequestV2,
|
||||||
|
FuturesAccountBillV2,
|
||||||
|
FuturesAccountListV2,
|
||||||
|
FuturesAccountV2,
|
||||||
FuturesActiveBuySellVolumeV2,
|
FuturesActiveBuySellVolumeV2,
|
||||||
FuturesActiveLongShortAccountV2,
|
FuturesActiveLongShortAccountV2,
|
||||||
FuturesActiveLongShortPositionV2,
|
FuturesActiveLongShortPositionV2,
|
||||||
FuturesBatchCancelOrderRequestV2,
|
FuturesBatchCancelOrderRequestV2,
|
||||||
FuturesBatchOrderRequestV2,
|
FuturesBatchOrderRequestV2,
|
||||||
|
FuturesBatchOrderResponseV2,
|
||||||
FuturesCancelAllOrdersRequestV2,
|
FuturesCancelAllOrdersRequestV2,
|
||||||
|
FuturesCancelAllOrdersV2,
|
||||||
FuturesCancelOrderRequestV2,
|
FuturesCancelOrderRequestV2,
|
||||||
FuturesCancelPlanOrderRequestV2,
|
FuturesCancelPlanOrderRequestV2,
|
||||||
|
FuturesCancelPlanOrderV2,
|
||||||
FuturesCandlesRequestV2,
|
FuturesCandlesRequestV2,
|
||||||
|
FuturesCandlestickV2,
|
||||||
|
FuturesClosePositionResponseV2,
|
||||||
|
FuturesContractConfigV2,
|
||||||
|
FuturesDiscountRateV2,
|
||||||
|
FuturesFillV2,
|
||||||
FuturesFlashClosePositionsRequestV2,
|
FuturesFlashClosePositionsRequestV2,
|
||||||
|
FuturesFundingTimeV2,
|
||||||
FuturesGetHistoricalFillsRequestV2,
|
FuturesGetHistoricalFillsRequestV2,
|
||||||
FuturesGetHistoryOrdersRequestV2,
|
FuturesGetHistoryOrdersRequestV2,
|
||||||
FuturesGetHistoryPlanOrdersRequestV2,
|
FuturesGetHistoryPlanOrdersRequestV2,
|
||||||
@@ -40,17 +52,32 @@ import {
|
|||||||
FuturesGetOrderFillsRequestV2,
|
FuturesGetOrderFillsRequestV2,
|
||||||
FuturesGetOrderRequestV2,
|
FuturesGetOrderRequestV2,
|
||||||
FuturesGetPlanOrdersRequestV2,
|
FuturesGetPlanOrdersRequestV2,
|
||||||
|
FuturesHistoricalFundingRateV2,
|
||||||
FuturesHistoricalPositionsRequestV2,
|
FuturesHistoricalPositionsRequestV2,
|
||||||
|
FuturesHistoricalPositionV2,
|
||||||
FuturesHistoricTradesRequestV2,
|
FuturesHistoricTradesRequestV2,
|
||||||
|
FuturesHistoryOrdersV2,
|
||||||
|
FuturesHistoryPlanOrderV2,
|
||||||
|
FuturesInterestExchangeRateV2,
|
||||||
FuturesInterestHistoryRequestV2,
|
FuturesInterestHistoryRequestV2,
|
||||||
|
FuturesInterestHistoryV2,
|
||||||
|
FuturesInterestRateHistoryV2,
|
||||||
FuturesLongShortRatioV2,
|
FuturesLongShortRatioV2,
|
||||||
FuturesMergeDepthRequestV2,
|
FuturesMergeDepthRequestV2,
|
||||||
|
FuturesMergeDepthV2,
|
||||||
FuturesModifyOrderRequestV2,
|
FuturesModifyOrderRequestV2,
|
||||||
FuturesModifyPlanOrderRequestV2,
|
FuturesModifyPlanOrderRequestV2,
|
||||||
FuturesModifyTPSLOrderRequestV2,
|
FuturesModifyTPSLOrderRequestV2,
|
||||||
FuturesOpenCountRequestV2,
|
FuturesOpenCountRequestV2,
|
||||||
|
FuturesOpenInterestV2,
|
||||||
|
FuturesOpenOrdersV2,
|
||||||
|
FuturesOrderDetailV2,
|
||||||
|
FuturesOrderFillsV2,
|
||||||
|
FuturesPendingPlanOrderV2,
|
||||||
FuturesPlaceOrderRequestV2,
|
FuturesPlaceOrderRequestV2,
|
||||||
FuturesPlanOrderRequestV2,
|
FuturesPlanOrderRequestV2,
|
||||||
|
FuturesPositionTierV2,
|
||||||
|
FuturesPositionV2,
|
||||||
FuturesProductTypeV2,
|
FuturesProductTypeV2,
|
||||||
FuturesRecentTradesRequestV2,
|
FuturesRecentTradesRequestV2,
|
||||||
FuturesReversalOrderRequestV2,
|
FuturesReversalOrderRequestV2,
|
||||||
@@ -59,9 +86,14 @@ import {
|
|||||||
FuturesSetMarginModeRequestV2,
|
FuturesSetMarginModeRequestV2,
|
||||||
FuturesSetPositionMarginRequestV2,
|
FuturesSetPositionMarginRequestV2,
|
||||||
FuturesSingleAccountRequestV2,
|
FuturesSingleAccountRequestV2,
|
||||||
|
FuturesSubAccountAssetsV2,
|
||||||
|
FuturesSymbolPriceV2,
|
||||||
|
FuturesTickerV2,
|
||||||
FuturesTPSLOrderRequestV2,
|
FuturesTPSLOrderRequestV2,
|
||||||
FuturesTraderSymbolSettingRequestV2,
|
FuturesTraderSymbolSettingRequestV2,
|
||||||
FuturesTransactionRecordV2,
|
FuturesTransactionRecordV2,
|
||||||
|
FuturesTriggerSubOrderV2,
|
||||||
|
FuturesVipFeeRateV2,
|
||||||
GetAnnouncementsRequestV2,
|
GetAnnouncementsRequestV2,
|
||||||
GetBorrowHistoryRequestV2,
|
GetBorrowHistoryRequestV2,
|
||||||
GetConvertBGBHistoryRequestV2,
|
GetConvertBGBHistoryRequestV2,
|
||||||
@@ -136,6 +168,8 @@ import {
|
|||||||
P2PMerchantOrderV2,
|
P2PMerchantOrderV2,
|
||||||
RedeemSavingsRequestV2,
|
RedeemSavingsRequestV2,
|
||||||
RepayLoanRequestV2,
|
RepayLoanRequestV2,
|
||||||
|
SetLeverageResponseV2,
|
||||||
|
SetMarginModeResponseV2,
|
||||||
SpotAccountAssetV2,
|
SpotAccountAssetV2,
|
||||||
SpotAccountBillV2,
|
SpotAccountBillV2,
|
||||||
SpotAccountInfoV2,
|
SpotAccountInfoV2,
|
||||||
@@ -990,97 +1024,99 @@ export class RestClientV2 extends BaseRestClient {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
getFuturesVIPFeeRate(): Promise<APIResponse<any>> {
|
getFuturesVIPFeeRate(): Promise<APIResponse<FuturesVipFeeRateV2[]>> {
|
||||||
return this.get('/api/v2/mix/market/vip-fee-rate');
|
return this.get('/api/v2/mix/market/vip-fee-rate');
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesInterestRateHistory(params: {
|
getFuturesInterestRateHistory(params: {
|
||||||
coin: string;
|
coin: string;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<FuturesInterestRateHistoryV2>> {
|
||||||
return this.get('/api/v2/mix/market/union-interest-rate-history', params);
|
return this.get('/api/v2/mix/market/union-interest-rate-history', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getFuturesInterestExchangeRate(): Promise<
|
||||||
|
APIResponse<FuturesInterestExchangeRateV2[]>
|
||||||
|
> {
|
||||||
|
return this.get('/api/v2/mix/market/exchange-rate');
|
||||||
|
}
|
||||||
|
|
||||||
|
getFuturesDiscountRate(): Promise<APIResponse<FuturesDiscountRateV2[]>> {
|
||||||
|
return this.get('/api/v2/mix/market/discount-rate');
|
||||||
|
}
|
||||||
|
|
||||||
|
getFuturesMergeDepth(
|
||||||
|
params: FuturesMergeDepthRequestV2,
|
||||||
|
): Promise<APIResponse<FuturesMergeDepthV2>> {
|
||||||
|
return this.get('/api/v2/mix/market/merge-depth', params);
|
||||||
|
}
|
||||||
|
|
||||||
getFuturesTicker(params: {
|
getFuturesTicker(params: {
|
||||||
symbol: string;
|
symbol: string;
|
||||||
productType: FuturesProductTypeV2;
|
productType: FuturesProductTypeV2;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<FuturesTickerV2[]>> {
|
||||||
return this.get('/api/v2/mix/market/ticker', params);
|
return this.get('/api/v2/mix/market/ticker', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesInterestExchangeRate(): Promise<APIResponse<any>> {
|
|
||||||
return this.get('/api/v2/mix/market/exchange-rate');
|
|
||||||
}
|
|
||||||
|
|
||||||
getFuturesDiscountRate(): Promise<APIResponse<any>> {
|
|
||||||
return this.get('/api/v2/mix/market/discount-rate');
|
|
||||||
}
|
|
||||||
|
|
||||||
getFuturesAllTickers(params: {
|
getFuturesAllTickers(params: {
|
||||||
productType: FuturesProductTypeV2;
|
productType: FuturesProductTypeV2;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<FuturesTickerV2[]>> {
|
||||||
return this.get('/api/v2/mix/market/tickers', params);
|
return this.get('/api/v2/mix/market/tickers', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesMergeDepth(
|
|
||||||
params: FuturesMergeDepthRequestV2,
|
|
||||||
): Promise<APIResponse<any>> {
|
|
||||||
return this.get('/api/v2/mix/market/merge-depth', params);
|
|
||||||
}
|
|
||||||
|
|
||||||
getFuturesCandles(
|
|
||||||
params: FuturesCandlesRequestV2,
|
|
||||||
): Promise<APIResponse<any>> {
|
|
||||||
return this.get('/api/v2/mix/market/candles', params);
|
|
||||||
}
|
|
||||||
|
|
||||||
getFuturesHistoricCandles(
|
|
||||||
params: FuturesCandlesRequestV2,
|
|
||||||
): Promise<APIResponse<any>> {
|
|
||||||
return this.get('/api/v2/mix/market/history-candles', params);
|
|
||||||
}
|
|
||||||
|
|
||||||
getFuturesHistoricIndexPriceCandles(
|
|
||||||
params: FuturesCandlesRequestV2,
|
|
||||||
): Promise<APIResponse<any>> {
|
|
||||||
return this.get('/api/v2/mix/market/history-index-candles', params);
|
|
||||||
}
|
|
||||||
|
|
||||||
getFuturesHistoricMarkPriceCandles(
|
|
||||||
params: FuturesCandlesRequestV2,
|
|
||||||
): Promise<APIResponse<any>> {
|
|
||||||
return this.get('/api/v2/mix/market/history-mark-candles', params);
|
|
||||||
}
|
|
||||||
|
|
||||||
getFuturesRecentTrades(
|
getFuturesRecentTrades(
|
||||||
params: FuturesRecentTradesRequestV2,
|
params: FuturesRecentTradesRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<FuturesFillV2[]>> {
|
||||||
return this.get('/api/v2/mix/market/fills', params);
|
return this.get('/api/v2/mix/market/fills', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesHistoricTrades(
|
getFuturesHistoricTrades(
|
||||||
params: FuturesHistoricTradesRequestV2,
|
params: FuturesHistoricTradesRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<FuturesFillV2[]>> {
|
||||||
return this.get('/api/v2/mix/market/fills-history', params);
|
return this.get('/api/v2/mix/market/fills-history', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getFuturesCandles(
|
||||||
|
params: FuturesCandlesRequestV2,
|
||||||
|
): Promise<APIResponse<FuturesCandlestickV2[]>> {
|
||||||
|
return this.get('/api/v2/mix/market/candles', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
getFuturesHistoricCandles(
|
||||||
|
params: FuturesCandlesRequestV2,
|
||||||
|
): Promise<APIResponse<FuturesCandlestickV2[]>> {
|
||||||
|
return this.get('/api/v2/mix/market/history-candles', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
getFuturesHistoricIndexPriceCandles(
|
||||||
|
params: FuturesCandlesRequestV2,
|
||||||
|
): Promise<APIResponse<FuturesCandlestickV2[]>> {
|
||||||
|
return this.get('/api/v2/mix/market/history-index-candles', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
getFuturesHistoricMarkPriceCandles(
|
||||||
|
params: FuturesCandlesRequestV2,
|
||||||
|
): Promise<APIResponse<FuturesCandlestickV2[]>> {
|
||||||
|
return this.get('/api/v2/mix/market/history-mark-candles', params);
|
||||||
|
}
|
||||||
|
|
||||||
getFuturesOpenInterest(params: {
|
getFuturesOpenInterest(params: {
|
||||||
symbol: string;
|
symbol: string;
|
||||||
productType: FuturesProductTypeV2;
|
productType: FuturesProductTypeV2;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<FuturesOpenInterestV2>> {
|
||||||
return this.get('/api/v2/mix/market/open-interest', params);
|
return this.get('/api/v2/mix/market/open-interest', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesNextFundingTime(params: {
|
getFuturesNextFundingTime(params: {
|
||||||
symbol: string;
|
symbol: string;
|
||||||
productType: FuturesProductTypeV2;
|
productType: FuturesProductTypeV2;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<FuturesFundingTimeV2[]>> {
|
||||||
return this.get('/api/v2/mix/market/funding-time', params);
|
return this.get('/api/v2/mix/market/funding-time', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesSymbolPrice(params: {
|
getFuturesSymbolPrice(params: {
|
||||||
symbol: string;
|
symbol: string;
|
||||||
productType: FuturesProductTypeV2;
|
productType: FuturesProductTypeV2;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<FuturesSymbolPriceV2[]>> {
|
||||||
return this.get('/api/v2/mix/market/symbol-price', params);
|
return this.get('/api/v2/mix/market/symbol-price', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1089,21 +1125,28 @@ export class RestClientV2 extends BaseRestClient {
|
|||||||
productType: FuturesProductTypeV2;
|
productType: FuturesProductTypeV2;
|
||||||
pageSize?: string;
|
pageSize?: string;
|
||||||
pageNumber?: string;
|
pageNumber?: string;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<FuturesHistoricalFundingRateV2>> {
|
||||||
return this.get('/api/v2/mix/market/history-fund-rate', params);
|
return this.get('/api/v2/mix/market/history-fund-rate', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesCurrentFundingRate(params: {
|
getFuturesCurrentFundingRate(params: {
|
||||||
symbol: string;
|
symbol: string;
|
||||||
productType: FuturesProductTypeV2;
|
productType: FuturesProductTypeV2;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<
|
||||||
|
APIResponse<
|
||||||
|
{
|
||||||
|
symbol: string;
|
||||||
|
fundingRate: string;
|
||||||
|
}[]
|
||||||
|
>
|
||||||
|
> {
|
||||||
return this.get('/api/v2/mix/market/current-fund-rate', params);
|
return this.get('/api/v2/mix/market/current-fund-rate', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesContractConfig(params: {
|
getFuturesContractConfig(params: {
|
||||||
symbol: string;
|
symbol: string;
|
||||||
productType: FuturesProductTypeV2;
|
productType: FuturesProductTypeV2;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<FuturesContractConfigV2[]>> {
|
||||||
return this.get('/api/v2/mix/market/contracts', params);
|
return this.get('/api/v2/mix/market/contracts', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1115,75 +1158,81 @@ export class RestClientV2 extends BaseRestClient {
|
|||||||
|
|
||||||
getFuturesAccountAsset(
|
getFuturesAccountAsset(
|
||||||
params: FuturesSingleAccountRequestV2,
|
params: FuturesSingleAccountRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<FuturesAccountV2>> {
|
||||||
return this.getPrivate('/api/v2/mix/account/account', params);
|
return this.getPrivate('/api/v2/mix/account/account', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesAccountAssets(params: {
|
getFuturesAccountAssets(params: {
|
||||||
productType: FuturesProductTypeV2;
|
productType: FuturesProductTypeV2;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<FuturesAccountListV2[]>> {
|
||||||
return this.getPrivate('/api/v2/mix/account/accounts', params);
|
return this.getPrivate('/api/v2/mix/account/accounts', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesSubAccountAssets(params: {
|
getFuturesSubAccountAssets(params: {
|
||||||
productType: FuturesProductTypeV2;
|
productType: FuturesProductTypeV2;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<FuturesSubAccountAssetsV2[]>> {
|
||||||
return this.getPrivate('/api/v2/mix/account/sub-account-assets', params);
|
return this.getPrivate('/api/v2/mix/account/sub-account-assets', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesInterestHistory(
|
getFuturesInterestHistory(
|
||||||
params: FuturesInterestHistoryRequestV2,
|
params: FuturesInterestHistoryRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<FuturesInterestHistoryV2[]>> {
|
||||||
return this.getPrivate('/api/v2/mix/account/interest-history', params);
|
return this.getPrivate('/api/v2/mix/account/interest-history', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesOpenCount(
|
getFuturesOpenCount(params: FuturesOpenCountRequestV2): Promise<
|
||||||
params: FuturesOpenCountRequestV2,
|
APIResponse<{
|
||||||
): Promise<APIResponse<any>> {
|
size: string;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
return this.getPrivate('/api/v2/mix/account/open-count', params);
|
return this.getPrivate('/api/v2/mix/account/open-count', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
setFuturesLeverage(
|
|
||||||
params: FuturesSetLeverageRequestV2,
|
|
||||||
): Promise<APIResponse<any>> {
|
|
||||||
return this.postPrivate('/api/v2/mix/account/set-leverage', params);
|
|
||||||
}
|
|
||||||
|
|
||||||
setFuturesPositionAutoMargin(
|
setFuturesPositionAutoMargin(
|
||||||
params: FuturesSetAutoMarginRequestV2,
|
params: FuturesSetAutoMarginRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<string>> {
|
||||||
return this.postPrivate('/api/v2/mix/account/set-auto-margin', params);
|
return this.postPrivate('/api/v2/mix/account/set-auto-margin', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setFuturesLeverage(
|
||||||
|
params: FuturesSetLeverageRequestV2,
|
||||||
|
): Promise<APIResponse<SetLeverageResponseV2>> {
|
||||||
|
return this.postPrivate('/api/v2/mix/account/set-leverage', params);
|
||||||
|
}
|
||||||
|
|
||||||
setFuturesPositionMargin(
|
setFuturesPositionMargin(
|
||||||
params: FuturesSetPositionMarginRequestV2,
|
params: FuturesSetPositionMarginRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<string>> {
|
||||||
return this.postPrivate('/api/v2/mix/account/set-margin', params);
|
return this.postPrivate('/api/v2/mix/account/set-margin', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
setFuturesAssetMode(params: {
|
setFuturesAssetMode(params: {
|
||||||
productType: 'USDT-FUTURES' | 'SUSDT-FUTURES';
|
productType: 'USDT-FUTURES' | 'SUSDT-FUTURES';
|
||||||
assetMode: 'single' | 'union';
|
assetMode: 'single' | 'union';
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<string>> {
|
||||||
return this.postPrivate('/api/v2/mix/account/set-asset-mode', params);
|
return this.postPrivate('/api/v2/mix/account/set-asset-mode', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
setFuturesMarginMode(
|
setFuturesMarginMode(
|
||||||
params: FuturesSetMarginModeRequestV2,
|
params: FuturesSetMarginModeRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<SetMarginModeResponseV2>> {
|
||||||
return this.postPrivate('/api/v2/mix/account/set-margin-mode', params);
|
return this.postPrivate('/api/v2/mix/account/set-margin-mode', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
setFuturesPositionMode(params: {
|
setFuturesPositionMode(params: {
|
||||||
productType: FuturesProductTypeV2;
|
productType: FuturesProductTypeV2;
|
||||||
posMode: 'one_way_mode' | 'hedge_mode';
|
posMode: 'one_way_mode' | 'hedge_mode';
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<
|
||||||
|
APIResponse<{
|
||||||
|
posMode: 'one_way_mode' | 'hedge_mode';
|
||||||
|
}>
|
||||||
|
> {
|
||||||
return this.postPrivate('/api/v2/mix/account/set-position-mode', params);
|
return this.postPrivate('/api/v2/mix/account/set-position-mode', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesAccountBills(
|
getFuturesAccountBills(
|
||||||
params: FuturesAccountBillRequestV2,
|
params: FuturesAccountBillRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<FuturesAccountBillV2>> {
|
||||||
return this.getPrivate('/api/v2/mix/account/bill', params);
|
return this.getPrivate('/api/v2/mix/account/bill', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1196,7 +1245,7 @@ export class RestClientV2 extends BaseRestClient {
|
|||||||
getFuturesPositionTier(params: {
|
getFuturesPositionTier(params: {
|
||||||
productType: FuturesProductTypeV2;
|
productType: FuturesProductTypeV2;
|
||||||
symbol: string;
|
symbol: string;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<FuturesPositionTierV2[]>> {
|
||||||
return this.get('/api/v2/mix/market/query-position-lever', params);
|
return this.get('/api/v2/mix/market/query-position-lever', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1204,20 +1253,20 @@ export class RestClientV2 extends BaseRestClient {
|
|||||||
productType: FuturesProductTypeV2;
|
productType: FuturesProductTypeV2;
|
||||||
symbol: string;
|
symbol: string;
|
||||||
marginCoin: string;
|
marginCoin: string;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<FuturesPositionV2[]>> {
|
||||||
return this.getPrivate('/api/v2/mix/position/single-position', params);
|
return this.getPrivate('/api/v2/mix/position/single-position', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesPositions(params: {
|
getFuturesPositions(params: {
|
||||||
productType: FuturesProductTypeV2;
|
productType: FuturesProductTypeV2;
|
||||||
marginCoin?: string;
|
marginCoin?: string;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<FuturesPositionV2[]>> {
|
||||||
return this.getPrivate('/api/v2/mix/position/all-position', params);
|
return this.getPrivate('/api/v2/mix/position/all-position', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesHistoricPositions(
|
getFuturesHistoricPositions(
|
||||||
params?: FuturesHistoricalPositionsRequestV2,
|
params?: FuturesHistoricalPositionsRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<FuturesHistoricalPositionV2>> {
|
||||||
return this.getPrivate('/api/v2/mix/position/history-position', params);
|
return this.getPrivate('/api/v2/mix/position/history-position', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1227,79 +1276,93 @@ export class RestClientV2 extends BaseRestClient {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
futuresSubmitOrder(
|
futuresSubmitOrder(params: FuturesPlaceOrderRequestV2): Promise<
|
||||||
params: FuturesPlaceOrderRequestV2,
|
APIResponse<{
|
||||||
): Promise<APIResponse<any>> {
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
return this.postPrivate('/api/v2/mix/order/place-order', params);
|
return this.postPrivate('/api/v2/mix/order/place-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
futuresCancelOrder(
|
futuresSubmitReversal(params: FuturesReversalOrderRequestV2): Promise<
|
||||||
params: FuturesCancelOrderRequestV2,
|
APIResponse<{
|
||||||
): Promise<APIResponse<any>> {
|
orderId: string;
|
||||||
return this.postPrivate('/api/v2/mix/order/cancel-order', params);
|
clientOid: string;
|
||||||
}
|
}>
|
||||||
|
> {
|
||||||
futuresSubmitReversal(
|
|
||||||
params: FuturesReversalOrderRequestV2,
|
|
||||||
): Promise<APIResponse<any>> {
|
|
||||||
return this.postPrivate('/api/v2/mix/order/click-backhand', params);
|
return this.postPrivate('/api/v2/mix/order/click-backhand', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
futuresBatchSubmitOrders(
|
futuresBatchSubmitOrders(
|
||||||
params: FuturesBatchOrderRequestV2,
|
params: FuturesBatchOrderRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<FuturesBatchOrderResponseV2>> {
|
||||||
return this.postPrivate('/api/v2/mix/order/batch-place-order', params);
|
return this.postPrivate('/api/v2/mix/order/batch-place-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
futuresModifyOrder(
|
futuresModifyOrder(params: FuturesModifyOrderRequestV2): Promise<
|
||||||
params: FuturesModifyOrderRequestV2,
|
APIResponse<{
|
||||||
): Promise<APIResponse<any>> {
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
return this.postPrivate('/api/v2/mix/order/modify-order', params);
|
return this.postPrivate('/api/v2/mix/order/modify-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
futuresCancelOrder(params: FuturesCancelOrderRequestV2): Promise<
|
||||||
|
APIResponse<{
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
|
return this.postPrivate('/api/v2/mix/order/cancel-order', params);
|
||||||
|
}
|
||||||
|
|
||||||
futuresBatchCancelOrders(
|
futuresBatchCancelOrders(
|
||||||
params: FuturesBatchCancelOrderRequestV2,
|
params: FuturesBatchCancelOrderRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<FuturesBatchOrderResponseV2>> {
|
||||||
return this.postPrivate('/api/v2/mix/order/batch-cancel-orders', params);
|
return this.postPrivate('/api/v2/mix/order/batch-cancel-orders', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
futuresFlashClosePositions(
|
futuresFlashClosePositions(
|
||||||
params: FuturesFlashClosePositionsRequestV2,
|
params: FuturesFlashClosePositionsRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<FuturesClosePositionResponseV2>> {
|
||||||
return this.postPrivate('/api/v2/mix/order/close-positions', params);
|
return this.postPrivate('/api/v2/mix/order/close-positions', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesOrder(params: FuturesGetOrderRequestV2): Promise<APIResponse<any>> {
|
getFuturesOrder(
|
||||||
|
params: FuturesGetOrderRequestV2,
|
||||||
|
): Promise<APIResponse<FuturesOrderDetailV2>> {
|
||||||
return this.getPrivate('/api/v2/mix/order/detail', params);
|
return this.getPrivate('/api/v2/mix/order/detail', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesFills(
|
getFuturesFills(
|
||||||
params: FuturesGetOrderFillsRequestV2,
|
params: FuturesGetOrderFillsRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<FuturesOrderFillsV2>> {
|
||||||
return this.getPrivate('/api/v2/mix/order/fills', params);
|
return this.getPrivate('/api/v2/mix/order/fills', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesHistoricOrderFills(
|
getFuturesHistoricOrderFills(
|
||||||
params: FuturesGetHistoricalFillsRequestV2,
|
params: FuturesGetHistoricalFillsRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<FuturesOrderFillsV2>> {
|
||||||
return this.getPrivate('/api/v2/mix/order/fill-history', params);
|
return this.getPrivate('/api/v2/mix/order/fill-history', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesOpenOrders(
|
getFuturesOpenOrders(
|
||||||
params: FuturesGetOpenOrdersRequestV2,
|
params: FuturesGetOpenOrdersRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<FuturesOpenOrdersV2>> {
|
||||||
return this.getPrivate('/api/v2/mix/order/orders-pending', params);
|
return this.getPrivate('/api/v2/mix/order/orders-pending', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFuturesHistoricOrders(
|
getFuturesHistoricOrders(
|
||||||
params: FuturesGetHistoryOrdersRequestV2,
|
params: FuturesGetHistoryOrdersRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<FuturesHistoryOrdersV2>> {
|
||||||
return this.getPrivate('/api/v2/mix/order/orders-history', params);
|
return this.getPrivate('/api/v2/mix/order/orders-history', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
futuresCancelAllOrders(
|
futuresCancelAllOrders(
|
||||||
params: FuturesCancelAllOrdersRequestV2,
|
params: FuturesCancelAllOrdersRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<FuturesCancelAllOrdersV2>> {
|
||||||
return this.postPrivate('/api/v2/mix/order/cancel-all-orders', params);
|
return this.postPrivate('/api/v2/mix/order/cancel-all-orders', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1309,53 +1372,65 @@ export class RestClientV2 extends BaseRestClient {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
futuresSubmitPlanSubOrder(params: {
|
getFuturesTriggerSubOrder(params: {
|
||||||
planType: 'normal_plan' | 'track_plan';
|
planType: 'normal_plan' | 'track_plan';
|
||||||
planOrderId: string;
|
planOrderId: string;
|
||||||
productType: FuturesProductTypeV2;
|
productType: FuturesProductTypeV2;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<FuturesTriggerSubOrderV2[]>> {
|
||||||
return this.postPrivate('/api/v2/mix/order/plan-sub-order', params);
|
return this.getPrivate('/api/v2/mix/order/plan-sub-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
futuresSubmitTPSLOrder(
|
futuresSubmitTPSLOrder(params: FuturesTPSLOrderRequestV2): Promise<
|
||||||
params: FuturesTPSLOrderRequestV2,
|
APIResponse<{
|
||||||
): Promise<APIResponse<any>> {
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
return this.postPrivate('/api/v2/mix/order/place-tpsl-order', params);
|
return this.postPrivate('/api/v2/mix/order/place-tpsl-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
futuresSubmitPlanOrder(
|
futuresSubmitPlanOrder(params: FuturesPlanOrderRequestV2): Promise<
|
||||||
params: FuturesPlanOrderRequestV2,
|
APIResponse<{
|
||||||
): Promise<APIResponse<any>> {
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
return this.postPrivate('/api/v2/mix/order/place-plan-order', params);
|
return this.postPrivate('/api/v2/mix/order/place-plan-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
futuresModifyTPSLPOrder(
|
futuresModifyTPSLPOrder(params: FuturesModifyTPSLOrderRequestV2): Promise<
|
||||||
params: FuturesModifyTPSLOrderRequestV2,
|
APIResponse<{
|
||||||
): Promise<APIResponse<any>> {
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
return this.postPrivate('/api/v2/mix/order/modify-tpsl-order', params);
|
return this.postPrivate('/api/v2/mix/order/modify-tpsl-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
futuresModifyPlanOrder(
|
futuresModifyPlanOrder(params: FuturesModifyPlanOrderRequestV2): Promise<
|
||||||
params: FuturesModifyPlanOrderRequestV2,
|
APIResponse<{
|
||||||
): Promise<APIResponse<any>> {
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
return this.postPrivate('/api/v2/mix/order/modify-plan-order', params);
|
return this.postPrivate('/api/v2/mix/order/modify-plan-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
futuresCancelPlanOrder(
|
|
||||||
params: FuturesCancelPlanOrderRequestV2,
|
|
||||||
): Promise<APIResponse<any>> {
|
|
||||||
return this.postPrivate('/api/v2/mix/order/cancel-plan-order', params);
|
|
||||||
}
|
|
||||||
|
|
||||||
getFuturesPlanOrders(
|
getFuturesPlanOrders(
|
||||||
params: FuturesGetPlanOrdersRequestV2,
|
params: FuturesGetPlanOrdersRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<FuturesPendingPlanOrderV2>> {
|
||||||
return this.getPrivate('/api/v2/mix/order/orders-plan-pending', params);
|
return this.getPrivate('/api/v2/mix/order/orders-plan-pending', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
futuresCancelPlanOrder(
|
||||||
|
params: FuturesCancelPlanOrderRequestV2,
|
||||||
|
): Promise<APIResponse<FuturesCancelPlanOrderV2>> {
|
||||||
|
return this.postPrivate('/api/v2/mix/order/cancel-plan-order', params);
|
||||||
|
}
|
||||||
|
|
||||||
getFuturesHistoricPlanOrders(
|
getFuturesHistoricPlanOrders(
|
||||||
params: FuturesGetHistoryPlanOrdersRequestV2,
|
params: FuturesGetHistoryPlanOrdersRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<FuturesHistoryPlanOrderV2>> {
|
||||||
return this.getPrivate('/api/v2/mix/order/orders-plan-history', params);
|
return this.getPrivate('/api/v2/mix/order/orders-plan-history', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,4 +2,5 @@ export * from './v1/futures';
|
|||||||
export * from './v1/shared';
|
export * from './v1/shared';
|
||||||
export * from './v1/spot';
|
export * from './v1/spot';
|
||||||
export * from './v2/common';
|
export * from './v2/common';
|
||||||
|
export * from './v2/futures';
|
||||||
export * from './v2/spot';
|
export * from './v2/spot';
|
||||||
|
|||||||
614
src/types/response/v2/futures.ts
Normal file
614
src/types/response/v2/futures.ts
Normal file
@@ -0,0 +1,614 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* * Futures | Market
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface FuturesVipFeeRateV2 {
|
||||||
|
level: string;
|
||||||
|
dealAmount: string;
|
||||||
|
assetAmount: string;
|
||||||
|
takerFeeRate: string;
|
||||||
|
makerFeeRate: string;
|
||||||
|
btcWithdrawAmount: string;
|
||||||
|
usdtWithdrawAmount: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesInterestRateHistoryV2 {
|
||||||
|
coin: string;
|
||||||
|
historyInterestRateList: {
|
||||||
|
ts: string;
|
||||||
|
annualInterestRate: string;
|
||||||
|
dailyInterestRate: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesInterestExchangeRateV2 {
|
||||||
|
coin: string;
|
||||||
|
exchangeRateList: {
|
||||||
|
tier: string;
|
||||||
|
minAmount: string;
|
||||||
|
maxAmount: string;
|
||||||
|
exchangeRate: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesDiscountRateV2 {
|
||||||
|
coin: string;
|
||||||
|
userLimit: string;
|
||||||
|
totalLimit: string;
|
||||||
|
discountRateList: {
|
||||||
|
tier: string;
|
||||||
|
minAmount: string;
|
||||||
|
maxAmount: string;
|
||||||
|
discountRate: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesMergeDepthV2 {
|
||||||
|
asks: [number, number][];
|
||||||
|
bids: [number, number][];
|
||||||
|
ts: string;
|
||||||
|
scale: string;
|
||||||
|
precision: string;
|
||||||
|
isMaxPrecision: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesTickerV2 {
|
||||||
|
symbol: string;
|
||||||
|
lastPr: string;
|
||||||
|
askPr: string;
|
||||||
|
bidPr: string;
|
||||||
|
bidSz: string;
|
||||||
|
askSz: string;
|
||||||
|
high24h: string;
|
||||||
|
low24h: string;
|
||||||
|
ts: string;
|
||||||
|
change24h: string;
|
||||||
|
baseVolume: string;
|
||||||
|
quoteVolume: string;
|
||||||
|
usdtVolume: string;
|
||||||
|
openUtc: string;
|
||||||
|
changeUtc24h: string;
|
||||||
|
indexPrice: string;
|
||||||
|
fundingRate: string;
|
||||||
|
holdingAmount: string;
|
||||||
|
deliveryStartTime: string;
|
||||||
|
deliveryTime: string;
|
||||||
|
deliveryStatus: string;
|
||||||
|
open24h: string;
|
||||||
|
markPrice: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesFillV2 {
|
||||||
|
tradeId: string;
|
||||||
|
price: string;
|
||||||
|
size: string;
|
||||||
|
side: string;
|
||||||
|
ts: string;
|
||||||
|
symbol: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesCandlestickV2 {
|
||||||
|
[0]: string; // timestamp
|
||||||
|
[1]: string; // open
|
||||||
|
[2]: string; // high
|
||||||
|
[3]: string; // low
|
||||||
|
[4]: string; // close
|
||||||
|
[5]: string; // baseVolume
|
||||||
|
[6]: string; // quoteVolume
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesOpenInterestV2 {
|
||||||
|
openInterestList: {
|
||||||
|
symbol: string;
|
||||||
|
size: string;
|
||||||
|
}[];
|
||||||
|
ts: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesFundingTimeV2 {
|
||||||
|
symbol: string;
|
||||||
|
nextFundingTime: string;
|
||||||
|
ratePeriod: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesSymbolPriceV2 {
|
||||||
|
symbol: string;
|
||||||
|
price: string;
|
||||||
|
indexPrice: string;
|
||||||
|
markPrice: string;
|
||||||
|
ts: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesHistoricalFundingRateV2 {
|
||||||
|
symbol: string;
|
||||||
|
fundingRate: string;
|
||||||
|
fundingTime: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesContractConfigV2 {
|
||||||
|
symbol: string;
|
||||||
|
baseCoin: string;
|
||||||
|
quoteCoin: string;
|
||||||
|
buyLimitPriceRatio: string;
|
||||||
|
sellLimitPriceRatio: string;
|
||||||
|
feeRateUpRatio: string;
|
||||||
|
makerFeeRate: string;
|
||||||
|
takerFeeRate: string;
|
||||||
|
openCostUpRatio: string;
|
||||||
|
supportMarginCoins: string[];
|
||||||
|
minTradeNum: string;
|
||||||
|
priceEndStep: string;
|
||||||
|
volumePlace: string;
|
||||||
|
pricePlace: string;
|
||||||
|
sizeMultiplier: string;
|
||||||
|
symbolType: string;
|
||||||
|
minTradeUSDT: string;
|
||||||
|
maxSymbolOrderNum: string;
|
||||||
|
maxProductOrderNum: string;
|
||||||
|
maxPositionNum: string;
|
||||||
|
symbolStatus: string;
|
||||||
|
offTime: string;
|
||||||
|
limitOpenTime: string;
|
||||||
|
deliveryTime: string;
|
||||||
|
deliveryStartTime: string;
|
||||||
|
launchTime: string;
|
||||||
|
fundInterval: string;
|
||||||
|
minLever: string;
|
||||||
|
maxLever: string;
|
||||||
|
posLimit: string;
|
||||||
|
maintainTime: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* * Futures | Account
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface FuturesAccountV2 {
|
||||||
|
marginCoin: string;
|
||||||
|
locked: string;
|
||||||
|
available: string;
|
||||||
|
crossedMaxAvailable: string;
|
||||||
|
isolatedMaxAvailable: string;
|
||||||
|
maxTransferOut: string;
|
||||||
|
accountEquity: string;
|
||||||
|
usdtEquity: string;
|
||||||
|
btcEquity: string;
|
||||||
|
crossedRiskRate: string;
|
||||||
|
crossedMarginLeverage: string;
|
||||||
|
isolatedLongLever: string;
|
||||||
|
isolatedShortLever: string;
|
||||||
|
marginMode: string;
|
||||||
|
posMode: string;
|
||||||
|
unrealizedPL: string;
|
||||||
|
coupon: string;
|
||||||
|
crossedUnrealizedPL: string;
|
||||||
|
isolatedUnrealizedPL: string;
|
||||||
|
assetMode: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesAccountListV2 {
|
||||||
|
marginCoin: string;
|
||||||
|
locked: string;
|
||||||
|
available: string;
|
||||||
|
crossedMaxAvailable: string;
|
||||||
|
isolatedMaxAvailable: string;
|
||||||
|
maxTransferOut: string;
|
||||||
|
accountEquity: string;
|
||||||
|
usdtEquity: string;
|
||||||
|
btcEquity: string;
|
||||||
|
crossedRiskRate: string;
|
||||||
|
unrealizedPL: string;
|
||||||
|
coupon: string;
|
||||||
|
unionTotalMagin: string;
|
||||||
|
unionAvailable: string;
|
||||||
|
unionMm: string;
|
||||||
|
assetList: {
|
||||||
|
coin: string;
|
||||||
|
balance: string;
|
||||||
|
}[];
|
||||||
|
isolatedMargin: string;
|
||||||
|
crossedMargin: string;
|
||||||
|
crossedUnrealizedPL: string;
|
||||||
|
isolatedUnrealizedPL: string;
|
||||||
|
assetMode: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesSubAccountAssetsV2 {
|
||||||
|
userId: number;
|
||||||
|
assetList: {
|
||||||
|
marginCoin: string;
|
||||||
|
locked: string;
|
||||||
|
available: string;
|
||||||
|
crossedMaxAvailable: string;
|
||||||
|
isolatedMaxAvailable: string;
|
||||||
|
maxTransferOut: string;
|
||||||
|
accountEquity: string;
|
||||||
|
usdtEquity: string;
|
||||||
|
btcEquity: string;
|
||||||
|
unrealizedPL: string;
|
||||||
|
coupon: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesInterestHistoryV2 {
|
||||||
|
nextSettleTime: string;
|
||||||
|
borrowAmount: string;
|
||||||
|
borrowLimit: string;
|
||||||
|
interestList: {
|
||||||
|
coin: string;
|
||||||
|
liability: string;
|
||||||
|
interestFreeLimit: string;
|
||||||
|
interestLimit: string;
|
||||||
|
hourInterestRate: string;
|
||||||
|
interest: string;
|
||||||
|
cTime: string;
|
||||||
|
}[];
|
||||||
|
endId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SetLeverageResponseV2 {
|
||||||
|
symbol: string;
|
||||||
|
marginCoin: string;
|
||||||
|
longLeverage: string;
|
||||||
|
shortLeverage: string;
|
||||||
|
crossMarginLeverage: string;
|
||||||
|
marginMode: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SetMarginModeResponseV2 {
|
||||||
|
symbol: string;
|
||||||
|
marginCoin: string;
|
||||||
|
longLeverage: string;
|
||||||
|
shortLeverage: string;
|
||||||
|
marginMode: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesAccountBillV2 {
|
||||||
|
bills: {
|
||||||
|
billId: string;
|
||||||
|
symbol: string;
|
||||||
|
amount: string;
|
||||||
|
fee: string;
|
||||||
|
feeByCoupon: string;
|
||||||
|
businessType: string;
|
||||||
|
coin: string;
|
||||||
|
balance: string;
|
||||||
|
cTime: string;
|
||||||
|
}[];
|
||||||
|
endId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* * Futures | Position
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface FuturesPositionTierV2 {
|
||||||
|
symbol: string;
|
||||||
|
level: string;
|
||||||
|
startUnit: string;
|
||||||
|
endUnit: string;
|
||||||
|
leverage: string;
|
||||||
|
keepMarginRate: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesPositionV2 {
|
||||||
|
marginCoin: string;
|
||||||
|
symbol: string;
|
||||||
|
holdSide: string;
|
||||||
|
openDelegateSize: string;
|
||||||
|
marginSize: string;
|
||||||
|
available: string;
|
||||||
|
locked: string;
|
||||||
|
total: string;
|
||||||
|
leverage: string;
|
||||||
|
achievedProfits: string;
|
||||||
|
openPriceAvg: string;
|
||||||
|
marginMode: string;
|
||||||
|
posMode: string;
|
||||||
|
unrealizedPL: string;
|
||||||
|
liquidationPrice: string;
|
||||||
|
keepMarginRate: string;
|
||||||
|
markPrice: string;
|
||||||
|
breakEvenPrice: string;
|
||||||
|
totalFee: string;
|
||||||
|
deductedFee: string;
|
||||||
|
marginRatio: string;
|
||||||
|
assetMode: string;
|
||||||
|
uTime: string;
|
||||||
|
autoMargin: string;
|
||||||
|
cTime: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesHistoricalPositionV2 {
|
||||||
|
list: {
|
||||||
|
positionId: string;
|
||||||
|
marginCoin: string;
|
||||||
|
symbol: string;
|
||||||
|
holdSide: string;
|
||||||
|
openAvgPrice: string;
|
||||||
|
closeAvgPrice: string;
|
||||||
|
marginMode: string;
|
||||||
|
openTotalPos: string;
|
||||||
|
closeTotalPos: string;
|
||||||
|
pnl: string;
|
||||||
|
netProfit: string;
|
||||||
|
totalFunding: string;
|
||||||
|
openFee: string;
|
||||||
|
closeFee: string;
|
||||||
|
cTime: string;
|
||||||
|
uTime: string;
|
||||||
|
}[];
|
||||||
|
endId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* * Futures | Trade
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface FuturesBatchOrderResponseV2 {
|
||||||
|
successList: {
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}[];
|
||||||
|
failureList: {
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
errorMsg: string;
|
||||||
|
errorCode: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesClosePositionResponseV2 {
|
||||||
|
successList: {
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
symbol: string;
|
||||||
|
}[];
|
||||||
|
failureList: {
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
symbol: string;
|
||||||
|
errorMsg: string;
|
||||||
|
errorCode: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesOrderDetailV2 {
|
||||||
|
symbol: string;
|
||||||
|
size: string;
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
baseVolume: string;
|
||||||
|
priceAvg: string;
|
||||||
|
fee: string;
|
||||||
|
price: string;
|
||||||
|
state: string;
|
||||||
|
side: string;
|
||||||
|
force: string;
|
||||||
|
totalProfits: string;
|
||||||
|
posSide: string;
|
||||||
|
marginCoin: string;
|
||||||
|
presetStopSurplusPrice: string;
|
||||||
|
presetStopLossPrice: string;
|
||||||
|
quoteVolume: string;
|
||||||
|
orderType: string;
|
||||||
|
leverage: string;
|
||||||
|
marginMode: string;
|
||||||
|
reduceOnly: string;
|
||||||
|
enterPointSource: string;
|
||||||
|
tradeSide: string;
|
||||||
|
posMode: string;
|
||||||
|
orderSource: string;
|
||||||
|
cancelReason: string;
|
||||||
|
cTime: string;
|
||||||
|
uTime: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesOrderFillsV2 {
|
||||||
|
fillList: {
|
||||||
|
tradeId: string;
|
||||||
|
symbol: string;
|
||||||
|
orderId: string;
|
||||||
|
price: string;
|
||||||
|
baseVolume: string;
|
||||||
|
feeDetail: {
|
||||||
|
deduction: string;
|
||||||
|
feeCoin: string;
|
||||||
|
totalDeductionFee: string;
|
||||||
|
totalFee: string;
|
||||||
|
}[];
|
||||||
|
side: string;
|
||||||
|
quoteVolume: string;
|
||||||
|
profit: string;
|
||||||
|
enterPointSource: string;
|
||||||
|
tradeSide: string;
|
||||||
|
posMode: string;
|
||||||
|
tradeScope: string;
|
||||||
|
cTime: string;
|
||||||
|
}[];
|
||||||
|
endId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesOpenOrdersV2 {
|
||||||
|
entrustedList: {
|
||||||
|
symbol: string;
|
||||||
|
size: string;
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
baseVolume: string;
|
||||||
|
fee: string;
|
||||||
|
price: string;
|
||||||
|
priceAvg: string;
|
||||||
|
status: string;
|
||||||
|
side: string;
|
||||||
|
force: string;
|
||||||
|
totalProfits: string;
|
||||||
|
posSide: string;
|
||||||
|
marginCoin: string;
|
||||||
|
quoteVolume: string;
|
||||||
|
leverage: string;
|
||||||
|
marginMode: string;
|
||||||
|
enterPointSource: string;
|
||||||
|
tradeSide: string;
|
||||||
|
posMode: string;
|
||||||
|
orderType: string;
|
||||||
|
orderSource: string;
|
||||||
|
cTime: string;
|
||||||
|
uTime: string;
|
||||||
|
presetStopSurplusPrice: string;
|
||||||
|
presetStopSurplusType: string;
|
||||||
|
presetStopSurplusExecutePrice: string;
|
||||||
|
presetStopLossPrice: string;
|
||||||
|
presetStopLossType: string;
|
||||||
|
presetStopLossExecutePrice: string;
|
||||||
|
}[];
|
||||||
|
endId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesHistoryOrdersV2 {
|
||||||
|
entrustedList: {
|
||||||
|
symbol: string;
|
||||||
|
size: string;
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
baseVolume: string;
|
||||||
|
fee: string;
|
||||||
|
price: string;
|
||||||
|
priceAvg: string;
|
||||||
|
status: string;
|
||||||
|
side: string;
|
||||||
|
force: string;
|
||||||
|
totalProfits: string;
|
||||||
|
posSide: string;
|
||||||
|
marginCoin: string;
|
||||||
|
quoteVolume: string;
|
||||||
|
leverage: string;
|
||||||
|
marginMode: string;
|
||||||
|
enterPointSource: string;
|
||||||
|
tradeSide: string;
|
||||||
|
posMode: string;
|
||||||
|
orderType: string;
|
||||||
|
orderSource: string;
|
||||||
|
cTime: string;
|
||||||
|
uTime: string;
|
||||||
|
presetStopSurplusPrice: string;
|
||||||
|
presetStopLossPrice: string;
|
||||||
|
}[];
|
||||||
|
endId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesCancelAllOrdersV2 {
|
||||||
|
successList: {
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}[];
|
||||||
|
failureList: {
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
errorMsg: string;
|
||||||
|
errorCode: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* * Futures | Trigger Orders
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface FuturesTriggerSubOrderV2 {
|
||||||
|
orderId: string;
|
||||||
|
price: string;
|
||||||
|
type: string;
|
||||||
|
status: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesPendingPlanOrderV2 {
|
||||||
|
entrustedList: {
|
||||||
|
planType: string;
|
||||||
|
symbol: string;
|
||||||
|
size: string;
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
price: string;
|
||||||
|
executePrice: string;
|
||||||
|
callbackRatio: string;
|
||||||
|
triggerPrice: string;
|
||||||
|
triggerType: string;
|
||||||
|
planStatus: string;
|
||||||
|
side: string;
|
||||||
|
posSide: string;
|
||||||
|
marginCoin: string;
|
||||||
|
marginMode: string;
|
||||||
|
enterPointSource: string;
|
||||||
|
tradeSide: string;
|
||||||
|
posMode: string;
|
||||||
|
orderType: string;
|
||||||
|
orderSource: string;
|
||||||
|
cTime: string;
|
||||||
|
uTime: string;
|
||||||
|
stopSurplusExecutePrice: string;
|
||||||
|
stopSurplusTriggerPrice: string;
|
||||||
|
stopSurplusTriggerType: string;
|
||||||
|
stopLossExecutePrice: string;
|
||||||
|
stopLossTriggerPrice: string;
|
||||||
|
stopLossTriggerType: string;
|
||||||
|
}[];
|
||||||
|
endId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesCancelPlanOrderV2 {
|
||||||
|
successList: {
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}[];
|
||||||
|
failureList: {
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
errorMsg: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FuturesHistoryPlanOrderV2 {
|
||||||
|
entrustedList: {
|
||||||
|
planType: string;
|
||||||
|
symbol: string;
|
||||||
|
size: string;
|
||||||
|
orderId: string;
|
||||||
|
executeOrderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
planStatus: string;
|
||||||
|
price: string;
|
||||||
|
executePrice: string;
|
||||||
|
priceAvg: string;
|
||||||
|
baseVolume: string;
|
||||||
|
callbackRatio: string;
|
||||||
|
triggerPrice: string;
|
||||||
|
triggerType: string;
|
||||||
|
side: string;
|
||||||
|
posSide: string;
|
||||||
|
marginCoin: string;
|
||||||
|
marginMode: string;
|
||||||
|
enterPointSource: string;
|
||||||
|
tradeSide: string;
|
||||||
|
posMode: string;
|
||||||
|
orderType: string;
|
||||||
|
cTime: string;
|
||||||
|
uTime: string;
|
||||||
|
stopSurplusExecutePrice: string;
|
||||||
|
stopSurplusTriggerPrice: string;
|
||||||
|
stopSurplusTriggerType: string;
|
||||||
|
stopLossExecutePrice: string;
|
||||||
|
stopLossTriggerPrice: string;
|
||||||
|
stopLossTriggerType: string;
|
||||||
|
}[];
|
||||||
|
endId: string;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user