From f430c61e0a762d1a1069bfa51adcaf350b6f1385 Mon Sep 17 00:00:00 2001 From: tiagosiebler Date: Thu, 19 Nov 2020 08:43:59 +0000 Subject: [PATCH] fix set leverage for resetting back to cross (value == 0) --- lib/rest-client.js | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) 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": {