feat(#339): add longshort ratio v5 method

This commit is contained in:
tiagosiebler
2024-05-07 13:15:46 +01:00
parent bd10bd9e63
commit d4ebc8227c
3 changed files with 23 additions and 1 deletions

View File

@@ -69,6 +69,7 @@ import {
GetInternalDepositRecordParamsV5, GetInternalDepositRecordParamsV5,
GetInternalTransferParamsV5, GetInternalTransferParamsV5,
GetKlineParamsV5, GetKlineParamsV5,
GetLongShortRatioParamsV5,
GetMarkPriceKlineParamsV5, GetMarkPriceKlineParamsV5,
GetOpenInterestParamsV5, GetOpenInterestParamsV5,
GetOptionDeliveryPriceParamsV5, GetOptionDeliveryPriceParamsV5,
@@ -94,6 +95,7 @@ import {
InternalTransferRecordV5, InternalTransferRecordV5,
LeverageTokenInfoV5, LeverageTokenInfoV5,
LeveragedTokenMarketResultV5, LeveragedTokenMarketResultV5,
LongShortRatioV5,
MMPModifyParamsV5, MMPModifyParamsV5,
MMPStateV5, MMPStateV5,
OHLCKlineV5, OHLCKlineV5,
@@ -390,6 +392,12 @@ export class RestClientV5 extends BaseRestClient {
return this.get('/v5/market/delivery-price', params); return this.get('/v5/market/delivery-price', params);
} }
getLongShortRatio(
params: GetLongShortRatioParamsV5,
): Promise<APIResponseV3WithTime<{ list: LongShortRatioV5[] }>> {
return this.get('/v5/market/account-ratio', params);
}
/** /**
* *
****** Trade APIs ****** Trade APIs

View File

@@ -125,3 +125,10 @@ export interface GetDeliveryPriceParamsV5 {
limit?: number; limit?: number;
cursor?: string; cursor?: string;
} }
export interface GetLongShortRatioParamsV5 {
category: 'linear' | 'inverse';
symbol: string;
period: OpenInterestIntervalV5;
limit?: number;
}

View File

@@ -120,7 +120,7 @@ export interface SpotInstrumentInfoV5 {
riskParameters: { riskParameters: {
limitParameter: string; limitParameter: string;
marketParameter: string; marketParameter: string;
} };
} }
type InstrumentInfoV5Mapping = { type InstrumentInfoV5Mapping = {
@@ -290,3 +290,10 @@ export interface DeliveryPriceV5 {
deliveryPrice: string; deliveryPrice: string;
deliveryTime: string; deliveryTime: string;
} }
export interface LongShortRatioV5 {
symbol: string;
buyRatio: string;
sellRatio: string;
timestamp: string;
}