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) {
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);
}