@bithomp/xrpl-api 3.7.0 → 3.7.2

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.
@@ -45,6 +45,7 @@ declare class Connection extends EventEmitter {
45
45
  streams: ConnectionStreamsInfo;
46
46
  accounts: ConnectionAccountsInfo;
47
47
  private streamsSubscribed;
48
+ private bindConnectionWatchTimeout;
48
49
  constructor(url: string, type?: string, options?: ConnectionOptions);
49
50
  connect(): Promise<void>;
50
51
  disconnect(): Promise<void>;
package/lib/connection.js CHANGED
@@ -58,6 +58,7 @@ class Connection extends events_1.EventEmitter {
58
58
  this.serverInfo = {};
59
59
  this.shutdown = false;
60
60
  this.connectionWatchTimer = null;
61
+ this.bindConnectionWatchTimeout = this.connectionWatchTimeout.bind(this);
61
62
  this.shutdown = false;
62
63
  this.url = url;
63
64
  this.type = type;
@@ -279,6 +280,9 @@ class Connection extends events_1.EventEmitter {
279
280
  this.removeClient();
280
281
  this.resetTypes();
281
282
  this.serverInfoUpdating = false;
283
+ this.onlineSince = 0;
284
+ this.serverInfo = null;
285
+ this.streamsSubscribed = false;
282
286
  await this.connect();
283
287
  }
284
288
  catch (e) {
@@ -552,7 +556,7 @@ class Connection extends events_1.EventEmitter {
552
556
  if (this.serverInfo === null && this.isConnected()) {
553
557
  this.updateServerInfo();
554
558
  }
555
- this.connectionWatchTimer = setTimeout(this.connectionWatchTimeout.bind(this), LEDGER_CLOSED_TIMEOUT);
559
+ this.connectionWatchTimer = setTimeout(this.bindConnectionWatchTimeout, LEDGER_CLOSED_TIMEOUT);
556
560
  }
557
561
  else {
558
562
  this.removeClient();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bithomp/xrpl-api",
3
- "version": "3.7.0",
3
+ "version": "3.7.2",
4
4
  "description": "A Bithomp JavaScript/TypeScript library for interacting with the XRP Ledger",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -42,7 +42,7 @@
42
42
  "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
43
43
  "lint": "eslint",
44
44
  "prepare": "npm run build",
45
- "-prepublishOnly": "npm test && npm run lint",
45
+ "prepublishOnly": "npm test && npm run lint",
46
46
  "preversion": "npm run lint",
47
47
  "version": "npm run format && git add -A src",
48
48
  "postversion": "git push && git push --tags"