From 4ba36374ccc534a1a7d41f26c9aa86470ad3ec28 Mon Sep 17 00:00:00 2001 From: tiagosiebler Date: Thu, 5 May 2022 23:42:14 +0100 Subject: [PATCH] remove requestWrapper from remaining public getter methods --- src/linear-client.ts | 36 +++++++++++++++--------------------- src/spot-client.ts | 3 --- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/src/linear-client.ts b/src/linear-client.ts index 9f731c8..d01636f 100644 --- a/src/linear-client.ts +++ b/src/linear-client.ts @@ -71,13 +71,13 @@ export class LinearClient extends BaseRestClient { */ getOrderBook(params: SymbolParam): Promise> { - return this.requestWrapper.get('v2/public/orderBook/L2', params); + return this.get('v2/public/orderBook/L2', params); } getKline( params: SymbolIntervalFromLimitParam ): Promise> { - 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( params?: Partial ): Promise> { - return this.requestWrapper.get('v2/public/tickers', params); + return this.get('v2/public/tickers', params); } getTrades(params: SymbolLimitParam): Promise> { - return this.requestWrapper.get( - 'public/linear/recent-trading-records', - params - ); + return this.get('public/linear/recent-trading-records', params); } getSymbols(): Promise> { - return this.requestWrapper.get('v2/public/symbols'); + return this.get('v2/public/symbols'); } getLastFundingRate(params: SymbolParam): Promise> { - return this.requestWrapper.get( - 'public/linear/funding/prev-funding-rate', - params - ); + return this.get('public/linear/funding/prev-funding-rate', params); } getMarkPriceKline( params: SymbolIntervalFromLimitParam ): Promise> { - return this.requestWrapper.get('public/linear/mark-price-kline', params); + return this.get('public/linear/mark-price-kline', params); } getIndexPriceKline( params: SymbolIntervalFromLimitParam ): Promise> { - return this.requestWrapper.get('public/linear/index-price-kline', params); + return this.get('public/linear/index-price-kline', params); } getPremiumIndexKline( params: SymbolIntervalFromLimitParam ): Promise> { - 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( params: SymbolPeriodLimitParam ): Promise> { - return this.requestWrapper.get('v2/public/open-interest', params); + return this.get('v2/public/open-interest', params); } getLatestBigDeal( params: SymbolLimitParam ): Promise> { - return this.requestWrapper.get('v2/public/big-deal', params); + return this.get('v2/public/big-deal', params); } getLongShortRatio( params: SymbolPeriodLimitParam ): Promise> { - 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> { - return this.requestWrapper.get('v2/public/time'); + return this.get('v2/public/time'); } 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 { - return this.requestWrapper.get('public/linear/risk-limit', params); + return this.get('public/linear/risk-limit', params); } setRiskLimit(params: { diff --git a/src/spot-client.ts b/src/spot-client.ts index f657021..52decb8 100644 --- a/src/spot-client.ts +++ b/src/spot-client.ts @@ -9,11 +9,8 @@ import { } from './types/spot'; import BaseRestClient from './util/BaseRestClient'; import { getRestBaseUrl, RestClientOptions } from './util/requestUtils'; -import RequestWrapper from './util/requestWrapper'; export class SpotClient extends BaseRestClient { - protected requestWrapper: RequestWrapper; - /** * @public Creates an instance of the Spot REST API client. *