@dedot/api 0.11.1 → 0.12.0

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.
@@ -124,7 +124,10 @@ class DedotClient// prettier-end-here
124
124
  await this.chainHead.unfollow();
125
125
  }
126
126
  onDisconnected = async () => {
127
- this.chainHead.unfollow().catch(utils_1.noop);
127
+ try {
128
+ this.chainHead.unfollow().catch(utils_1.noop);
129
+ }
130
+ catch { }
128
131
  };
129
132
  cleanUp() {
130
133
  super.cleanUp();
@@ -80,21 +80,21 @@ class JsonRpcClient extends utils_1.EventEmitter {
80
80
  }
81
81
  });
82
82
  }
83
- #onConnected = async () => {
83
+ #onConnected = async (...args) => {
84
84
  // @ts-ignore
85
- this.emit('connected');
85
+ this.emit('connected', ...args);
86
86
  };
87
- #onDisconnected = async () => {
87
+ #onDisconnected = async (...args) => {
88
88
  // @ts-ignore
89
- this.emit('disconnected');
89
+ this.emit('disconnected', ...args);
90
90
  };
91
- #onReconnecting = async () => {
91
+ #onReconnecting = async (...args) => {
92
92
  // @ts-ignore
93
- this.emit('reconnecting');
93
+ this.emit('reconnecting', ...args);
94
94
  };
95
- #onError = async (e) => {
95
+ #onError = async (...args) => {
96
96
  // @ts-ignore
97
- this.emit('error', e);
97
+ this.emit('error', ...args);
98
98
  };
99
99
  async disconnect() {
100
100
  await this.#provider.disconnect();
@@ -121,7 +121,10 @@ export class DedotClient// prettier-end-here
121
121
  await this.chainHead.unfollow();
122
122
  }
123
123
  onDisconnected = async () => {
124
- this.chainHead.unfollow().catch(noop);
124
+ try {
125
+ this.chainHead.unfollow().catch(noop);
126
+ }
127
+ catch { }
125
128
  };
126
129
  cleanUp() {
127
130
  super.cleanUp();
@@ -76,21 +76,21 @@ export class JsonRpcClient extends EventEmitter {
76
76
  }
77
77
  });
78
78
  }
79
- #onConnected = async () => {
79
+ #onConnected = async (...args) => {
80
80
  // @ts-ignore
81
- this.emit('connected');
81
+ this.emit('connected', ...args);
82
82
  };
83
- #onDisconnected = async () => {
83
+ #onDisconnected = async (...args) => {
84
84
  // @ts-ignore
85
- this.emit('disconnected');
85
+ this.emit('disconnected', ...args);
86
86
  };
87
- #onReconnecting = async () => {
87
+ #onReconnecting = async (...args) => {
88
88
  // @ts-ignore
89
- this.emit('reconnecting');
89
+ this.emit('reconnecting', ...args);
90
90
  };
91
- #onError = async (e) => {
91
+ #onError = async (...args) => {
92
92
  // @ts-ignore
93
- this.emit('error', e);
93
+ this.emit('error', ...args);
94
94
  };
95
95
  async disconnect() {
96
96
  await this.#provider.disconnect();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dedot/api",
3
- "version": "0.11.1",
3
+ "version": "0.12.0",
4
4
  "description": "A delightful JavaScript/TypeScript client for Polkadot & Substrate",
5
5
  "author": "Thang X. Vu <thang@dedot.dev>",
6
6
  "homepage": "https://dedot.dev",
@@ -13,13 +13,13 @@
13
13
  "type": "module",
14
14
  "sideEffects": false,
15
15
  "dependencies": {
16
- "@dedot/codecs": "0.11.1",
17
- "@dedot/providers": "0.11.1",
18
- "@dedot/runtime-specs": "0.11.1",
19
- "@dedot/shape": "0.11.1",
20
- "@dedot/storage": "0.11.1",
21
- "@dedot/types": "0.11.1",
22
- "@dedot/utils": "0.11.1"
16
+ "@dedot/codecs": "0.12.0",
17
+ "@dedot/providers": "0.12.0",
18
+ "@dedot/runtime-specs": "0.12.0",
19
+ "@dedot/shape": "0.12.0",
20
+ "@dedot/storage": "0.12.0",
21
+ "@dedot/types": "0.12.0",
22
+ "@dedot/utils": "0.12.0"
23
23
  },
24
24
  "scripts": {
25
25
  "build": "tsc --project tsconfig.build.json && tsc --project tsconfig.build.cjs.json",
@@ -48,7 +48,7 @@
48
48
  "node": ">=18"
49
49
  },
50
50
  "license": "Apache-2.0",
51
- "gitHead": "f38fc00ea34f4cdac2fb7d57099febe841cf860f",
51
+ "gitHead": "3c95d17aedae13de99f6df81068cd61905091075",
52
52
  "module": "./index.js",
53
53
  "types": "./index.d.ts"
54
54
  }