diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..ad48ebc --- /dev/null +++ b/.jshintrc @@ -0,0 +1,6 @@ +{ + "esversion": 8, + "asi": true, + "laxbreak": true, + "predef": [ "-Promise" ] +} diff --git a/doc/rest-client.md b/doc/rest-client.md index b3537a1..7d4a074 100644 --- a/doc/rest-client.md +++ b/doc/rest-client.md @@ -74,6 +74,9 @@ If you only use the [public endpoints](#public-endpoints) you can omit key and s #### async getWithdrawRecords(params) [See bybit documentation](https://bybit-exchange.github.io/docs/inverse/#t-withdrawrecords) +#### async getAssetExchangeRecords(params) +[See bybit documentation](https://bybit-exchange.github.io/docs/inverse/#t-assetexchangerecords) + #### async getWalletBalance(params) [See bybit documentation](https://bybit-exchange.github.io/docs/inverse/#t-balance) @@ -103,6 +106,15 @@ If you only use the [public endpoints](#public-endpoints) you can omit key and s #### async getKline(params) [See bybit documentation](https://bybit-exchange.github.io/docs/inverse/#t-querykline) +#### async getOpenInterest(params) +[See bybit documentation](https://bybit-exchange.github.io/docs/inverse/#t-marketopeninterest) + +#### async getLatestBigDeal(params) +[See bybit documentation](https://bybit-exchange.github.io/docs/inverse/#t-marketbigdeal) + +#### async getLongShortRatio(params) +[See bybit documentation](https://bybit-exchange.github.io/docs/inverse/#t-marketaccountratio) + #### async getLatestInformation() [See bybit documentation](https://bybit-exchange.github.io/docs/inverse/#t-latestsymbolinfo) diff --git a/lib/rest-client.js b/lib/rest-client.js index 84f81db..479681d 100644 --- a/lib/rest-client.js +++ b/lib/rest-client.js @@ -152,6 +152,10 @@ module.exports = class RestClient { return await this.request.get('open-api/wallet/withdraw/list', params); } + async getAssetExchangeRecords(params) { + return await this.request.get('v2/private/exchange-order/list', params); + } + async getWalletBalance(params) { assert(params, 'No params passed'); assert(params.coin, 'Parameter coin is required'); @@ -214,6 +218,29 @@ module.exports = class RestClient { return await this.request.get('v2/public/kline/list', params); } + async getOpenInterest(params) { + assert(params, 'No params passed'); + assert(params.symbol, 'Parameter symbol is required'); + assert(params.period, 'Parameter period is required'); + + return await this.request.get('v2/public/open-interest', params); + } + + async getLatestBigDeal(params) { + assert(params, 'No params passed'); + assert(params.symbol, 'Parameter symbol is required'); + + return await this.request.get('v2/public/big-deal', params); + } + + async getLongShortRatio(params) { + assert(params, 'No params passed'); + assert(params.symbol, 'Parameter symbol is required'); + assert(params.period, 'Parameter period is required'); + + return await this.request.get('v2/public/account-ratio', params); + } + async getLatestInformation() { return await this.request.get('v2/public/tickers'); }