Merge pull request #37 from tiagosiebler/paramfix
v1.2.4: optional params in wallet balance fetch (fixes #36)
This commit is contained in:
@@ -121,6 +121,7 @@ module.exports = class RestClient {
|
|||||||
|
|
||||||
async cancelConditionalOrder(params) {
|
async cancelConditionalOrder(params) {
|
||||||
assert(params, 'No params passed');
|
assert(params, 'No params passed');
|
||||||
|
assert(params.symbol, 'Parameter symbol is required');
|
||||||
assert(params.stop_order_id || params.order_link_id, 'Parameter stop_order_id OR order_link_id is required');
|
assert(params.stop_order_id || params.order_link_id, 'Parameter stop_order_id OR order_link_id is required');
|
||||||
|
|
||||||
return await this.request.post('v2/private/stop-order/cancel', params);
|
return await this.request.post('v2/private/stop-order/cancel', params);
|
||||||
@@ -198,8 +199,8 @@ module.exports = class RestClient {
|
|||||||
|
|
||||||
async changePositionMargin(params) {
|
async changePositionMargin(params) {
|
||||||
assert(params, 'No params passed');
|
assert(params, 'No params passed');
|
||||||
assert(params.margin, 'Parameter margin is required');
|
|
||||||
assert(params.symbol, 'Parameter symbol is required');
|
assert(params.symbol, 'Parameter symbol is required');
|
||||||
|
assert(params.margin, 'Parameter margin is required');
|
||||||
|
|
||||||
return await this.request.post('position/change-position-margin', params);
|
return await this.request.post('position/change-position-margin', params);
|
||||||
}
|
}
|
||||||
@@ -224,8 +225,6 @@ module.exports = class RestClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getWalletBalance(params) {
|
async getWalletBalance(params) {
|
||||||
assert(params, 'No params passed');
|
|
||||||
assert(params.coin, 'Parameter coin is required');
|
|
||||||
return await this.request.get('v2/private/wallet/balance', params);
|
return await this.request.get('v2/private/wallet/balance', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bybit-api",
|
"name": "bybit-api",
|
||||||
"version": "1.2.3",
|
"version": "1.2.4",
|
||||||
"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