v3.3.1: fix(#199) wrong endpoint for contract.getOpenInterestLimitInfo

This commit is contained in:
tiagosiebler
2022-11-16 12:03:36 +00:00
parent 4046608203
commit c3f7ecb30e
3 changed files with 5 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "bybit-api", "name": "bybit-api",
"version": "3.3.0", "version": "3.3.1",
"description": "Complete & robust node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & integration tests.", "description": "Complete & robust node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & integration tests.",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",

View File

@@ -293,7 +293,7 @@ export class ContractClient extends BaseRestClient {
/** Get the information of open interest limit. */ /** Get the information of open interest limit. */
getOpenInterestLimitInfo(symbol: string): Promise<APIResponseV3<any>> { getOpenInterestLimitInfo(symbol: string): Promise<APIResponseV3<any>> {
return this.getPrivate('/contract/v3/private/position/closed-pnl', { return this.getPrivate('/contract/v3/private/position/limit-info', {
symbol, symbol,
}); });
} }

View File

@@ -216,9 +216,11 @@ export default abstract class BaseRestClient {
options.headers['X-BAPI-RECV-WINDOW'] = signResult.recvWindow; options.headers['X-BAPI-RECV-WINDOW'] = signResult.recvWindow;
if (method === 'GET') { if (method === 'GET') {
// const serialisedParams = signResult.serializedParams;
return { return {
...options, ...options,
params: signResult.originalParams, params: signResult.originalParams,
// url: url + (serialisedParams ? '?' + serialisedParams : ''),
}; };
} }
@@ -359,6 +361,7 @@ export default abstract class BaseRestClient {
const paramsStr = timestamp + key + recvWindow + signRequestParams; const paramsStr = timestamp + key + recvWindow + signRequestParams;
res.sign = await signMessage(paramsStr, this.secret); res.sign = await signMessage(paramsStr, this.secret);
res.serializedParams = signRequestParams;
// console.log('sign req: ', paramsStr); // console.log('sign req: ', paramsStr);
return res; return res;