chia-agent 14.0.0 → 14.2.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.
- package/CHANGELOG.md +252 -3
- package/LICENSE +1 -1
- package/README.md +7 -5
- package/agent/index.d.ts +1 -1
- package/api/chia/consensus/block_record.d.ts +1 -32
- package/api/chia/consensus/blockchain.d.ts +2 -1
- package/api/chia/consensus/cost_calculator.d.ts +1 -1
- package/api/chia/data_layer/data_layer_util.d.ts +16 -16
- package/api/chia/data_layer/data_layer_wallet.d.ts +4 -3
- package/api/chia/farmer/farmer.d.ts +1 -1
- package/api/chia/full_node/signage_point.d.ts +1 -1
- package/api/chia/harvester/harvester.d.ts +1 -1
- package/api/chia/plot-sync/receiver.d.ts +2 -2
- package/api/chia/plotters/bladebit.d.ts +1 -1
- package/api/chia/plotters/chiapos.d.ts +1 -1
- package/api/chia/plotters/maxmax.d.ts +1 -1
- package/api/chia/plotting/util.d.ts +3 -3
- package/api/chia/pools/pool_config.d.ts +1 -1
- package/api/chia/pools/pool_wallet_info.d.ts +2 -4
- package/api/chia/protocols/farmer_protocol.d.ts +8 -8
- package/api/chia/protocols/harvester_protocol.d.ts +1 -1
- package/api/chia/protocols/pool_protocol.d.ts +13 -13
- package/api/chia/rpc/util.d.ts +14 -0
- package/api/chia/rpc/wallet_request_types.d.ts +46 -3
- package/api/chia/server/outbound_message.d.ts +1 -1
- package/api/chia/timelord/types.d.ts +1 -1
- package/api/chia/types/_python_types_.d.ts +22 -22
- package/api/chia/types/blockchain_format/classgroup.d.ts +1 -4
- package/api/chia/types/blockchain_format/coin.d.ts +1 -11
- package/api/chia/types/blockchain_format/foliage.d.ts +1 -35
- package/api/chia/types/blockchain_format/pool_target.d.ts +1 -6
- package/api/chia/types/blockchain_format/program.d.ts +1 -1
- package/api/chia/types/blockchain_format/proof_of_space.d.ts +1 -10
- package/api/chia/types/blockchain_format/reward_chain_block.d.ts +1 -30
- package/api/chia/types/blockchain_format/sized_bytes.d.ts +7 -7
- package/api/chia/types/blockchain_format/slots.d.ts +1 -24
- package/api/chia/types/blockchain_format/sub_epoch_summary.d.ts +1 -9
- package/api/chia/types/blockchain_format/vdf.d.ts +1 -13
- package/api/chia/types/clvm_cost.d.ts +1 -1
- package/api/chia/types/coin_record.d.ts +2 -2
- package/api/chia/types/coin_spend.d.ts +3 -8
- package/api/chia/types/condition_opcode.d.ts +1 -1
- package/api/chia/types/condition_with_args.d.ts +1 -1
- package/api/chia/types/end_of_slot_bundle.d.ts +1 -8
- package/api/chia/types/full_block.d.ts +1 -20
- package/api/chia/types/mempool_item.d.ts +3 -3
- package/api/chia/types/mojos.d.ts +1 -1
- package/api/chia/types/signing_mode.d.ts +6 -6
- package/api/chia/types/spend_bundle.d.ts +1 -1
- package/api/chia/types/spend_bundle_condition.d.ts +1 -26
- package/api/chia/types/unfinished_block.d.ts +1 -0
- package/api/chia/types/unfinished_header_block.d.ts +1 -1
- package/api/chia/util/keychain.d.ts +2 -2
- package/api/chia/util/misc.d.ts +1 -1
- package/api/chia/wallet/cat_wallet/cat_constants.d.ts +1 -1
- package/api/chia/wallet/conditions.d.ts +2 -2
- package/api/chia/wallet/dao_wallet/dao_info.d.ts +5 -5
- package/api/chia/wallet/dao_wallet/dao_wallet.d.ts +3 -3
- package/api/chia/wallet/lineage_proof.d.ts +1 -1
- package/api/chia/wallet/nft_wallet/nft_info.d.ts +1 -1
- package/api/chia/wallet/notification_store.d.ts +1 -1
- package/api/chia/wallet/puzzle_drivers.d.ts +2 -2
- package/api/chia/wallet/puzzles/clawback/metadata.d.ts +2 -2
- package/api/chia/wallet/signer_protocol.d.ts +54 -0
- package/api/chia/wallet/signer_protocol.js +2 -0
- package/api/chia/wallet/trade_record.d.ts +3 -3
- package/api/chia/wallet/transaction_record.d.ts +4 -4
- package/api/chia/wallet/util/quality_filter.d.ts +5 -5
- package/api/chia/wallet/util/tx_config.d.ts +4 -11
- package/api/chia/wallet/util/wallet_types.d.ts +1 -1
- package/api/chia/wallet/vc_wallet/vc_drivers.d.ts +2 -2
- package/api/chia/wallet/vc_wallet/vc_store.d.ts +1 -1
- package/api/chia/wallet/wallet_coin_record.d.ts +2 -2
- package/api/chia/wallet/wallet_coin_store.d.ts +1 -1
- package/api/chia/wallet/wallet_info.d.ts +2 -2
- package/api/chia/wallet/wallet_node.d.ts +1 -1
- package/api/chia_rs/chia-bls/public_key.d.ts +2 -0
- package/api/chia_rs/chia-bls/public_key.js +2 -0
- package/api/chia_rs/chia-consensus/gen/owned_conditions.d.ts +36 -0
- package/api/chia_rs/chia-consensus/gen/owned_conditions.js +2 -0
- package/api/chia_rs/chia-protocol/block_record.d.ts +32 -0
- package/api/chia_rs/chia-protocol/block_record.js +2 -0
- package/api/chia_rs/chia-protocol/classgroup.d.ts +4 -0
- package/api/chia_rs/chia-protocol/classgroup.js +2 -0
- package/api/chia_rs/chia-protocol/coin.d.ts +7 -0
- package/api/chia_rs/chia-protocol/coin.js +2 -0
- package/api/chia_rs/chia-protocol/coin_spend.d.ts +7 -0
- package/api/chia_rs/chia-protocol/coin_spend.js +2 -0
- package/api/chia_rs/chia-protocol/end_of_sub_slot_bundle.d.ts +8 -0
- package/api/chia_rs/chia-protocol/end_of_sub_slot_bundle.js +2 -0
- package/api/chia_rs/chia-protocol/foliage.d.ts +35 -0
- package/api/chia_rs/chia-protocol/foliage.js +2 -0
- package/api/chia_rs/chia-protocol/fullblock.d.ts +20 -0
- package/api/chia_rs/chia-protocol/fullblock.js +2 -0
- package/api/chia_rs/chia-protocol/pool_target.d.ts +6 -0
- package/api/chia_rs/chia-protocol/pool_target.js +2 -0
- package/api/chia_rs/chia-protocol/program.d.ts +2 -0
- package/api/chia_rs/chia-protocol/program.js +2 -0
- package/api/chia_rs/chia-protocol/proof_of_space.d.ts +10 -0
- package/api/chia_rs/chia-protocol/proof_of_space.js +2 -0
- package/api/chia_rs/chia-protocol/reward_chain_block.d.ts +30 -0
- package/api/chia_rs/chia-protocol/reward_chain_block.js +2 -0
- package/api/chia_rs/chia-protocol/slots.d.ts +24 -0
- package/api/chia_rs/chia-protocol/slots.js +2 -0
- package/api/chia_rs/chia-protocol/sub_epoch_summary.d.ts +9 -0
- package/api/chia_rs/chia-protocol/sub_epoch_summary.js +2 -0
- package/api/chia_rs/chia-protocol/unfinished_block.d.ts +17 -0
- package/api/chia_rs/chia-protocol/unfinished_block.js +2 -0
- package/api/chia_rs/chia-protocol/vdf.d.ts +13 -0
- package/api/chia_rs/chia-protocol/vdf.js +2 -0
- package/api/{chia/pool/store.d.ts → pool-reference/pool/record.d.ts} +5 -5
- package/api/pool-reference/pool/record.js +2 -0
- package/api/rpc/common/index.d.ts +34 -24
- package/api/rpc/common/index.js +8 -1
- package/api/rpc/crawler/index.d.ts +10 -10
- package/api/rpc/data_layer/index.d.ts +208 -134
- package/api/rpc/data_layer/index.js +23 -2
- package/api/rpc/farmer/index.d.ts +52 -55
- package/api/rpc/full_node/index.d.ts +140 -154
- package/api/rpc/full_node/index.js +2 -9
- package/api/rpc/harvester/index.d.ts +31 -34
- package/api/rpc/index.d.ts +7 -7
- package/api/rpc/index.js +13 -9
- package/api/rpc/pool/index.d.ts +13 -13
- package/api/rpc/wallet/index.d.ts +747 -641
- package/api/rpc/wallet/index.js +27 -20
- package/api/types.d.ts +4 -3
- package/api/types.js +2 -1
- package/api/ws/chia_plots_create/index.d.ts +7 -7
- package/api/ws/crawler/index.d.ts +9 -9
- package/api/ws/daemon/index.d.ts +198 -166
- package/api/ws/daemon/index.js +17 -3
- package/api/ws/farmer/index.d.ts +34 -34
- package/api/ws/full_node/index.d.ts +28 -17
- package/api/ws/full_node/index.js +14 -1
- package/api/ws/harvester/index.d.ts +19 -19
- package/api/ws/index.d.ts +3 -3
- package/api/ws/index.js +5 -2
- package/api/ws/timelord/index.d.ts +14 -14
- package/api/ws/wallet/index.d.ts +22 -22
- package/bin/cli.js +3 -3
- package/config/index.d.ts +1 -1
- package/config/index.js +3 -3
- package/daemon/connection.js +9 -10
- package/daemon/index.d.ts +6 -6
- package/daemon/index.js +21 -21
- package/index.js +5 -1
- package/logger.d.ts +3 -3
- package/package.json +3 -3
- package/rpc/index.d.ts +6 -4
- package/rpc/index.js +29 -29
- package/api/chia/types/blockchain_format/serialized_program.d.ts +0 -2
- /package/api/chia/{pool/store.js → rpc/util.js} +0 -0
- /package/api/chia/types/{blockchain_format/serialized_program.js → unfinished_block.js} +0 -0
package/api/ws/daemon/index.js
CHANGED
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
13
|
-
exports.on_keyring_status_changed = exports.keyring_status_changed_command = exports.get_keys_for_plotting = exports.get_keys_for_plotting_command = exports.get_wallet_addresses = exports.get_wallet_addresses_command = exports.get_routes = exports.get_routes_command = exports.get_plotters = exports.get_plotters_command = exports.get_version = exports.get_version_command = exports.get_status = exports.get_status_command = exports.register_service = exports.register_service_command = exports.exit = exports.exit_command = exports.notify_keyring_migration_completed = exports.notify_keyring_migration_completed_command = exports.remove_keyring_passphrase = exports.remove_keyring_passphrase_command = exports.set_keyring_passphrase = exports.set_keyring_passphrase_command = exports.migrate_keyring = void 0;
|
|
12
|
+
exports.validate_keyring_passphrase_command = exports.unlock_keyring = exports.unlock_keyring_command = exports.keyring_status = exports.keyring_status_command = exports.is_keyring_locked = exports.is_keyring_locked_command = exports.delete_label = exports.delete_label_command = exports.set_label = exports.set_label_command = exports.get_public_keys = exports.get_public_keys_command = exports.get_public_key = exports.get_public_key_command = exports.get_keys = exports.get_keys_command = exports.get_key = exports.get_key_command = exports.get_key_for_fingerprint = exports.get_key_for_fingerprint_command = exports.get_first_private_key = exports.get_first_private_key_command = exports.get_all_private_keys = exports.get_all_private_keys_command = exports.delete_key_by_fingerprint = exports.delete_key_by_fingerprint_command = exports.delete_all_keys = exports.delete_all_keys_command = exports.check_keys = exports.check_keys_command = exports.add_key = exports.add_key_command = exports.add_private_key = exports.add_private_key_command = exports.is_running = exports.is_running_command = exports.running_services = exports.running_services_command = exports.stop_service = exports.stop_service_command = exports.stop_plotting = exports.stop_plotting_command = exports.start_plotting = exports.start_plotting_command = exports.start_service = exports.start_service_command = exports.ping = exports.ping_command = exports.daemon_service = void 0;
|
|
13
|
+
exports.on_keyring_status_changed = exports.keyring_status_changed_command = exports.get_network_info = exports.get_network_info_command = exports.get_keys_for_plotting = exports.get_keys_for_plotting_command = exports.get_wallet_addresses = exports.get_wallet_addresses_command = exports.get_routes = exports.get_routes_command = exports.get_plotters = exports.get_plotters_command = exports.get_version = exports.get_version_command = exports.get_status = exports.get_status_command = exports.register_service = exports.register_service_command = exports.exit = exports.exit_command = exports.notify_keyring_migration_completed = exports.notify_keyring_migration_completed_command = exports.remove_keyring_passphrase = exports.remove_keyring_passphrase_command = exports.set_keyring_passphrase = exports.set_keyring_passphrase_command = exports.migrate_keyring = exports.migrate_keyring_command = exports.validate_keyring_passphrase = void 0;
|
|
14
14
|
// The daemon service currently does not provide state_change event as of v1.1.5.
|
|
15
15
|
const types_1 = require("../../types");
|
|
16
16
|
exports.daemon_service = "daemon";
|
|
@@ -70,6 +70,13 @@ function add_private_key(daemon, data) {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
exports.add_private_key = add_private_key;
|
|
73
|
+
exports.add_key_command = "add_key";
|
|
74
|
+
function add_key(daemon, data) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
return daemon.sendMessage(exports.daemon_service, exports.add_key_command, data);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
exports.add_key = add_key;
|
|
73
80
|
exports.check_keys_command = "check_keys";
|
|
74
81
|
function check_keys(daemon, data) {
|
|
75
82
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -266,7 +273,14 @@ function get_keys_for_plotting(daemon, data) {
|
|
|
266
273
|
});
|
|
267
274
|
}
|
|
268
275
|
exports.get_keys_for_plotting = get_keys_for_plotting;
|
|
269
|
-
|
|
276
|
+
exports.get_network_info_command = "get_network_info";
|
|
277
|
+
function get_network_info(daemon) {
|
|
278
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
279
|
+
return daemon.sendMessage(exports.daemon_service, exports.get_network_info_command);
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
exports.get_network_info = get_network_info;
|
|
283
|
+
/// From here subscribe/listen style APIs ///
|
|
270
284
|
exports.keyring_status_changed_command = "keyring_status_changed";
|
|
271
285
|
function on_keyring_status_changed(daemon, callback) {
|
|
272
286
|
return __awaiter(this, void 0, void 0, function* () {
|
package/api/ws/farmer/index.d.ts
CHANGED
|
@@ -6,17 +6,17 @@ import { TDaemon } from "../../../daemon/index";
|
|
|
6
6
|
import { GetMessageType, TConnectionGeneral } from "../../types";
|
|
7
7
|
import { Receiver } from "../../chia/plot-sync/receiver";
|
|
8
8
|
export declare const chia_farmer_service = "chia_farmer";
|
|
9
|
-
export
|
|
9
|
+
export type chia_farmer_service = typeof chia_farmer_service;
|
|
10
10
|
export declare const get_connections_command = "get_connections";
|
|
11
|
-
export
|
|
12
|
-
export
|
|
11
|
+
export type get_connections_command = typeof get_connections_command;
|
|
12
|
+
export type TGetConnectionsBroadCast = {
|
|
13
13
|
connections: TConnectionGeneral[];
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type WsGetConnectionFarmerMessage = GetMessageType<chia_farmer_service, get_connections_command, TGetConnectionsBroadCast>;
|
|
16
16
|
export declare function on_get_connections(daemon: TDaemon, callback: (e: WsGetConnectionFarmerMessage) => unknown): Promise<() => void>;
|
|
17
17
|
export declare const new_farming_info_command = "new_farming_info";
|
|
18
|
-
export
|
|
19
|
-
export
|
|
18
|
+
export type new_farming_info_command = typeof new_farming_info_command;
|
|
19
|
+
export type TNewFarmingInfoBroadCast = {
|
|
20
20
|
farming_info: {
|
|
21
21
|
challenge_hash: bytes32;
|
|
22
22
|
signage_point: bytes32;
|
|
@@ -28,66 +28,66 @@ export declare type TNewFarmingInfoBroadCast = {
|
|
|
28
28
|
lookup_time: uint64;
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
-
export
|
|
31
|
+
export type WsNewFarmingInfoMessage = GetMessageType<chia_farmer_service, new_farming_info_command, TNewFarmingInfoBroadCast>;
|
|
32
32
|
export declare function on_new_farming_info(daemon: TDaemon, callback: (e: WsNewFarmingInfoMessage) => unknown): Promise<() => void>;
|
|
33
33
|
export declare const new_signage_point_command = "new_signage_point";
|
|
34
|
-
export
|
|
35
|
-
export
|
|
34
|
+
export type new_signage_point_command = typeof new_signage_point_command;
|
|
35
|
+
export type TNewSignagePointBroadCast = {
|
|
36
36
|
proofs: ProofOfSpace[];
|
|
37
37
|
signage_point: NewSignagePoint;
|
|
38
38
|
missing_signage_points: Optional<[uint64, uint32]>;
|
|
39
39
|
};
|
|
40
|
-
export
|
|
40
|
+
export type WsNewSignagePointMessage = GetMessageType<chia_farmer_service, new_signage_point_command, TNewSignagePointBroadCast>;
|
|
41
41
|
export declare function on_new_signage_point(daemon: TDaemon, callback: (e: WsNewSignagePointMessage) => unknown): Promise<() => void>;
|
|
42
42
|
export declare const harvester_update_command = "harvester_update";
|
|
43
|
-
export
|
|
44
|
-
export
|
|
45
|
-
export
|
|
43
|
+
export type harvester_update_command = typeof harvester_update_command;
|
|
44
|
+
export type THarvesterUpdateBroadCast = Receiver<true>;
|
|
45
|
+
export type WsHarvesterUpdateMessage = GetMessageType<chia_farmer_service, harvester_update_command, THarvesterUpdateBroadCast>;
|
|
46
46
|
export declare function on_harvester_update(daemon: TDaemon, callback: (e: WsHarvesterUpdateMessage) => unknown): Promise<() => void>;
|
|
47
47
|
export declare const harvester_removed_command = "harvester_removed";
|
|
48
|
-
export
|
|
49
|
-
export
|
|
48
|
+
export type harvester_removed_command = typeof harvester_removed_command;
|
|
49
|
+
export type THarvesterRemovedBroadCast = {
|
|
50
50
|
node_id: bytes32;
|
|
51
51
|
};
|
|
52
|
-
export
|
|
52
|
+
export type WsHarvesterRemovedMessage = GetMessageType<chia_farmer_service, harvester_removed_command, THarvesterRemovedBroadCast>;
|
|
53
53
|
export declare function on_harvester_removed(daemon: TDaemon, callback: (e: WsHarvesterRemovedMessage) => unknown): Promise<() => void>;
|
|
54
54
|
export declare const proof_command = "proof";
|
|
55
|
-
export
|
|
56
|
-
export
|
|
55
|
+
export type proof_command = typeof proof_command;
|
|
56
|
+
export type TProofBroadCast = {
|
|
57
57
|
proof: DeclareProofOfSpace;
|
|
58
58
|
passed_filter: bool;
|
|
59
59
|
};
|
|
60
|
-
export
|
|
60
|
+
export type WsProofMessage = GetMessageType<chia_farmer_service, proof_command, TProofBroadCast>;
|
|
61
61
|
export declare function on_proof(daemon: TDaemon, callback: (e: WsProofMessage) => unknown): Promise<() => void>;
|
|
62
62
|
export declare const submitted_partial_command = "submitted_partial";
|
|
63
|
-
export
|
|
64
|
-
export
|
|
63
|
+
export type submitted_partial_command = typeof submitted_partial_command;
|
|
64
|
+
export type TSubmittedPartialBroadCast = {
|
|
65
65
|
launcher_id: str;
|
|
66
66
|
pool_url: str;
|
|
67
67
|
current_difficulty: uint64;
|
|
68
68
|
points_acknowledged_since_start: uint64;
|
|
69
69
|
points_acknowledged_24h: Array<[float, uint64]>;
|
|
70
70
|
};
|
|
71
|
-
export
|
|
71
|
+
export type WsSubmittedPartialMessage = GetMessageType<chia_farmer_service, submitted_partial_command, TSubmittedPartialBroadCast>;
|
|
72
72
|
export declare function on_submitted_partial(daemon: TDaemon, callback: (e: WsSubmittedPartialMessage) => unknown): Promise<() => void>;
|
|
73
73
|
export declare const failed_partial_command = "failed_partial";
|
|
74
|
-
export
|
|
75
|
-
export
|
|
74
|
+
export type failed_partial_command = typeof failed_partial_command;
|
|
75
|
+
export type TFailedPartialBroadCast = {
|
|
76
76
|
p2_singleton_puzzle_hash: str;
|
|
77
77
|
};
|
|
78
|
-
export
|
|
78
|
+
export type WsFailedPartialMessage = GetMessageType<chia_farmer_service, failed_partial_command, TFailedPartialBroadCast>;
|
|
79
79
|
export declare function on_failed_partial(daemon: TDaemon, callback: (e: WsFailedPartialMessage) => unknown): Promise<() => void>;
|
|
80
80
|
export declare const add_connection_command = "add_connection";
|
|
81
|
-
export
|
|
82
|
-
export
|
|
83
|
-
export
|
|
81
|
+
export type add_connection_command = typeof add_connection_command;
|
|
82
|
+
export type TAddConnectionBroadCast = Record<string, never>;
|
|
83
|
+
export type WsAddConnectionMessage = GetMessageType<chia_farmer_service, add_connection_command, TAddConnectionBroadCast>;
|
|
84
84
|
export declare function on_add_connection(daemon: TDaemon, callback: (e: WsAddConnectionMessage) => unknown): Promise<() => void>;
|
|
85
85
|
export declare const close_connection_command = "close_connection";
|
|
86
|
-
export
|
|
87
|
-
export
|
|
88
|
-
export
|
|
86
|
+
export type close_connection_command = typeof close_connection_command;
|
|
87
|
+
export type TCloseConnectionBroadCast = Record<string, never>;
|
|
88
|
+
export type WsCloseConnectionMessage = GetMessageType<chia_farmer_service, close_connection_command, TCloseConnectionBroadCast>;
|
|
89
89
|
export declare function on_close_connection(daemon: TDaemon, callback: (e: WsCloseConnectionMessage) => unknown): Promise<() => void>;
|
|
90
|
-
export
|
|
91
|
-
export
|
|
92
|
-
export
|
|
90
|
+
export type WsFarmerMessage = WsGetConnectionFarmerMessage | WsNewFarmingInfoMessage | WsNewSignagePointMessage | WsHarvesterUpdateMessage | WsHarvesterRemovedMessage | WsProofMessage | WsSubmittedPartialMessage | WsFailedPartialMessage | WsAddConnectionMessage | WsCloseConnectionMessage;
|
|
91
|
+
export type chia_farmer_commands = get_connections_command | new_farming_info_command | new_signage_point_command | harvester_update_command | harvester_removed_command | proof_command | submitted_partial_command | add_connection_command | close_connection_command;
|
|
92
|
+
export type TChiaFarmerBroadcast = TGetConnectionsBroadCast | TNewFarmingInfoBroadCast | TNewSignagePointBroadCast | THarvesterUpdateBroadCast | THarvesterRemovedBroadCast | TProofBroadCast | TSubmittedPartialBroadCast | TAddConnectionBroadCast | TCloseConnectionBroadCast;
|
|
93
93
|
export declare function on_message_from_farmer(daemon: TDaemon, callback: (e: WsFarmerMessage) => unknown): Promise<() => void>;
|
|
@@ -5,9 +5,10 @@ import { GetMessageType, TConnectionGeneral } from "../../types";
|
|
|
5
5
|
import { bytes32 } from "../../chia/types/blockchain_format/sized_bytes";
|
|
6
6
|
import { NewSignagePoint } from "../../chia/protocols/farmer_protocol";
|
|
7
7
|
import { ReceiveBlockResult } from "../../chia/consensus/blockchain";
|
|
8
|
+
import { UnfinishedBlock } from "../../chia/types/unfinished_block";
|
|
8
9
|
export declare const chia_full_node_service = "chia_full_node";
|
|
9
|
-
export
|
|
10
|
-
export
|
|
10
|
+
export type chia_full_node_service = typeof chia_full_node_service;
|
|
11
|
+
export type TConnectionFullNode = ({
|
|
11
12
|
peak_height: uint32;
|
|
12
13
|
peak_weight: uint128;
|
|
13
14
|
peak_hash: bytes32;
|
|
@@ -17,15 +18,15 @@ export declare type TConnectionFullNode = ({
|
|
|
17
18
|
peak_hash: None;
|
|
18
19
|
}) & TConnectionGeneral;
|
|
19
20
|
export declare const get_connections_command = "get_connections";
|
|
20
|
-
export
|
|
21
|
-
export
|
|
21
|
+
export type get_connections_command = typeof get_connections_command;
|
|
22
|
+
export type TGetConnectionsBroadCast = {
|
|
22
23
|
connections: TConnectionFullNode[];
|
|
23
24
|
};
|
|
24
|
-
export
|
|
25
|
+
export type WsGetConnectionFullNodeMessage = GetMessageType<chia_full_node_service, get_connections_command, TGetConnectionsBroadCast>;
|
|
25
26
|
export declare function on_get_connections(daemon: TDaemon, callback: (e: WsGetConnectionFullNodeMessage) => unknown): Promise<() => void>;
|
|
26
27
|
export declare const get_blockchain_state_command = "get_blockchain_state";
|
|
27
|
-
export
|
|
28
|
-
export
|
|
28
|
+
export type get_blockchain_state_command = typeof get_blockchain_state_command;
|
|
29
|
+
export type TGetBlockchainStateBroadCast = {
|
|
29
30
|
blockchain_state: {
|
|
30
31
|
peak: BlockRecord;
|
|
31
32
|
genesis_challenge_initialized: bool;
|
|
@@ -48,11 +49,11 @@ export declare type TGetBlockchainStateBroadCast = {
|
|
|
48
49
|
"node_id": str;
|
|
49
50
|
};
|
|
50
51
|
};
|
|
51
|
-
export
|
|
52
|
+
export type WsGetBlockchainStateMessage = GetMessageType<chia_full_node_service, get_blockchain_state_command, TGetBlockchainStateBroadCast>;
|
|
52
53
|
export declare function on_get_blockchain_state(daemon: TDaemon, callback: (e: WsGetBlockchainStateMessage) => unknown): Promise<() => void>;
|
|
53
54
|
export declare const block_command = "block";
|
|
54
|
-
export
|
|
55
|
-
export
|
|
55
|
+
export type block_command = typeof block_command;
|
|
56
|
+
export type TBlockBroadCast = Record<string, never> | {
|
|
56
57
|
transaction_block: bool;
|
|
57
58
|
k_size: uint8;
|
|
58
59
|
header_hash: bytes32;
|
|
@@ -64,16 +65,26 @@ export declare type TBlockBroadCast = {} | {
|
|
|
64
65
|
transaction_generator_ref_list: uint32[];
|
|
65
66
|
receive_block_result?: ReceiveBlockResult;
|
|
66
67
|
};
|
|
67
|
-
export
|
|
68
|
+
export type WsBlockMessage = GetMessageType<chia_full_node_service, block_command, TBlockBroadCast>;
|
|
68
69
|
export declare function on_block(daemon: TDaemon, callback: (e: WsBlockMessage) => unknown): Promise<() => void>;
|
|
69
70
|
export declare const signage_point_command = "signage_point";
|
|
70
|
-
export
|
|
71
|
-
export
|
|
71
|
+
export type signage_point_command = typeof signage_point_command;
|
|
72
|
+
export type TSignagePointBroadCast = {
|
|
72
73
|
broadcast_farmer: NewSignagePoint;
|
|
73
74
|
};
|
|
74
|
-
export
|
|
75
|
+
export type WsSignagePointMessage = GetMessageType<chia_full_node_service, signage_point_command, TSignagePointBroadCast>;
|
|
75
76
|
export declare function on_signage_point(daemon: TDaemon, callback: (e: WsSignagePointMessage) => unknown): Promise<() => void>;
|
|
76
|
-
export declare
|
|
77
|
-
export
|
|
78
|
-
export
|
|
77
|
+
export declare const unfinished_block_command = "unfinished_block";
|
|
78
|
+
export type unfinished_block_command = typeof unfinished_block_command;
|
|
79
|
+
export type TUnfinishedBlockBroadCast = {
|
|
80
|
+
block_duration_in_seconds: float;
|
|
81
|
+
validation_time_in_seconds: float;
|
|
82
|
+
pre_validation_time_in_seconds: float | None;
|
|
83
|
+
unfinished_block: UnfinishedBlock;
|
|
84
|
+
};
|
|
85
|
+
export type WsUnfinishedBlockMessage = GetMessageType<chia_full_node_service, unfinished_block_command, TUnfinishedBlockBroadCast>;
|
|
86
|
+
export declare function on_unfinished_block(daemon: TDaemon, callback: (e: WsUnfinishedBlockMessage) => unknown): Promise<() => void>;
|
|
87
|
+
export type WsFullNodeMessage = WsGetConnectionFullNodeMessage | WsGetBlockchainStateMessage | WsBlockMessage | WsSignagePointMessage | WsUnfinishedBlockMessage;
|
|
88
|
+
export type chia_full_node_commands = get_blockchain_state_command | get_connections_command | block_command | signage_point_command | unfinished_block_command;
|
|
89
|
+
export type TChiaFullNodeBroadcast = TGetBlockchainStateBroadCast | TGetConnectionsBroadCast | TBlockBroadCast | TSignagePointBroadCast | TUnfinishedBlockBroadCast;
|
|
79
90
|
export declare function on_message_from_full_node(daemon: TDaemon, callback: (e: WsFullNodeMessage) => unknown): Promise<() => void>;
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.on_message_from_full_node = exports.on_signage_point = exports.signage_point_command = exports.on_block = exports.block_command = exports.on_get_blockchain_state = exports.get_blockchain_state_command = exports.on_get_connections = exports.get_connections_command = exports.chia_full_node_service = void 0;
|
|
12
|
+
exports.on_message_from_full_node = exports.on_unfinished_block = exports.unfinished_block_command = exports.on_signage_point = exports.signage_point_command = exports.on_block = exports.block_command = exports.on_get_blockchain_state = exports.get_blockchain_state_command = exports.on_get_connections = exports.get_connections_command = exports.chia_full_node_service = void 0;
|
|
13
13
|
const types_1 = require("../../types");
|
|
14
14
|
exports.chia_full_node_service = "chia_full_node";
|
|
15
15
|
exports.get_connections_command = "get_connections";
|
|
@@ -64,6 +64,19 @@ function on_signage_point(daemon, callback) {
|
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
exports.on_signage_point = on_signage_point;
|
|
67
|
+
exports.unfinished_block_command = "unfinished_block";
|
|
68
|
+
function on_unfinished_block(daemon, callback) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
yield daemon.subscribe(types_1.unfinished_block_info_service);
|
|
71
|
+
const messageListener = (e) => {
|
|
72
|
+
if (e.origin === exports.chia_full_node_service && e.command === exports.unfinished_block_command) {
|
|
73
|
+
callback(e);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
return daemon.addMessageListener(exports.chia_full_node_service, messageListener);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
exports.on_unfinished_block = on_unfinished_block;
|
|
67
80
|
function on_message_from_full_node(daemon, callback) {
|
|
68
81
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69
82
|
yield daemon.subscribe(types_1.wallet_ui_service);
|
|
@@ -3,45 +3,45 @@ import { TDaemon } from "../../../daemon/index";
|
|
|
3
3
|
import { GetMessageType, TConnectionGeneral } from "../../types";
|
|
4
4
|
import { float, int, None, str } from "../../chia/types/_python_types_";
|
|
5
5
|
export declare const chia_harvester_service = "chia_harvester";
|
|
6
|
-
export
|
|
6
|
+
export type chia_harvester_service = typeof chia_harvester_service;
|
|
7
7
|
export declare const get_connections_command = "get_connections";
|
|
8
|
-
export
|
|
9
|
-
export
|
|
8
|
+
export type get_connections_command = typeof get_connections_command;
|
|
9
|
+
export type TGetConnectionsBroadCast = {
|
|
10
10
|
connections: TConnectionGeneral[];
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type WsGetConnectionsHarvesterMessage = GetMessageType<chia_harvester_service, get_connections_command, TGetConnectionsBroadCast>;
|
|
13
13
|
export declare function on_get_connections(daemon: TDaemon, callback: (e: WsGetConnectionsHarvesterMessage) => unknown): Promise<() => void>;
|
|
14
14
|
export declare const get_plots_command = "get_plots";
|
|
15
|
-
export
|
|
16
|
-
export
|
|
15
|
+
export type get_plots_command = typeof get_plots_command;
|
|
16
|
+
export type TGetPlotsBroadCast = {
|
|
17
17
|
plots: Plot[];
|
|
18
18
|
failed_to_open_filenames: string[];
|
|
19
19
|
not_found_filenames: string[];
|
|
20
20
|
};
|
|
21
|
-
export
|
|
21
|
+
export type WsGetPlotsMessage = GetMessageType<chia_harvester_service, get_plots_command, TGetPlotsBroadCast>;
|
|
22
22
|
export declare function on_get_plots(daemon: TDaemon, callback: (e: WsGetPlotsMessage) => unknown): Promise<() => void>;
|
|
23
23
|
export declare const farming_info_command = "farming_info";
|
|
24
|
-
export
|
|
25
|
-
export
|
|
24
|
+
export type farming_info_command = typeof farming_info_command;
|
|
25
|
+
export type TFarmingInfoBroadCast = {
|
|
26
26
|
challenge_hash: str;
|
|
27
27
|
total_plots: int;
|
|
28
28
|
found_proofs: int;
|
|
29
29
|
eligible_plots: int;
|
|
30
30
|
time: float;
|
|
31
31
|
};
|
|
32
|
-
export
|
|
32
|
+
export type WsFarmingInfoMessage = GetMessageType<chia_harvester_service, farming_info_command, TFarmingInfoBroadCast>;
|
|
33
33
|
export declare function on_farming_info(daemon: TDaemon, callback: (e: GetMessageType<chia_harvester_service, farming_info_command, TFarmingInfoBroadCast>) => unknown): Promise<() => void>;
|
|
34
34
|
export declare const add_connection_command = "add_connection";
|
|
35
|
-
export
|
|
36
|
-
export
|
|
37
|
-
export
|
|
35
|
+
export type add_connection_command = typeof add_connection_command;
|
|
36
|
+
export type TAddConnectionBroadCast = None;
|
|
37
|
+
export type WsAddConnectionMessage = GetMessageType<chia_harvester_service, add_connection_command, TAddConnectionBroadCast>;
|
|
38
38
|
export declare function on_add_connection(daemon: TDaemon, callback: (e: GetMessageType<chia_harvester_service, add_connection_command, TAddConnectionBroadCast>) => unknown): Promise<() => void>;
|
|
39
39
|
export declare const close_connection_command = "close_connection";
|
|
40
|
-
export
|
|
41
|
-
export
|
|
42
|
-
export
|
|
40
|
+
export type close_connection_command = typeof close_connection_command;
|
|
41
|
+
export type TCloseConnectionBroadCast = None;
|
|
42
|
+
export type WsCloseConnectionMessage = GetMessageType<chia_harvester_service, close_connection_command, TCloseConnectionBroadCast>;
|
|
43
43
|
export declare function on_close_connection(daemon: TDaemon, callback: (e: GetMessageType<chia_harvester_service, close_connection_command, TCloseConnectionBroadCast>) => unknown): Promise<() => void>;
|
|
44
|
-
export
|
|
45
|
-
export
|
|
46
|
-
export
|
|
44
|
+
export type WsHarvesterMessage = WsGetConnectionsHarvesterMessage | WsGetPlotsMessage | WsFarmingInfoMessage | WsAddConnectionMessage | WsCloseConnectionMessage;
|
|
45
|
+
export type chia_harvester_commands = get_plots_command | farming_info_command | add_connection_command | close_connection_command | get_connections_command;
|
|
46
|
+
export type TChiaHarvesterBroadcast = TGetPlotsBroadCast | TFarmingInfoBroadCast | TAddConnectionBroadCast | TCloseConnectionBroadCast | TGetConnectionsBroadCast;
|
|
47
47
|
export declare function on_message_from_harvester(daemon: TDaemon, callback: (e: WsHarvesterMessage) => unknown): Promise<() => void>;
|
package/api/ws/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { WsFarmerMessage } from "./farmer/index";
|
|
2
2
|
export { chia_farmer_service, TChiaFarmerBroadcast, TGetConnectionsBroadCast as TGetConnectionsFarmerBroadCast, TNewSignagePointBroadCast, TNewFarmingInfoBroadCast, THarvesterUpdateBroadCast, THarvesterRemovedBroadCast, TProofBroadCast, TSubmittedPartialBroadCast, TFailedPartialBroadCast, TAddConnectionBroadCast, TCloseConnectionBroadCast, on_message_from_farmer, on_get_connections as on_get_connections_farmer, on_new_farming_info, on_new_signage_point, on_harvester_update, on_harvester_removed, on_proof, on_submitted_partial, on_failed_partial, on_add_connection, on_close_connection, } from "./farmer/index";
|
|
3
3
|
import type { WsFullNodeMessage } from "./full_node/index";
|
|
4
|
-
export { chia_full_node_service, TChiaFullNodeBroadcast, TGetConnectionsBroadCast as TGetConnectionsFullNodeBroadCast, TGetBlockchainStateBroadCast, TBlockBroadCast, TSignagePointBroadCast, on_message_from_full_node, on_get_connections as on_get_connections_full_node, on_get_blockchain_state, on_block, on_signage_point, } from "./full_node/index";
|
|
4
|
+
export { chia_full_node_service, TChiaFullNodeBroadcast, TGetConnectionsBroadCast as TGetConnectionsFullNodeBroadCast, TGetBlockchainStateBroadCast, TBlockBroadCast, TSignagePointBroadCast, TUnfinishedBlockBroadCast, on_message_from_full_node, on_get_connections as on_get_connections_full_node, on_get_blockchain_state, on_block, on_signage_point, on_unfinished_block, } from "./full_node/index";
|
|
5
5
|
import type { WsHarvesterMessage } from "./harvester/index";
|
|
6
6
|
export { chia_harvester_service, TGetConnectionsBroadCast as TGetConnectionsHarvesterBroadCast, TChiaHarvesterBroadcast, TGetPlotsBroadCast, TFarmingInfoBroadCast, TAddConnectionBroadCast as TAddConnectionHarvesterBroadCast, TCloseConnectionBroadCast as TCloseConnectionHarvesterBroadCast, on_message_from_harvester, on_get_connections as on_get_connections_harvester, on_get_plots, on_farming_info, on_add_connection as on_add_connection_harvester, on_close_connection as on_close_connection_harvester, } from "./harvester/index";
|
|
7
7
|
import type { WsWalletMessage } from "./wallet/index";
|
|
@@ -13,5 +13,5 @@ export { chia_crawler_service, TLoadedInitialPeersBroadCast, TCrawlBatchComplete
|
|
|
13
13
|
import type { WsTimelordMessage } from "./timelord/index";
|
|
14
14
|
export { chia_timelord_service, TFinishedPotBroadCast, TNewCompactProofBroadCast, TSkippingPeakBroadCast, TNewPeakBroadCast, on_finished_pot, on_new_compact_proof, on_skipping_peak, on_new_peak, } from "./timelord/index";
|
|
15
15
|
import type { WsDaemonMessage } from "./daemon/index";
|
|
16
|
-
export { daemon_service, register_service, TRegisterServiceRequest, TRegisterServiceResponse, start_service, TStartServiceRequest, TStartServiceResponse, start_plotting, TStartPlottingResponse, TStartPlottingRequest, stop_service, TStopServiceResponse, TStopServiceRequest, stop_plotting, TStopPlottingRequest, TStopPlottingResponse, exit,
|
|
17
|
-
export
|
|
16
|
+
export { daemon_service, register_service, TRegisterServiceRequest, TRegisterServiceResponse, start_service, TStartServiceRequest, TStartServiceResponse, start_plotting, TStartPlottingResponse, TStartPlottingRequest, stop_service, TStopServiceResponse, TStopServiceRequest, stop_plotting, TStopPlottingRequest, TStopPlottingResponse, exit, TExitResponse, get_status, TGetStatusResponse, get_version, TGetVersionResponse, get_plotters, TGetPlottersResponse, running_services, TRunningServicesResponse, is_running, TIsRunningRequest, TIsRunningResponse, add_private_key, TAddPrivateKeyRequest, TAddPrivateKeyResponse, add_key, TAddKeyRequest, TAddKeyResponse, check_keys, TCheckKeysRequest, TCheckKeysResponse, delete_all_keys, TDeleteAllKeysRequest, TDeleteAllKeysResponse, delete_key_by_fingerprint, TDeleteKeyByFingerprintRequest, TDeleteKeyByFingerprintResponse, get_all_private_keys, TGetAllPrivateKeysRequest, TGetAllPrivateKeysResponse, get_first_private_key, TGetFirstPrivateKeyRequest, TGetFirstPrivateKeyResponse, get_key_for_fingerprint, TGetKeyForFingerprintRequest, TGetKeyForFingerprintResponse, get_key, TGetKeyRequest, TGetKeyResponse, get_keys, TGetKeysRequest, TGetKeysResponse, get_public_key, TGetPublicKeyRequest, TGetPublicKeyResponse, get_public_keys, TGetPublicKeysRequest, TGetPublicKeysResponse, set_label, TSetLabelRequest, TSetLabelResponse, delete_label, TDeleteLabelRequest, TDeleteLabelResponse, is_keyring_locked, TIsKeyringLockedResponse, on_keyring_status_changed, TKeyringStatusChangedBroadCast, keyring_status, TKeyringStatusResponse, unlock_keyring, TUnlockKeyringRequest, TUnlockKeyringResponse, migrate_keyring, TMigrateKeyringRequest, TMigrateKeyringResponse, set_keyring_passphrase, TSetKeyringPassphraseRequest, TSetKeyringPassphraseResponse, remove_keyring_passphrase, TRemoveKeyringPassphraseRequest, TRemoveKeyringPassphraseResponse, notify_keyring_migration_completed, TNotifyKeyringMigrationCompletedRequest, TNotifyKeyringMigrationCompletedResponse, ping, TPingRequest, TPingResponse, validate_keyring_passphrase, TValidateKeyringPassphraseRequest, TValidateKeyringPassphraseResponse, TPlotQueue, get_routes, TGetRoutesResponse, get_wallet_addresses, TGetWalletAddressesRequest, TGetWalletAddressesResponse, get_keys_for_plotting, TGetKeysForPlottingRequest, TGetKeysForPlottingResponse, get_network_info, TGetNetworkInfoResponse, } from "./daemon/index";
|
|
17
|
+
export type WsMessage = WsFarmerMessage | WsFullNodeMessage | WsHarvesterMessage | WsWalletMessage | WsPlotsMessage | WsCrawlerMessage | WsTimelordMessage | WsDaemonMessage;
|
package/api/ws/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.get_keys_for_plotting = exports.get_wallet_addresses = exports.get_routes = exports.validate_keyring_passphrase = exports.ping = exports.notify_keyring_migration_completed = exports.remove_keyring_passphrase = exports.set_keyring_passphrase = exports.migrate_keyring = exports.unlock_keyring = exports.keyring_status = exports.on_keyring_status_changed = exports.is_keyring_locked = exports.delete_label = exports.set_label = exports.get_public_keys = exports.get_public_key = exports.get_keys = exports.get_key = exports.get_key_for_fingerprint = exports.get_first_private_key = exports.get_all_private_keys = exports.delete_key_by_fingerprint = exports.delete_all_keys = exports.check_keys = exports.add_private_key = exports.is_running = exports.running_services = exports.get_plotters = exports.get_version = exports.get_status = exports.exit = void 0;
|
|
3
|
+
exports.stop_service = exports.start_plotting = exports.start_service = exports.register_service = exports.daemon_service = exports.on_new_peak = exports.on_skipping_peak = exports.on_new_compact_proof = exports.on_finished_pot = exports.chia_timelord_service = exports.on_crawl_batch_completed = exports.on_loaded_initial_peers = exports.chia_crawler_service = exports.on_state_changed_of_plots = exports.state_changed_command_of_plots = exports.chia_plotter_service = exports.on_message_from_wallet = exports.on_close_connection_wallet = exports.on_add_connection_wallet = exports.on_coin_added = exports.on_state_changed_of_wallet = exports.on_sync_changed = exports.on_get_connections_wallet = exports.chia_wallet_service = exports.on_close_connection_harvester = exports.on_add_connection_harvester = exports.on_farming_info = exports.on_get_plots = exports.on_get_connections_harvester = exports.on_message_from_harvester = exports.chia_harvester_service = exports.on_unfinished_block = exports.on_signage_point = exports.on_block = exports.on_get_blockchain_state = exports.on_get_connections_full_node = exports.on_message_from_full_node = exports.chia_full_node_service = exports.on_close_connection = exports.on_add_connection = exports.on_failed_partial = exports.on_submitted_partial = exports.on_proof = exports.on_harvester_removed = exports.on_harvester_update = exports.on_new_signage_point = exports.on_new_farming_info = exports.on_get_connections_farmer = exports.on_message_from_farmer = exports.chia_farmer_service = void 0;
|
|
4
|
+
exports.get_network_info = exports.get_keys_for_plotting = exports.get_wallet_addresses = exports.get_routes = exports.validate_keyring_passphrase = exports.ping = exports.notify_keyring_migration_completed = exports.remove_keyring_passphrase = exports.set_keyring_passphrase = exports.migrate_keyring = exports.unlock_keyring = exports.keyring_status = exports.on_keyring_status_changed = exports.is_keyring_locked = exports.delete_label = exports.set_label = exports.get_public_keys = exports.get_public_key = exports.get_keys = exports.get_key = exports.get_key_for_fingerprint = exports.get_first_private_key = exports.get_all_private_keys = exports.delete_key_by_fingerprint = exports.delete_all_keys = exports.check_keys = exports.add_key = exports.add_private_key = exports.is_running = exports.running_services = exports.get_plotters = exports.get_version = exports.get_status = exports.exit = exports.stop_plotting = void 0;
|
|
5
5
|
var index_1 = require("./farmer/index");
|
|
6
6
|
Object.defineProperty(exports, "chia_farmer_service", { enumerable: true, get: function () { return index_1.chia_farmer_service; } });
|
|
7
7
|
Object.defineProperty(exports, "on_message_from_farmer", { enumerable: true, get: function () { return index_1.on_message_from_farmer; } });
|
|
@@ -22,6 +22,7 @@ Object.defineProperty(exports, "on_get_connections_full_node", { enumerable: tru
|
|
|
22
22
|
Object.defineProperty(exports, "on_get_blockchain_state", { enumerable: true, get: function () { return index_2.on_get_blockchain_state; } });
|
|
23
23
|
Object.defineProperty(exports, "on_block", { enumerable: true, get: function () { return index_2.on_block; } });
|
|
24
24
|
Object.defineProperty(exports, "on_signage_point", { enumerable: true, get: function () { return index_2.on_signage_point; } });
|
|
25
|
+
Object.defineProperty(exports, "on_unfinished_block", { enumerable: true, get: function () { return index_2.on_unfinished_block; } });
|
|
25
26
|
var index_3 = require("./harvester/index");
|
|
26
27
|
Object.defineProperty(exports, "chia_harvester_service", { enumerable: true, get: function () { return index_3.chia_harvester_service; } });
|
|
27
28
|
Object.defineProperty(exports, "on_message_from_harvester", { enumerable: true, get: function () { return index_3.on_message_from_harvester; } });
|
|
@@ -67,6 +68,7 @@ Object.defineProperty(exports, "get_plotters", { enumerable: true, get: function
|
|
|
67
68
|
Object.defineProperty(exports, "running_services", { enumerable: true, get: function () { return index_8.running_services; } });
|
|
68
69
|
Object.defineProperty(exports, "is_running", { enumerable: true, get: function () { return index_8.is_running; } });
|
|
69
70
|
Object.defineProperty(exports, "add_private_key", { enumerable: true, get: function () { return index_8.add_private_key; } });
|
|
71
|
+
Object.defineProperty(exports, "add_key", { enumerable: true, get: function () { return index_8.add_key; } });
|
|
70
72
|
Object.defineProperty(exports, "check_keys", { enumerable: true, get: function () { return index_8.check_keys; } });
|
|
71
73
|
Object.defineProperty(exports, "delete_all_keys", { enumerable: true, get: function () { return index_8.delete_all_keys; } });
|
|
72
74
|
Object.defineProperty(exports, "delete_key_by_fingerprint", { enumerable: true, get: function () { return index_8.delete_key_by_fingerprint; } });
|
|
@@ -92,3 +94,4 @@ Object.defineProperty(exports, "validate_keyring_passphrase", { enumerable: true
|
|
|
92
94
|
Object.defineProperty(exports, "get_routes", { enumerable: true, get: function () { return index_8.get_routes; } });
|
|
93
95
|
Object.defineProperty(exports, "get_wallet_addresses", { enumerable: true, get: function () { return index_8.get_wallet_addresses; } });
|
|
94
96
|
Object.defineProperty(exports, "get_keys_for_plotting", { enumerable: true, get: function () { return index_8.get_keys_for_plotting; } });
|
|
97
|
+
Object.defineProperty(exports, "get_network_info", { enumerable: true, get: function () { return index_8.get_network_info; } });
|
|
@@ -5,39 +5,39 @@ import { Chain } from "../../chia/timelord/types";
|
|
|
5
5
|
import { VDFInfo, VDFProof } from "../../chia/types/blockchain_format/vdf";
|
|
6
6
|
import { bytes32 } from "../../chia/types/blockchain_format/sized_bytes";
|
|
7
7
|
export declare const chia_timelord_service = "chia_timelord";
|
|
8
|
-
export
|
|
8
|
+
export type chia_timelord_service = typeof chia_timelord_service;
|
|
9
9
|
export declare const finished_pot_command = "finished_pot";
|
|
10
|
-
export
|
|
11
|
-
export
|
|
10
|
+
export type finished_pot_command = typeof finished_pot_command;
|
|
11
|
+
export type TFinishedPotBroadCast = {
|
|
12
12
|
estimated_ips: float;
|
|
13
13
|
iterations_needed: uint64;
|
|
14
14
|
chain: Chain;
|
|
15
15
|
vdf_info: VDFInfo;
|
|
16
16
|
vdf_proof: VDFProof;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export type WsFinishedPlotMessage = GetMessageType<chia_timelord_service, finished_pot_command, TFinishedPotBroadCast>;
|
|
19
19
|
export declare function on_finished_pot(daemon: TDaemon, callback: (e: WsFinishedPlotMessage) => unknown): Promise<() => void>;
|
|
20
20
|
export declare const new_compact_proof_command = "new_compact_proof";
|
|
21
|
-
export
|
|
22
|
-
export
|
|
21
|
+
export type new_compact_proof_command = typeof new_compact_proof_command;
|
|
22
|
+
export type TNewCompactProofBroadCast = {
|
|
23
23
|
header_hash: bytes32;
|
|
24
24
|
height: uint32;
|
|
25
25
|
field_vdf: uint8;
|
|
26
26
|
};
|
|
27
|
-
export
|
|
27
|
+
export type WsNewCompactProofMessage = GetMessageType<chia_timelord_service, new_compact_proof_command, TNewCompactProofBroadCast>;
|
|
28
28
|
export declare function on_new_compact_proof(daemon: TDaemon, callback: (e: WsNewCompactProofMessage) => unknown): Promise<() => void>;
|
|
29
29
|
export declare const skipping_peak_command = "skipping_peak";
|
|
30
|
-
export
|
|
31
|
-
export
|
|
30
|
+
export type skipping_peak_command = typeof skipping_peak_command;
|
|
31
|
+
export type TSkippingPeakBroadCast = {
|
|
32
32
|
height: uint32;
|
|
33
33
|
};
|
|
34
|
-
export
|
|
34
|
+
export type WsSkippingPeakMessage = GetMessageType<chia_timelord_service, skipping_peak_command, TSkippingPeakBroadCast>;
|
|
35
35
|
export declare function on_skipping_peak(daemon: TDaemon, callback: (e: WsSkippingPeakMessage) => unknown): Promise<() => void>;
|
|
36
36
|
export declare const new_peak_command = "new_peak";
|
|
37
|
-
export
|
|
38
|
-
export
|
|
37
|
+
export type new_peak_command = typeof new_peak_command;
|
|
38
|
+
export type TNewPeakBroadCast = {
|
|
39
39
|
height: uint32;
|
|
40
40
|
};
|
|
41
|
-
export
|
|
41
|
+
export type WsNewPeakMessage = GetMessageType<chia_timelord_service, new_peak_command, TNewPeakBroadCast>;
|
|
42
42
|
export declare function on_new_peak(daemon: TDaemon, callback: (e: WsNewPeakMessage) => unknown): Promise<() => void>;
|
|
43
|
-
export
|
|
43
|
+
export type WsTimelordMessage = WsFinishedPlotMessage | WsNewCompactProofMessage | WsSkippingPeakMessage | WsNewPeakMessage;
|
package/api/ws/wallet/index.d.ts
CHANGED
|
@@ -3,17 +3,17 @@ import { GetMessageType, TConnectionGeneral } from "../../types";
|
|
|
3
3
|
import { int, str, uint32 } from "../../chia/types/_python_types_";
|
|
4
4
|
import { TransactionRecord } from "../../chia/wallet/transaction_record";
|
|
5
5
|
export declare const chia_wallet_service = "chia_wallet";
|
|
6
|
-
export
|
|
6
|
+
export type chia_wallet_service = typeof chia_wallet_service;
|
|
7
7
|
export declare const get_connections_command = "get_connections";
|
|
8
|
-
export
|
|
9
|
-
export
|
|
8
|
+
export type get_connections_command = typeof get_connections_command;
|
|
9
|
+
export type TGetConnectionsBroadCast = {
|
|
10
10
|
connections: TConnectionGeneral[];
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type WsGetConnectionsWalletMessage = GetMessageType<chia_wallet_service, get_connections_command, TGetConnectionsBroadCast>;
|
|
13
13
|
export declare function on_get_connections(daemon: TDaemon, callback: (e: WsGetConnectionsWalletMessage) => unknown): Promise<() => void>;
|
|
14
14
|
export declare const state_changed_command_of_wallet = "state_changed";
|
|
15
|
-
export
|
|
16
|
-
export
|
|
15
|
+
export type state_changed_command_of_wallet = typeof state_changed_command_of_wallet;
|
|
16
|
+
export type TStateChangedBroadCastOfWallet = {
|
|
17
17
|
state: "add_connection" | "new_block" | "wallet_created" | "added_stray_cat" | "offer_added" | "offer_cancelled" | "new_on_chain_notification";
|
|
18
18
|
} | {
|
|
19
19
|
state: "coin_removed" | "coin_added" | "pending_transaction" | "did_coin_added" | "nft_coin_added" | "nft_coin_removed" | "nft_coin_updated" | "nft_coin_did_set" | "wallet_removed";
|
|
@@ -34,36 +34,36 @@ export declare type TStateChangedBroadCastOfWallet = {
|
|
|
34
34
|
index: uint32;
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
export
|
|
37
|
+
export type WsStateChangedWalletMessage = GetMessageType<chia_wallet_service, state_changed_command_of_wallet, TStateChangedBroadCastOfWallet>;
|
|
38
38
|
export declare function on_state_changed_of_wallet(daemon: TDaemon, callback: (e: WsStateChangedWalletMessage) => unknown): Promise<() => void>;
|
|
39
39
|
export declare const sync_changed_command = "sync_changed";
|
|
40
|
-
export
|
|
41
|
-
export
|
|
42
|
-
export
|
|
40
|
+
export type sync_changed_command = typeof sync_changed_command;
|
|
41
|
+
export type TSyncChangedBroadCast = Record<string, never>;
|
|
42
|
+
export type WsSyncChangedWalletMessage = GetMessageType<chia_wallet_service, sync_changed_command, TSyncChangedBroadCast>;
|
|
43
43
|
export declare function on_sync_changed(daemon: TDaemon, callback: (e: WsSyncChangedWalletMessage) => unknown): Promise<() => void>;
|
|
44
44
|
export declare const coin_added_command = "coin_added";
|
|
45
|
-
export
|
|
46
|
-
export
|
|
45
|
+
export type coin_added_command = typeof coin_added_command;
|
|
46
|
+
export type TCoinAddedBroadCast = {
|
|
47
47
|
state: "coin_added";
|
|
48
48
|
wallet_id: uint32;
|
|
49
49
|
};
|
|
50
|
-
export
|
|
50
|
+
export type WsCoinAddedMessage = GetMessageType<chia_wallet_service, coin_added_command, TCoinAddedBroadCast>;
|
|
51
51
|
export declare function on_coin_added(daemon: TDaemon, callback: (e: WsCoinAddedMessage) => unknown): Promise<() => void>;
|
|
52
52
|
export declare const add_connection_command = "add_connection";
|
|
53
|
-
export
|
|
54
|
-
export
|
|
53
|
+
export type add_connection_command = typeof add_connection_command;
|
|
54
|
+
export type TAddConnectionBroadCast = {
|
|
55
55
|
state: "add_connection";
|
|
56
56
|
};
|
|
57
|
-
export
|
|
57
|
+
export type WsAddConnectionMessage = GetMessageType<chia_wallet_service, add_connection_command, TAddConnectionBroadCast>;
|
|
58
58
|
export declare function on_add_connection(daemon: TDaemon, callback: (e: WsAddConnectionMessage) => unknown): Promise<() => void>;
|
|
59
59
|
export declare const close_connection_command = "close_connection";
|
|
60
|
-
export
|
|
61
|
-
export
|
|
60
|
+
export type close_connection_command = typeof close_connection_command;
|
|
61
|
+
export type TCloseConnectionBroadCast = {
|
|
62
62
|
state: "close_connection";
|
|
63
63
|
};
|
|
64
|
-
export
|
|
64
|
+
export type WsCloseConnectionMessage = GetMessageType<chia_wallet_service, close_connection_command, TCloseConnectionBroadCast>;
|
|
65
65
|
export declare function on_close_connection(daemon: TDaemon, callback: (e: WsCloseConnectionMessage) => unknown): Promise<() => void>;
|
|
66
|
-
export
|
|
67
|
-
export
|
|
68
|
-
export
|
|
66
|
+
export type WsWalletMessage = WsGetConnectionsWalletMessage | WsSyncChangedWalletMessage | WsStateChangedWalletMessage | WsCoinAddedMessage | WsAddConnectionMessage | WsCloseConnectionMessage;
|
|
67
|
+
export type chia_wallet_commands = get_connections_command | sync_changed_command | state_changed_command_of_wallet | coin_added_command | add_connection_command | close_connection_command;
|
|
68
|
+
export type TChiaWalletBroadcast = TGetConnectionsBroadCast | TSyncChangedBroadCast | TStateChangedBroadCastOfWallet | TCoinAddedBroadCast | TAddConnectionBroadCast | TCloseConnectionBroadCast;
|
|
69
69
|
export declare function on_message_from_wallet(daemon: TDaemon, callback: (e: WsWalletMessage) => unknown): Promise<() => void>;
|
package/bin/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
const index_1 = require("../daemon/index");
|
|
14
14
|
const logger_1 = require("../logger");
|
|
15
15
|
const index_2 = require("../api/ws/farmer/index");
|
|
16
|
-
logger_1.setLogLevel("error");
|
|
16
|
+
(0, logger_1.setLogLevel)("error");
|
|
17
17
|
const exeCommand = "npx chia-agent";
|
|
18
18
|
const argv = process.argv.slice(2);
|
|
19
19
|
const usage = `Usage:
|
|
@@ -29,13 +29,13 @@ if (command === "farm") {
|
|
|
29
29
|
if (subCommand === "monitor") {
|
|
30
30
|
(function () {
|
|
31
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const daemon = index_1.getDaemon();
|
|
32
|
+
const daemon = (0, index_1.getDaemon)();
|
|
33
33
|
yield daemon.connect();
|
|
34
34
|
yield daemon.subscribe("wallet_ui");
|
|
35
35
|
let sumPassedFilter = 0;
|
|
36
36
|
let sumTotalPlot = 0;
|
|
37
37
|
let sumTotalProof = 0;
|
|
38
|
-
const unsubscribe = yield index_2.on_new_farming_info(daemon, (e) => {
|
|
38
|
+
const unsubscribe = yield (0, index_2.on_new_farming_info)(daemon, (e) => {
|
|
39
39
|
if (e.command === "new_farming_info") {
|
|
40
40
|
const { farming_info } = e.data;
|
|
41
41
|
const { challenge_hash, passed_filter, proofs, total_plots, timestamp } = farming_info;
|
package/config/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare const chiaRoot: string;
|
|
|
2
2
|
export declare const configPath: string;
|
|
3
3
|
export declare const logDir: string;
|
|
4
4
|
export declare const plotterDir: string;
|
|
5
|
-
export
|
|
5
|
+
export type TConfig = Record<string, string | number | Array<string | number> | null>;
|
|
6
6
|
/**
|
|
7
7
|
* Get parsed config object
|
|
8
8
|
*
|