Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bybit-api

Package Overview
Dependencies
Maintainers
1
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bybit-api - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

4

lib/inverse-client.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc