diff --git a/lib/rest-client.js b/lib/rest-client.js index 6290d11..84b3c68 100644 --- a/lib/rest-client.js +++ b/lib/rest-client.js @@ -184,9 +184,12 @@ module.exports = class RestClient { async changeUserLeverage(params) { assert(params, 'No params passed'); - assert(params.leverage, 'Parameter leverage is required'); assert(params.symbol, 'Parameter symbol is required'); + if (typeof params.leverage === 'undefined') { + throw new Error('Parameter leverage is required'); + } + return await this.request.post('user/leverage/save', params); } diff --git a/package.json b/package.json index f6b1834..b9059d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bybit-api", - "version": "1.2.4", + "version": "1.2.5", "description": "A production-ready Node.js connector for the Bybit APIs and WebSockets", "main": "index.js", "scripts": {