Merge pull request #442 from tiagosiebler/fastexec

feat(v4.1.7): fast execution topics should use authenticated stream
This commit is contained in:
Tiago
2025-05-07 09:04:04 +01:00
committed by GitHub
4 changed files with 14 additions and 6 deletions

View File

@@ -10,8 +10,8 @@ const logger = {
// trace: (...params) => console.log('trace', ...params),
};
const key = process.env.API_KEY;
const secret = process.env.API_SECRET;
const key = process.env.API_KEY_COM;
const secret = process.env.API_SECRET_COM;
/**
* Prepare an instance of the WebSocket client. This client handles all aspects of connectivity for you:
@@ -62,9 +62,12 @@ wsClient.on('reconnected', (data) => {
*/
wsClient.subscribeV5('position', 'linear');
wsClient.subscribeV5('execution', 'linear');
wsClient.subscribeV5(['order', 'wallet', 'greeks'], 'linear');
wsClient.subscribeV5('execution', 'linear');
// wsClient.subscribeV5('execution.fast', 'linear');
// wsClient.subscribeV5('execution.fast.linear', 'linear');
/**
* The following has the same effect as above, since there's only one private endpoint for V5 account topics:
*/

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "bybit-api",
"version": "4.1.6",
"version": "4.1.7",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "bybit-api",
"version": "4.1.6",
"version": "4.1.7",
"license": "MIT",
"dependencies": {
"axios": "^1.7.9",

View File

@@ -1,6 +1,6 @@
{
"name": "bybit-api",
"version": "4.1.6",
"version": "4.1.7",
"description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.",
"main": "lib/index.js",
"types": "lib/index.d.ts",

View File

@@ -78,6 +78,11 @@ const PRIVATE_TOPICS = [
'order',
'wallet',
'greeks',
// v5 fast execution topics are private
'execution.fast',
'execution.fast.linear',
'execution.fast.inverse',
'execution.fast.spot',
];
/**