ws private clean

This commit is contained in:
tiagosiebler
2022-09-17 11:50:39 +01:00
parent f827318123
commit 296262f4fb

View File

@@ -1,13 +1,12 @@
import { DefaultLogger } from '../src'; import { WebsocketClient, WS_KEY_MAP, DefaultLogger } from '../src';
import { WebsocketClient } from '../src/websocket-client';
// or // or
// import { DefaultLogger, WebsocketClient } from 'bybit-api'; // import { DefaultLogger, WS_KEY_MAP, WebsocketClient } from 'bybit-api';
(async () => { (async () => {
const logger = { const logger = {
...DefaultLogger, ...DefaultLogger,
// silly: () => {}, silly: () => {},
}; };
const key = process.env.API_KEY; const key = process.env.API_KEY;
@@ -25,7 +24,7 @@ import { WebsocketClient } from '../src/websocket-client';
key: key, key: key,
secret: secret, secret: secret,
market: market, market: market,
livenet: true, // testnet: true,
restOptions: { restOptions: {
// enable_time_sync: true, // enable_time_sync: true,
}, },
@@ -33,8 +32,6 @@ import { WebsocketClient } from '../src/websocket-client';
logger logger
); );
// wsClient.subscribePublicSpotOrderbook('test', 'full');
wsClient.on('update', (data) => { wsClient.on('update', (data) => {
console.log('raw message received ', JSON.stringify(data, null, 2)); console.log('raw message received ', JSON.stringify(data, null, 2));
}); });