Skip to content
This repository was archived by the owner on Dec 4, 2020. It is now read-only.

Commit 336170f

Browse files
Add missing getKline API. Fixes #8. (#9)
Co-authored-by: tiagosiebler <[email protected]>
1 parent 7618336 commit 336170f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

doc/rest-client.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ If you only use the [public endpoints](#public-endpoints) you can ommit key and
101101
#### async getOrderBook(params)
102102
[See bybit documentation](https://bybit-exchange.github.io/docs/inverse/#t-orderbook)
103103

104+
#### async getKline(params)
105+
[See bybit documentation](https://bybit-exchange.github.io/docs/inverse/#t-querykline)
106+
104107
#### async getLatestInformation()
105108
[See bybit documentation](https://bybit-exchange.github.io/docs/inverse/#t-latestsymbolinfo)
106109

lib/rest-client.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,15 @@ module.exports = class RestClient {
197197
return await this.request.get('/v2/public/orderBook/L2', params);
198198
}
199199

200+
async getKline(params) {
201+
assert(params, 'No params passed');
202+
assert(params.symbol, 'Parameter symbol is required');
203+
assert(params.interval, 'Parameter interval is required');
204+
assert(params.from, 'Parameter from is required');
205+
206+
return await this.request.get('/v2/public/kline/list', params);
207+
}
208+
200209
async getLatestInformation() {
201210
return await this.request.get('/v2/public/tickers');
202211
}

0 commit comments

Comments
 (0)