bybit-api
Advanced tools
Comparing version 3.5.2 to 3.5.3
@@ -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
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
531604