Skip to content

Commit

Permalink
chore(): bump typescript and types/node versions
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagosiebler committed Jan 21, 2025
1 parent 39ce4c4 commit 50bae8b
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 30 deletions.
15 changes: 11 additions & 4 deletions examples/ws-public-v5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ wsClient.on('reconnected', (data) => {
// Option v5
// wsClient.subscribeV5('publicTrade.BTC', 'option');

const topics = ['kline.5.XRPUSDT', 'kline.5.BTCUSDT', 'kline.5.ETHUSDT'];

// Use the subscribeV5() call for most subscribe calls with v5 websockets
wsClient.subscribeV5(topics, 'spot');

// Alternatively, you can also use objects in the wsClient.subscribe() call
// wsClient.subscribe({
// topic: 'orderook.50.BTCUSDT',
// category: 'spot',
// });

/**
* For private V5 topics, just call the same subscribeV5() method on the ws client or use the original subscribe() method.
*
Expand All @@ -79,10 +90,6 @@ wsClient.on('reconnected', (data) => {
// wsClient.subscribeV5('execution', 'linear');
// wsClient.subscribeV5(['order', 'wallet', 'greek'], 'linear');

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');
Expand Down
49 changes: 26 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"devDependencies": {
"@types/jest": "^29.5.11",
"@types/node": "^20.11.6",
"@types/node": "^22.10.7",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"eslint": "^8.29.0",
Expand All @@ -40,7 +40,7 @@
"jest": "^29.7.0",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
"typescript": "^5.7.3"
},
"optionalDependencies": {
"source-map-loader": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/websocket-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export class WebsocketClient extends BaseWebsocketClient<
perWsKeyTopics[derivedWsKey] = [];
}

perWsKeyTopics[derivedWsKey]!.push(wsRequest);
perWsKeyTopics[derivedWsKey].push(wsRequest);
}

const promises: Promise<unknown>[] = [];
Expand Down

0 comments on commit 50bae8b

Please sign in to comment.