v3.9.4: feat() update test & publish actions, update public ws example, disable test for deprecated endpoint
This commit is contained in:
@@ -19,16 +19,13 @@ const logger = {
|
||||
*/
|
||||
const wsClient = new WebsocketClient(
|
||||
{
|
||||
// key: key,
|
||||
// secret: secret,
|
||||
market: 'v5',
|
||||
},
|
||||
logger
|
||||
logger,
|
||||
);
|
||||
|
||||
wsClient.on('update', (data) => {
|
||||
console.log('raw message received ', JSON.stringify(data));
|
||||
// console.log('raw message received ', JSON.stringify(data, null, 2));
|
||||
});
|
||||
|
||||
wsClient.on('open', (data) => {
|
||||
@@ -78,17 +75,19 @@ wsClient.on('reconnected', (data) => {
|
||||
* (compared to one public one per category)
|
||||
*/
|
||||
|
||||
wsClient.subscribeV5('position', 'linear');
|
||||
wsClient.subscribeV5('execution', 'linear');
|
||||
wsClient.subscribeV5(['order', 'wallet', 'greek'], 'linear');
|
||||
// wsClient.subscribeV5('position', 'linear');
|
||||
// wsClient.subscribeV5('execution', 'linear');
|
||||
// wsClient.subscribeV5(['order', 'wallet', 'greek'], 'linear');
|
||||
|
||||
// Other example topics
|
||||
const topics = ['kline.5.XRPUSDT', 'kline.5.BTCUSDT', 'kline.5.ETHUSDT'];
|
||||
|
||||
wsClient.subscribeV5(topics, 'spot');
|
||||
|
||||
// To unsubscribe from topics (after a 5 second delay, in this example):
|
||||
// setTimeout(() => {
|
||||
// console.log('unsubscribing');
|
||||
// wsClient.unsubscribeV5('orderbook.50.BTCUSDT', 'linear);
|
||||
// }, 5 * 1000);
|
||||
setTimeout(() => {
|
||||
console.log('unsubscribing');
|
||||
wsClient.unsubscribeV5('kline.5.ETHUSDT', 'spot');
|
||||
}, 5 * 1000);
|
||||
|
||||
// Topics are tracked per websocket type
|
||||
// Get a list of subscribed topics (e.g. for public v3 spot topics) (after a 5 second delay)
|
||||
@@ -113,4 +112,4 @@ setTimeout(() => {
|
||||
.getWsStore()
|
||||
.getTopics(WS_KEY_MAP.v5OptionPublic);
|
||||
console.log('Active public option v5 topics: ', activePublicOptionsTopics);
|
||||
}, 5 * 1000);
|
||||
}, 15 * 1000);
|
||||
|
||||
Reference in New Issue
Block a user