remove requestWrapper from remaining public getter methods

This commit is contained in:
tiagosiebler
2022-05-05 23:42:14 +01:00
parent f4e41331db
commit 4ba36374cc
2 changed files with 15 additions and 24 deletions

View File

@@ -71,13 +71,13 @@ export class LinearClient extends BaseRestClient {
*/ */
getOrderBook(params: SymbolParam): Promise<APIResponseWithTime<any[]>> { getOrderBook(params: SymbolParam): Promise<APIResponseWithTime<any[]>> {
return this.requestWrapper.get('v2/public/orderBook/L2', params); return this.get('v2/public/orderBook/L2', params);
} }
getKline( getKline(
params: SymbolIntervalFromLimitParam params: SymbolIntervalFromLimitParam
): Promise<APIResponseWithTime<any[]>> { ): Promise<APIResponseWithTime<any[]>> {
return this.requestWrapper.get('public/linear/kline', params); return this.get('public/linear/kline', params);
} }
/** /**
@@ -86,43 +86,37 @@ export class LinearClient extends BaseRestClient {
getTickers( getTickers(
params?: Partial<SymbolParam> params?: Partial<SymbolParam>
): Promise<APIResponseWithTime<any[]>> { ): Promise<APIResponseWithTime<any[]>> {
return this.requestWrapper.get('v2/public/tickers', params); return this.get('v2/public/tickers', params);
} }
getTrades(params: SymbolLimitParam): Promise<APIResponseWithTime<any[]>> { getTrades(params: SymbolLimitParam): Promise<APIResponseWithTime<any[]>> {
return this.requestWrapper.get( return this.get('public/linear/recent-trading-records', params);
'public/linear/recent-trading-records',
params
);
} }
getSymbols(): Promise<APIResponse<SymbolInfo[]>> { getSymbols(): Promise<APIResponse<SymbolInfo[]>> {
return this.requestWrapper.get('v2/public/symbols'); return this.get('v2/public/symbols');
} }
getLastFundingRate(params: SymbolParam): Promise<APIResponseWithTime<any[]>> { getLastFundingRate(params: SymbolParam): Promise<APIResponseWithTime<any[]>> {
return this.requestWrapper.get( return this.get('public/linear/funding/prev-funding-rate', params);
'public/linear/funding/prev-funding-rate',
params
);
} }
getMarkPriceKline( getMarkPriceKline(
params: SymbolIntervalFromLimitParam params: SymbolIntervalFromLimitParam
): Promise<APIResponseWithTime<any[]>> { ): Promise<APIResponseWithTime<any[]>> {
return this.requestWrapper.get('public/linear/mark-price-kline', params); return this.get('public/linear/mark-price-kline', params);
} }
getIndexPriceKline( getIndexPriceKline(
params: SymbolIntervalFromLimitParam params: SymbolIntervalFromLimitParam
): Promise<APIResponseWithTime<any[]>> { ): Promise<APIResponseWithTime<any[]>> {
return this.requestWrapper.get('public/linear/index-price-kline', params); return this.get('public/linear/index-price-kline', params);
} }
getPremiumIndexKline( getPremiumIndexKline(
params: SymbolIntervalFromLimitParam params: SymbolIntervalFromLimitParam
): Promise<APIResponseWithTime<any[]>> { ): Promise<APIResponseWithTime<any[]>> {
return this.requestWrapper.get('public/linear/premium-index-kline', params); return this.get('public/linear/premium-index-kline', params);
} }
/** /**
@@ -134,19 +128,19 @@ export class LinearClient extends BaseRestClient {
getOpenInterest( getOpenInterest(
params: SymbolPeriodLimitParam params: SymbolPeriodLimitParam
): Promise<APIResponseWithTime<any[]>> { ): Promise<APIResponseWithTime<any[]>> {
return this.requestWrapper.get('v2/public/open-interest', params); return this.get('v2/public/open-interest', params);
} }
getLatestBigDeal( getLatestBigDeal(
params: SymbolLimitParam params: SymbolLimitParam
): Promise<APIResponseWithTime<any[]>> { ): Promise<APIResponseWithTime<any[]>> {
return this.requestWrapper.get('v2/public/big-deal', params); return this.get('v2/public/big-deal', params);
} }
getLongShortRatio( getLongShortRatio(
params: SymbolPeriodLimitParam params: SymbolPeriodLimitParam
): Promise<APIResponseWithTime<any[]>> { ): Promise<APIResponseWithTime<any[]>> {
return this.requestWrapper.get('v2/public/account-ratio', params); return this.get('v2/public/account-ratio', params);
} }
/** /**
@@ -190,11 +184,11 @@ export class LinearClient extends BaseRestClient {
*/ */
getServerTime(): Promise<APIResponseWithTime<{}>> { getServerTime(): Promise<APIResponseWithTime<{}>> {
return this.requestWrapper.get('v2/public/time'); return this.get('v2/public/time');
} }
getApiAnnouncements(): GenericAPIResponse { getApiAnnouncements(): GenericAPIResponse {
return this.requestWrapper.get('v2/public/announcement'); return this.get('v2/public/announcement');
} }
/** /**
@@ -481,7 +475,7 @@ export class LinearClient extends BaseRestClient {
*/ */
getRiskLimitList(params: SymbolParam): GenericAPIResponse { getRiskLimitList(params: SymbolParam): GenericAPIResponse {
return this.requestWrapper.get('public/linear/risk-limit', params); return this.get('public/linear/risk-limit', params);
} }
setRiskLimit(params: { setRiskLimit(params: {

View File

@@ -9,11 +9,8 @@ import {
} from './types/spot'; } from './types/spot';
import BaseRestClient from './util/BaseRestClient'; import BaseRestClient from './util/BaseRestClient';
import { getRestBaseUrl, RestClientOptions } from './util/requestUtils'; import { getRestBaseUrl, RestClientOptions } from './util/requestUtils';
import RequestWrapper from './util/requestWrapper';
export class SpotClient extends BaseRestClient { export class SpotClient extends BaseRestClient {
protected requestWrapper: RequestWrapper;
/** /**
* @public Creates an instance of the Spot REST API client. * @public Creates an instance of the Spot REST API client.
* *