jsonrpc-client-websocket 1.5.2 → 1.5.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/README.md +1 -1
- package/lib/jsonrpc-websocket.d.ts +1 -1
- package/lib/jsonrpc-websocket.js +3 -3
- package/package.json +15 -15
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[](https://github.com/fabriciobastian/jsonrpc-client-websocket/actions/workflows/build.yml) [](https://choosealicense.com/licenses/mit/) [](https://www.npmjs.com/package/jsonrpc-client-websocket)
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
@@ -5,7 +5,7 @@ export declare enum WebsocketReadyStates {
|
|
|
5
5
|
CLOSING = 2,
|
|
6
6
|
CLOSED = 3
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export type ErrorCallback = (error: JsonRpcError) => void;
|
|
9
9
|
export declare class JsonRpcWebsocket {
|
|
10
10
|
private url;
|
|
11
11
|
private requestTimeoutMs;
|
package/lib/jsonrpc-websocket.js
CHANGED
|
@@ -9,6 +9,9 @@ export var WebsocketReadyStates;
|
|
|
9
9
|
WebsocketReadyStates[WebsocketReadyStates["CLOSED"] = 3] = "CLOSED";
|
|
10
10
|
})(WebsocketReadyStates || (WebsocketReadyStates = {}));
|
|
11
11
|
export class JsonRpcWebsocket {
|
|
12
|
+
get state() {
|
|
13
|
+
return this.websocket ? this.websocket.readyState : WebsocketReadyStates.CLOSED;
|
|
14
|
+
}
|
|
12
15
|
constructor(url, requestTimeoutMs, onError) {
|
|
13
16
|
this.url = url;
|
|
14
17
|
this.requestTimeoutMs = requestTimeoutMs;
|
|
@@ -18,9 +21,6 @@ export class JsonRpcWebsocket {
|
|
|
18
21
|
this.pendingRequests = {};
|
|
19
22
|
this.rpcMethods = {};
|
|
20
23
|
}
|
|
21
|
-
get state() {
|
|
22
|
-
return this.websocket ? this.websocket.readyState : WebsocketReadyStates.CLOSED;
|
|
23
|
-
}
|
|
24
24
|
async open() {
|
|
25
25
|
if (this.websocket) {
|
|
26
26
|
await this.close();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsonrpc-client-websocket",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"description": "A simple JSON RPC 2.0 websocket client",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -38,21 +38,21 @@
|
|
|
38
38
|
"author": "Fabricio Bastian",
|
|
39
39
|
"license": "MIT",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@types/jest": "^
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
43
|
-
"@typescript-eslint/parser": "^5.
|
|
44
|
-
"eslint": "^8.
|
|
45
|
-
"eslint-config-prettier": "^8.
|
|
46
|
-
"eslint-plugin-jest": "^
|
|
47
|
-
"jest": "^
|
|
48
|
-
"jest-environment-jsdom": "^
|
|
49
|
-
"jest-websocket-mock": "^2.
|
|
50
|
-
"mock-socket": "^9.1
|
|
51
|
-
"npm-check-updates": "^16.
|
|
52
|
-
"prettier": "^2.
|
|
53
|
-
"ts-jest": "^
|
|
41
|
+
"@types/jest": "^29.5.1",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
|
43
|
+
"@typescript-eslint/parser": "^5.59.2",
|
|
44
|
+
"eslint": "^8.39.0",
|
|
45
|
+
"eslint-config-prettier": "^8.8.0",
|
|
46
|
+
"eslint-plugin-jest": "^27.2.1",
|
|
47
|
+
"jest": "^29.5.0",
|
|
48
|
+
"jest-environment-jsdom": "^29.5.0",
|
|
49
|
+
"jest-websocket-mock": "^2.4.0",
|
|
50
|
+
"mock-socket": "^9.2.1",
|
|
51
|
+
"npm-check-updates": "^16.10.9",
|
|
52
|
+
"prettier": "^2.8.8",
|
|
53
|
+
"ts-jest": "^29.1.0",
|
|
54
54
|
"ts-node": "^10.9.1",
|
|
55
|
-
"typescript": "^
|
|
55
|
+
"typescript": "^5.0.4"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"get-parameter-names": "^0.3.0"
|