fix(v3.10.31, #411): demo trading wss should only be used for private topics. Fixes #411.

This commit is contained in:
tiagosiebler
2025-02-01 15:31:25 +00:00
parent 1fa53ba50a
commit bbf3a7224c
4 changed files with 9 additions and 8 deletions

View File

@@ -406,12 +406,7 @@ export function getWsUrl(
return wsUrl;
}
// https://bybit-exchange.github.io/docs/v5/demo
const isDemoTrading = wsClientOptions.demoTrading;
if (isDemoTrading) {
return 'wss://stream-demo.bybit.com/v5/private';
}
const isTestnet = wsClientOptions.testnet;
const networkKey = isTestnet ? 'testnet' : 'livenet';
@@ -475,6 +470,11 @@ export function getWsUrl(
return WS_BASE_URL_MAP.contractUSDT.public[networkKey];
}
case WS_KEY_MAP.v5Private: {
// https://bybit-exchange.github.io/docs/v5/demo
if (isDemoTrading) {
return 'wss://stream-demo.bybit.com/v5/private';
}
return WS_BASE_URL_MAP.v5.private[networkKey];
}
case WS_KEY_MAP.v5SpotPublic: {