From e345943327676011f3f0aa74b113ce5a149fc5bf Mon Sep 17 00:00:00 2001 From: CryptoCompiler <72892531+peepopoggers@users.noreply.github.com> Date: Fri, 22 Jan 2021 10:15:36 +0000 Subject: [PATCH] Added Market Data Endpoints For Linear --- src/linear-client.ts | 69 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git a/src/linear-client.ts b/src/linear-client.ts index 0419700..77bb017 100644 --- a/src/linear-client.ts +++ b/src/linear-client.ts @@ -33,15 +33,76 @@ export class LinearClient extends SharedEndpoints { ); return this; } - + //------------Market Data Endpoints------------> + + getKline(params: { + symbol: string; + interval: string; + from: number; + limit?: number; + }): GenericAPIResponse { + return this.requestWrapper.get('/public/linear/kline', params); + } + /** - * @public Get the last funding rate. - */ + * @deprecated use getTrades() instead + */ + getPublicTradingRecords(params: { + symbol: string; + from?: number; + limit?: number; + }): GenericAPIResponse { + return this.getTrades(params); + } + getTrades(params: { + symbol: string; + from?: number; + limit?: number; + }): GenericAPIResponse { + return this.requestWrapper.get('/public/linear/recent-trading-records', params); + } + getLastFundingRate(params: { symbol: string; }): GenericAPIResponse { return this.requestWrapper.get('public/linear/funding/prev-funding-rate', params); } - + + getMarkPriceKline(params: { + symbol: string; + interval: string; + from: number; + limit?: number; + }): GenericAPIResponse { + return this.requestWrapper.get('/public/linear/mark-price-kline', params); + } + + getIndexPriceKline(params: { + symbol: string; + interval: string; + from: number; + limit?: number; + }): GenericAPIResponse { + return this.requestWrapper.get('/public/linear/index-price-kline', params); + } + + getPremiumIndexKline(params: { + symbol: string; + interval: string; + from: number; + limit?: number; + }): GenericAPIResponse { + return this.requestWrapper.get('/public/linear/premium-index-kline', params); + } + + + //-----------Account Data Endpoints------------> + + //------------Wallet Data Endpoints------------> + + //-------------API Data Endpoints--------------> + + + }