Add missing getKline API. Fixes #8. (#9)

Co-authored-by: tiagosiebler <ts@github.com>
This commit is contained in:
Tiago
2020-04-20 13:10:02 +01:00
committed by GitHub
parent 7618336df9
commit 336170faa5
2 changed files with 12 additions and 0 deletions

View File

@@ -101,6 +101,9 @@ If you only use the [public endpoints](#public-endpoints) you can ommit key and
#### async getOrderBook(params) #### async getOrderBook(params)
[See bybit documentation](https://bybit-exchange.github.io/docs/inverse/#t-orderbook) [See bybit documentation](https://bybit-exchange.github.io/docs/inverse/#t-orderbook)
#### async getKline(params)
[See bybit documentation](https://bybit-exchange.github.io/docs/inverse/#t-querykline)
#### async getLatestInformation() #### async getLatestInformation()
[See bybit documentation](https://bybit-exchange.github.io/docs/inverse/#t-latestsymbolinfo) [See bybit documentation](https://bybit-exchange.github.io/docs/inverse/#t-latestsymbolinfo)

View File

@@ -197,6 +197,15 @@ module.exports = class RestClient {
return await this.request.get('/v2/public/orderBook/L2', params); return await this.request.get('/v2/public/orderBook/L2', params);
} }
async getKline(params) {
assert(params, 'No params passed');
assert(params.symbol, 'Parameter symbol is required');
assert(params.interval, 'Parameter interval is required');
assert(params.from, 'Parameter from is required');
return await this.request.get('/v2/public/kline/list', params);
}
async getLatestInformation() { async getLatestInformation() {
return await this.request.get('/v2/public/tickers'); return await this.request.get('/v2/public/tickers');
} }