bybit-api
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -13,6 +13,6 @@ import { AxiosRequestConfig } from 'axios'; | ||
* @param {boolean} [useLivenet=false] | ||
* @param {RestClientOptions} [restInverseOptions={}] options to configure REST API connectivity | ||
* @param {RestClientOptions} [restClientOptions={}] options to configure REST API connectivity | ||
* @param {AxiosRequestConfig} [requestOptions={}] HTTP networking options for axios | ||
*/ | ||
constructor(key?: string | undefined, secret?: string | undefined, useLivenet?: boolean, restInverseOptions?: RestClientOptions, requestOptions?: AxiosRequestConfig); | ||
constructor(key?: string | undefined, secret?: string | undefined, useLivenet?: boolean, restClientOptions?: RestClientOptions, requestOptions?: AxiosRequestConfig); | ||
/** | ||
@@ -19,0 +19,0 @@ * |
@@ -17,8 +17,8 @@ "use strict"; | ||
* @param {boolean} [useLivenet=false] | ||
* @param {RestClientOptions} [restInverseOptions={}] options to configure REST API connectivity | ||
* @param {RestClientOptions} [restClientOptions={}] options to configure REST API connectivity | ||
* @param {AxiosRequestConfig} [requestOptions={}] HTTP networking options for axios | ||
*/ | ||
constructor(key, secret, useLivenet, restInverseOptions = {}, requestOptions = {}) { | ||
constructor(key, secret, useLivenet, restClientOptions = {}, requestOptions = {}) { | ||
super(); | ||
this.requestWrapper = new requestWrapper_1.default(key, secret, requestUtils_1.getRestBaseUrl(useLivenet, restInverseOptions), restInverseOptions, requestOptions); | ||
this.requestWrapper = new requestWrapper_1.default(key, secret, requestUtils_1.getRestBaseUrl(useLivenet, restClientOptions), restClientOptions, requestOptions); | ||
return this; | ||
@@ -25,0 +25,0 @@ } |
@@ -13,6 +13,6 @@ import { AxiosRequestConfig } from 'axios'; | ||
* @param {boolean} [useLivenet=false] | ||
* @param {RestClientOptions} [restInverseOptions={}] options to configure REST API connectivity | ||
* @param {RestClientOptions} [restClientOptions={}] options to configure REST API connectivity | ||
* @param {AxiosRequestConfig} [requestOptions={}] HTTP networking options for axios | ||
*/ | ||
constructor(key?: string | undefined, secret?: string | undefined, useLivenet?: boolean, restInverseOptions?: RestClientOptions, requestOptions?: AxiosRequestConfig); | ||
constructor(key?: string | undefined, secret?: string | undefined, useLivenet?: boolean, restClientOptions?: RestClientOptions, requestOptions?: AxiosRequestConfig); | ||
/** | ||
@@ -19,0 +19,0 @@ * |
@@ -17,8 +17,8 @@ "use strict"; | ||
* @param {boolean} [useLivenet=false] | ||
* @param {RestClientOptions} [restInverseOptions={}] options to configure REST API connectivity | ||
* @param {RestClientOptions} [restClientOptions={}] options to configure REST API connectivity | ||
* @param {AxiosRequestConfig} [requestOptions={}] HTTP networking options for axios | ||
*/ | ||
constructor(key, secret, useLivenet, restInverseOptions = {}, requestOptions = {}) { | ||
constructor(key, secret, useLivenet, restClientOptions = {}, requestOptions = {}) { | ||
super(); | ||
this.requestWrapper = new requestWrapper_1.default(key, secret, requestUtils_1.getRestBaseUrl(useLivenet, restInverseOptions), restInverseOptions, requestOptions); | ||
this.requestWrapper = new requestWrapper_1.default(key, secret, requestUtils_1.getRestBaseUrl(useLivenet, restClientOptions), restClientOptions, requestOptions); | ||
return this; | ||
@@ -25,0 +25,0 @@ } |
{ | ||
"name": "bybit-api", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Node.js connector for Bybit's Inverse & Linear REST APIs and WebSockets", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -48,3 +48,3 @@ # bybit-api | ||
const restInverseOptions = { | ||
const restClientOptions = { | ||
// override the max size of the request window (in ms) | ||
@@ -81,13 +81,21 @@ recv_window?: number; | ||
// restInverseOptions, | ||
// restClientOptions, | ||
// requestLibraryOptions | ||
); | ||
client.changeUserLeverage({leverage: 4, symbol: 'ETHUSD'}) | ||
client.getApiKeyInfo() | ||
.then(result => { | ||
console.log(result); | ||
console.log("apiKey result: ", result); | ||
}) | ||
.catch(err => { | ||
console.error(err); | ||
console.error("apiKey error: ", err); | ||
}); | ||
client.getOrderBook({ symbol: 'BTCUSD' }) | ||
.then(result => { | ||
console.log("getOrderBook inverse result: ", result); | ||
}) | ||
.catch(err => { | ||
console.error("getOrderBook inverse error: ", err); | ||
}); | ||
``` | ||
@@ -103,3 +111,3 @@ | ||
const restInverseOptions = { | ||
const restClientOptions = { | ||
// override the max size of the request window (in ms) | ||
@@ -136,7 +144,7 @@ recv_window?: number; | ||
// restInverseOptions, | ||
// restClientOptions, | ||
// requestLibraryOptions | ||
); | ||
client.changeUserLeverage({leverage: 4, symbol: 'ETHUSDT'}) | ||
client.getApiKeyInfo() | ||
.then(result => { | ||
@@ -148,2 +156,10 @@ console.log(result); | ||
}); | ||
client.getOrderBook({ symbol: 'BTCUSDT' }) | ||
.then(result => { | ||
console.log("getOrderBook linear result: ", result); | ||
}) | ||
.catch(err => { | ||
console.error("getOrderBook linear error: ", err); | ||
}); | ||
``` | ||
@@ -150,0 +166,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108442
279