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 3.5.2 to 3.5.3

30

lib/util/BaseRestClient.js

@@ -19,9 +19,13 @@ "use strict";

const node_support_1 = require("./node-support");
// axios.interceptors.request.use((request) => {
// console.log(new Date(), 'Starting Request', JSON.stringify(request, null, 2));
// return request;
// });
if (typeof process === 'object' &&
typeof process.env === 'object' &&
process.env.BYBITTRACE) {
// axios.interceptors.request.use((request) => {
// console.log(
// new Date(),
// 'Starting Request',
// JSON.stringify(request, null, 2)
// );
// return request;
// });
axios_1.default.interceptors.response.use((response) => {

@@ -129,15 +133,8 @@ console.log(new Date(), 'Response:', {

if (this.clientType === requestUtils_1.REST_CLIENT_TYPE_ENUM.v3) {
if (!options.headers) {
options.headers = {};
}
const signResult = yield this.prepareSignParams(method, 'v5auth', params, isPublicApi);
options.headers['X-BAPI-SIGN-TYPE'] = 2;
options.headers['X-BAPI-API-KEY'] = this.key;
options.headers['X-BAPI-TIMESTAMP'] = signResult.timestamp;
options.headers['X-BAPI-SIGN'] = signResult.sign;
options.headers['X-BAPI-RECV-WINDOW'] = signResult.recvWindow;
const headers = Object.assign({ 'X-BAPI-SIGN-TYPE': 2, 'X-BAPI-API-KEY': this.key, 'X-BAPI-TIMESTAMP': signResult.timestamp, 'X-BAPI-SIGN': signResult.sign, 'X-BAPI-RECV-WINDOW': signResult.recvWindow }, options.headers);
if (method === 'GET') {
return Object.assign(Object.assign({}, options), { params: signResult.originalParams });
return Object.assign(Object.assign({}, options), { headers, params: signResult.originalParams });
}
return Object.assign(Object.assign({}, options), { data: signResult.originalParams });
return Object.assign(Object.assign({}, options), { headers, data: signResult.originalParams });
}

@@ -228,3 +225,6 @@ const signResult = yield this.prepareSignParams(method, 'v2auth', params, isPublicApi);

res.serializedParams = signRequestParams;
// console.log('sign req: ', paramsStr);
// console.log('sign req: ', {
// req: paramsStr,
// sign: res.sign,
// });
return res;

@@ -231,0 +231,0 @@ }

{
"name": "bybit-api",
"version": "3.5.2",
"version": "3.5.3",
"description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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