shoonya-sdk 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -25,7 +25,7 @@ import { RestClient, WebsocketClient } from "shoonya-sdk";
25
25
  const restClient = new RestClient(credentials, { logging: true });
26
26
  const wsClient = new WebsocketClient({ logging: true }); // No need to pass credential here
27
27
 
28
- const userDetail = restClient.getUserDetails();
28
+ const userDetail = await restClient.getUserDetails();
29
29
  console.log(`Logged in as ${userDetail.actid}`);
30
30
 
31
31
  wsClient.on("connected", () => {
package/dist/index.cjs CHANGED
@@ -888,6 +888,9 @@ var WebsocketClient = class extends import_events.EventEmitter {
888
888
  // unsubcribe depth subscription
889
889
  k: scripList.join("#")
890
890
  };
891
+ this.subscribedTokens = this.subscribedTokens.filter(
892
+ (item) => !scripList.includes(item)
893
+ );
891
894
  this.send(msg);
892
895
  }
893
896
  resubscribe() {
package/dist/index.js CHANGED
@@ -860,6 +860,9 @@ var WebsocketClient = class extends EventEmitter {
860
860
  // unsubcribe depth subscription
861
861
  k: scripList.join("#")
862
862
  };
863
+ this.subscribedTokens = this.subscribedTokens.filter(
864
+ (item) => !scripList.includes(item)
865
+ );
863
866
  this.send(msg);
864
867
  }
865
868
  resubscribe() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shoonya-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Wrapper around Shoonya API",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",