Merge pull request #38 from tiagosiebler/leverageSetParam
fix set leverage for resetting back to cross (value == 0)
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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": {
|
||||||
|
|||||||
Reference in New Issue
Block a user