Fix getPosition
* Re adds the v1 endpoint as `getPositions` * Fixes params for v2 endpoint `getPosition` Resolves: #5
This commit is contained in:
@@ -52,9 +52,13 @@ If you only use the [public endpoints](#public-endpoints) you can ommit key and
|
|||||||
#### async changeUserLeverage(params)
|
#### async changeUserLeverage(params)
|
||||||
[See bybit documentation](https://github.com/bybit-exchange/bybit-official-api-docs/blob/master/en/rest_api.md#-change-user-leverage)
|
[See bybit documentation](https://github.com/bybit-exchange/bybit-official-api-docs/blob/master/en/rest_api.md#-change-user-leverage)
|
||||||
|
|
||||||
#### async getPosition()
|
#### async getPosition(params)
|
||||||
[See bybit documentation](https://github.com/bybit-exchange/bybit-official-api-docs/blob/master/en/rest_api.md#-my-position-v2)
|
[See bybit documentation](https://github.com/bybit-exchange/bybit-official-api-docs/blob/master/en/rest_api.md#-my-position-v2)
|
||||||
|
|
||||||
|
#### async getPositions()
|
||||||
|
*Deprecated v1 method*
|
||||||
|
[See bybit documentation](https://github.com/bybit-exchange/bybit-official-api-docs/blob/master/en/rest_api.md#positionlistget)
|
||||||
|
|
||||||
#### async changePositionMargin(params)
|
#### async changePositionMargin(params)
|
||||||
[See bybit documentation](https://github.com/bybit-exchange/bybit-official-api-docs/blob/master/en/rest_api.md#-change-position-margin)
|
[See bybit documentation](https://github.com/bybit-exchange/bybit-official-api-docs/blob/master/en/rest_api.md#-change-position-margin)
|
||||||
|
|
||||||
|
|||||||
@@ -109,8 +109,15 @@ module.exports = class RestClient {
|
|||||||
return await this.request.post('/user/leverage/save', params);
|
return await this.request.post('/user/leverage/save', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getPosition() {
|
async getPosition(params) {
|
||||||
return await this.request.get('/v2/private/position/list');
|
assert(params, 'No params passed');
|
||||||
|
assert(params.symbol, 'Parameter symbol is required');
|
||||||
|
|
||||||
|
return await this.request.get('/v2/private/position/list', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
async getPositions() {
|
||||||
|
return await this.request.get('/position/list');
|
||||||
}
|
}
|
||||||
|
|
||||||
async changePositionMargin(params) {
|
async changePositionMargin(params) {
|
||||||
|
|||||||
Reference in New Issue
Block a user