growwapi
Version:
NodeJS SDK for Groww trading APIs
20 lines (19 loc) • 615 B
JavaScript
import { HttpClient } from '../utils/http';
import { buildUrlWithParams } from '../utils/url';
export class LiveData {
constructor(baseUrl) {
this.http = new HttpClient(baseUrl, '/live-data');
}
async getQuote(params) {
const url = buildUrlWithParams('/quote', params);
return (await this.http.get(url));
}
async getLTP(params) {
const url = buildUrlWithParams('/ltp', params);
return (await this.http.get(url));
}
async getOHLC(params) {
const url = buildUrlWithParams('/ohlc', params);
return (await this.http.get(url));
}
}