fix set leverage for resetting back to cross (value == 0)

This commit is contained in:
tiagosiebler
2020-11-19 08:43:59 +00:00
parent ff19bb3878
commit f430c61e0a
2 changed files with 5 additions and 2 deletions

View File

@@ -184,9 +184,12 @@ module.exports = class RestClient {
async changeUserLeverage(params) { async changeUserLeverage(params) {
assert(params, 'No params passed'); assert(params, 'No params passed');
assert(params.leverage, 'Parameter leverage is required');
assert(params.symbol, 'Parameter symbol 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); return await this.request.post('user/leverage/save', params);
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "bybit-api", "name": "bybit-api",
"version": "1.2.4", "version": "1.2.5",
"description": "A production-ready Node.js connector for the Bybit APIs and WebSockets", "description": "A production-ready Node.js connector for the Bybit APIs and WebSockets",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {