chia-agent 14.2.0 → 14.2.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.
- package/CHANGELOG.md +12 -1
- package/README.md +3 -3
- package/daemon/connection.js +1 -0
- package/daemon/index.d.ts +2 -1
- package/daemon/index.js +3 -2
- package/package.json +1 -1
- package/rpc/index.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [14.2.2]
|
|
4
|
+
### Changed
|
|
5
|
+
- For the log which is output when `success` property in API response is `false`, the log level is now `INFO` instead of `ERROR`.
|
|
6
|
+
|
|
7
|
+
## [14.2.1]
|
|
8
|
+
### Changed
|
|
9
|
+
- [`daemon.connect()`](./src/daemon/README.md#daemonconnecturl-string-timeoutms-number) now returns a rejected promise on failure instead of throwing an uncaught exception
|
|
10
|
+
- [`daemon.connect()`](./src/daemon/README.md#daemonconnecturl-string-timeoutms-number) now accepts connection timeout in milliseconds.
|
|
11
|
+
|
|
3
12
|
## [14.2.0]
|
|
4
13
|
### Note
|
|
5
14
|
- [`add_private_key`](./src/api/ws/daemon/README.md#add_private_keydaemon-params)
|
|
6
15
|
- The request parameters `kc_user` and `kc_service` is temporarily not working with `2.4.0` and `2.4.1` of
|
|
7
|
-
`chia-blockchain`.
|
|
16
|
+
`chia-blockchain`. (`2.4.2` fixed this issue)
|
|
8
17
|
This is a bug and not spec change so `chia-agent` stays to be able to set those params for now.
|
|
9
18
|
### Changed
|
|
10
19
|
- Reorganized directory structure under `src/api/` in order to make it clear the dependencies from `chia_rs`/`pool_reference`
|
|
@@ -1633,6 +1642,8 @@ daemon.sendMessage(destination, get_block_record_by_height_command, data);
|
|
|
1633
1642
|
Initial release.
|
|
1634
1643
|
|
|
1635
1644
|
<!-- [Unreleased]: https://github.com/Chia-Mine/chia-agent/compare/v0.0.1...v0.0.2 -->
|
|
1645
|
+
[14.2.2]: https://github.com/Chia-Mine/chia-agent/compare/v14.2.1...v14.2.2
|
|
1646
|
+
[14.2.1]: https://github.com/Chia-Mine/chia-agent/compare/v14.2.0...v14.2.1
|
|
1636
1647
|
[14.2.0]: https://github.com/Chia-Mine/chia-agent/compare/v14.1.0...v14.2.0
|
|
1637
1648
|
[14.1.0]: https://github.com/Chia-Mine/chia-agent/compare/v14.0.0...v14.1.0
|
|
1638
1649
|
[14.0.0]: https://github.com/Chia-Mine/chia-agent/compare/v13.2.0...v14.0.0
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
[](https://badge.fury.io/js/chia-agent) [](https://opensource.org/licenses/MIT)
|
|
3
3
|
|
|
4
4
|
chia rpc/websocket client library for NodeJS.
|
|
5
|
-
Supports all RPC/Websocket API available at `2.4.0` and `2.4.
|
|
5
|
+
Supports all RPC/Websocket API available at `2.4.0`, `2.4.1` and `2.4.2` of [`chia-blockchain`](https://github.com/Chia-Network/chia-blockchain/).
|
|
6
6
|
\(If you need previous version, search for the corresponding release [here](https://github.com/Chia-Mine/chia-agent/releases)\)
|
|
7
7
|
|
|
8
8
|
you can develop your own nodejs script with `chia-agent` to:
|
|
@@ -22,8 +22,8 @@ yarn add chia-agent
|
|
|
22
22
|
|
|
23
23
|
## Compatibility
|
|
24
24
|
This code is compatible with:
|
|
25
|
-
- [`
|
|
26
|
-
- [Diff to the main branch of chia-blockchain](https://github.com/Chia-Network/chia-blockchain/compare/
|
|
25
|
+
- [`6ae45b70369eae3ab23391867846bb84d010a30b`](https://github.com/Chia-Network/chia-blockchain/tree/6ae45b70369eae3ab23391867846bb84d010a30b) of [chia-blockchain 2.4.2](https://github.com/Chia-Network/chia-blockchain)
|
|
26
|
+
- [Diff to the main branch of chia-blockchain](https://github.com/Chia-Network/chia-blockchain/compare/6ae45b70369eae3ab23391867846bb84d010a30b...main)
|
|
27
27
|
- [`284dfdffe0397413bfec2376da0c2f038b7ebe4d`](https://github.com/Chia-Network/pool-reference/tree/284dfdffe0397413bfec2376da0c2f038b7ebe4d) of [pool-reference](https://github.com/Chia-Network/pool-reference)
|
|
28
28
|
- [Diff to the main branch of pool-reference](https://github.com/Chia-Network/pool-reference/compare/284dfdffe0397413bfec2376da0c2f038b7ebe4d...main)
|
|
29
29
|
- [`3f8a42b9d81e513dfc6c151d952a1c3f17030a8d`](https://github.com/Chia-Network/chia_rs/tree/3f8a42b9d81e513dfc6c151d952a1c3f17030a8d) of [chia_rs](https://github.com/Chia-Network/chia_rs)
|
package/daemon/connection.js
CHANGED
package/daemon/index.d.ts
CHANGED
|
@@ -28,8 +28,9 @@ declare class Daemon {
|
|
|
28
28
|
/**
|
|
29
29
|
* Connect to local daemon via websocket.
|
|
30
30
|
* @param daemonServerURL
|
|
31
|
+
* @param timeoutMs
|
|
31
32
|
*/
|
|
32
|
-
connect(daemonServerURL?: string): Promise<boolean>;
|
|
33
|
+
connect(daemonServerURL?: string, timeoutMs?: number): Promise<boolean>;
|
|
33
34
|
close(): Promise<unknown>;
|
|
34
35
|
sendMessage<M = unknown>(destination: string, command: string, data?: Record<string, unknown>): Promise<M>;
|
|
35
36
|
createMessageTemplate(command: string, destination: string, data: Record<string, unknown>): {
|
package/daemon/index.js
CHANGED
|
@@ -72,8 +72,9 @@ class Daemon {
|
|
|
72
72
|
/**
|
|
73
73
|
* Connect to local daemon via websocket.
|
|
74
74
|
* @param daemonServerURL
|
|
75
|
+
* @param timeoutMs
|
|
75
76
|
*/
|
|
76
|
-
connect(daemonServerURL) {
|
|
77
|
+
connect(daemonServerURL, timeoutMs) {
|
|
77
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78
79
|
if (!daemonServerURL) {
|
|
79
80
|
const config = (0, index_1.getConfig)();
|
|
@@ -89,7 +90,7 @@ class Daemon {
|
|
|
89
90
|
return false;
|
|
90
91
|
}
|
|
91
92
|
(0, logger_1.getLogger)().debug(`Opening websocket connection to ${daemonServerURL}`);
|
|
92
|
-
const result = yield (0, connection_1.open)(daemonServerURL);
|
|
93
|
+
const result = yield (0, connection_1.open)(daemonServerURL, timeoutMs);
|
|
93
94
|
this._socket = result.ws;
|
|
94
95
|
this._socket.onerror = this.onError;
|
|
95
96
|
this._socket.onmessage = this.onMessage;
|
package/package.json
CHANGED
package/rpc/index.js
CHANGED
|
@@ -272,7 +272,7 @@ class RPCAgent {
|
|
|
272
272
|
return reject(new Error(`Response has no 'success' property: ${serializedData}`));
|
|
273
273
|
}
|
|
274
274
|
if (!d.success) {
|
|
275
|
-
(0, logger_1.getLogger)().
|
|
275
|
+
(0, logger_1.getLogger)().info(`API failure: ${d.error}`);
|
|
276
276
|
return reject(d);
|
|
277
277
|
}
|
|
278
278
|
return resolve(d);
|