Merge pull request #412 from tiagosiebler/demowspublic
fix(v3.10.31, #411): demo trading wss should only be used for private topics.
This commit is contained in:
@@ -20,6 +20,7 @@ const logger = {
|
||||
const wsClient = new WebsocketClient(
|
||||
{
|
||||
market: 'v5',
|
||||
// demoTrading: true,
|
||||
},
|
||||
logger,
|
||||
);
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "bybit-api",
|
||||
"version": "3.10.30",
|
||||
"version": "3.10.31",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "bybit-api",
|
||||
"version": "3.10.30",
|
||||
"version": "3.10.31",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"axios": "^1.6.6",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bybit-api",
|
||||
"version": "3.10.30",
|
||||
"version": "3.10.31",
|
||||
"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",
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user