From e519c368e54ee2d35b04b82eb92ab0016b96522d Mon Sep 17 00:00:00 2001 From: Stefan Aebischer Date: Wed, 12 Feb 2020 10:45:53 -0500 Subject: [PATCH] Add new endpoint `getWalletBalance` See: https://github.com/bybit-exchange/bybit-official-api-docs/blob/master/en/CHANGELOG.md#2020-02-10 --- doc/rest-client.md | 3 +++ lib/rest-client.js | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/doc/rest-client.md b/doc/rest-client.md index 716f1c5..d8406ed 100644 --- a/doc/rest-client.md +++ b/doc/rest-client.md @@ -71,6 +71,9 @@ If you only use the [public endpoints](#public-endpoints) you can ommit key and #### async getWithdrawRecords(params) [See bybit documentation](https://github.com/bybit-exchange/bybit-official-api-docs/blob/master/en/rest_api.md#-get-withdraw-records) +#### async getWalletBalance(params) +[See bybit documentation](https://github.com/bybit-exchange/bybit-official-api-docs/blob/master/en/rest_api.md#open-apiwalletbalanceget) + #### async setRiskLimit(params) [See bybit documentation](https://github.com/bybit-exchange/bybit-official-api-docs/blob/master/en/rest_api.md#set-risk-limit-) diff --git a/lib/rest-client.js b/lib/rest-client.js index dbf15d8..3a676f7 100644 --- a/lib/rest-client.js +++ b/lib/rest-client.js @@ -144,6 +144,12 @@ module.exports = class RestClient { return await this.request.get('/open-api/wallet/withdraw/list', params); } + async getWalletBalance(params) { + assert(params, 'No params passed'); + assert(params.coin, 'Parameter coin is required'); + return await this.request.get('/v2/private/wallet/balance', params); + } + async setRiskLimit(params) { assert(params, 'No params passed'); assert(params.symbol, 'Parameter symbol is required');