@shapeshiftoss/unchained-client 9.8.0 → 9.8.3

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/dist/websocket.js CHANGED
@@ -8,7 +8,7 @@ const logger_1 = require("@shapeshiftoss/logger");
8
8
  const isomorphic_ws_1 = __importDefault(require("isomorphic-ws"));
9
9
  const logger = new logger_1.Logger({
10
10
  namespace: ['unchained-client', 'websocket'],
11
- level: process.env.LOG_LEVEL
11
+ level: process.env.LOG_LEVEL,
12
12
  });
13
13
  const NORMAL_CLOSURE_CODE = 1000;
14
14
  class Client {
@@ -19,7 +19,7 @@ class Client {
19
19
  this.txs = {};
20
20
  this.url = url;
21
21
  this.connections = {
22
- txs: undefined
22
+ txs: undefined,
23
23
  };
24
24
  }
25
25
  async initialize() {
@@ -138,7 +138,7 @@ class Client {
138
138
  async subscribeTxs(subscriptionId, data, onMessage, onError) {
139
139
  var _a, _b, _c, _d;
140
140
  const addresses = [
141
- ...new Set([...((_c = (_b = (_a = this.txs[subscriptionId]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.addresses) !== null && _c !== void 0 ? _c : []), ...data.addresses])
141
+ ...new Set([...((_c = (_b = (_a = this.txs[subscriptionId]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.addresses) !== null && _c !== void 0 ? _c : []), ...data.addresses]),
142
142
  ];
143
143
  // keep track of all subscribed addresses and onMessage/onError handlers associated with each subscriptionId
144
144
  this.txs[subscriptionId] = { onMessage, onError, data: { topic: 'txs', addresses } };
@@ -183,7 +183,7 @@ class Client {
183
183
  const payload = {
184
184
  subscriptionId: subscriptionId !== null && subscriptionId !== void 0 ? subscriptionId : '',
185
185
  method: 'unsubscribe',
186
- data: { topic: 'txs', addresses: (_d = data === null || data === void 0 ? void 0 : data.addresses) !== null && _d !== void 0 ? _d : [] }
186
+ data: { topic: 'txs', addresses: (_d = data === null || data === void 0 ? void 0 : data.addresses) !== null && _d !== void 0 ? _d : [] },
187
187
  };
188
188
  (_e = this.connections.txs) === null || _e === void 0 ? void 0 : _e.ws.send(JSON.stringify(payload));
189
189
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/unchained-client",
3
- "version": "9.8.0",
3
+ "version": "9.8.3",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "source": "src/index.ts",