chia-agent 3.0.1 → 4.0.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 +111 -0
- package/README.md +5 -9
- package/api/chia/consensus/blockchain.d.ts +1 -0
- package/api/chia/{wallet/util/backup_utils.js → consensus/blockchain.js} +0 -0
- package/api/chia/consensus/cost_calculator.d.ts +1 -1
- package/api/chia/pools/pool_config.d.ts +0 -1
- package/api/chia/server/outbound_message.d.ts +1 -0
- package/api/chia/{wallet/util/trade_utils.js → server/outbound_message.js} +0 -0
- package/api/chia/timelord/types.d.ts +1 -0
- package/api/chia/timelord/types.js +2 -0
- package/api/chia/types/coin_record.d.ts +3 -1
- package/api/chia/wallet/cat_wallet/cat_constants.d.ts +6 -0
- package/api/chia/wallet/cat_wallet/cat_constants.js +2 -0
- package/api/chia/wallet/trade_record.d.ts +23 -0
- package/api/chia/wallet/trade_record.js +1 -0
- package/api/chia/wallet/transaction_record.d.ts +7 -2
- package/api/chia/wallet/util/wallet_types.d.ts +1 -1
- package/api/chia/wallet/util/wallet_types.js +1 -1
- package/api/rpc/common/index.d.ts +40 -0
- package/api/rpc/common/index.js +48 -0
- package/api/rpc/crawler/index.d.ts +29 -0
- package/api/rpc/crawler/index.js +27 -0
- package/api/rpc/full_node/index.d.ts +24 -6
- package/api/rpc/full_node/index.js +8 -1
- package/api/rpc/index.d.ts +13 -7
- package/api/rpc/index.js +30 -12
- package/api/rpc/wallet/index.d.ts +172 -112
- package/api/rpc/wallet/index.js +82 -47
- package/api/types.d.ts +16 -0
- package/api/types.js +2 -1
- package/api/ws/crawler/index.d.ts +25 -0
- package/api/ws/crawler/index.js +40 -0
- package/api/ws/daemon/index.d.ts +8 -0
- package/api/ws/daemon/index.js +9 -2
- package/api/ws/farmer/index.d.ts +9 -3
- package/api/ws/farmer/index.js +15 -2
- package/api/ws/full_node/index.d.ts +50 -4
- package/api/ws/full_node/index.js +40 -1
- package/api/ws/harvester/index.d.ts +9 -3
- package/api/ws/harvester/index.js +14 -1
- package/api/ws/index.d.ts +22 -16
- package/api/ws/index.js +52 -32
- package/api/ws/timelord/index.d.ts +38 -0
- package/api/ws/timelord/index.js +66 -0
- package/api/ws/wallet/index.d.ts +32 -6
- package/api/ws/wallet/index.js +42 -3
- package/daemon/connection.d.ts +2 -2
- package/daemon/index.d.ts +6 -6
- package/index.d.ts +0 -2
- package/package.json +2 -2
- package/api/chia/wallet/util/backup_utils.d.ts +0 -25
- package/api/chia/wallet/util/trade_utils.d.ts +0 -11
package/api/rpc/wallet/index.js
CHANGED
|
@@ -9,9 +9,9 @@ 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.
|
|
14
|
-
exports.pw_status = exports.pw_status_command = exports.pw_absorb_rewards = exports.pw_absorb_rewards_command = exports.pw_self_pool = void 0;
|
|
12
|
+
exports.get_farmed_amount_command = exports.get_transaction_count = exports.get_transaction_count_command = exports.send_transaction_multi = exports.send_transaction_multi_command = exports.send_transaction = exports.send_transaction_command = exports.get_next_address = exports.get_next_address_command = exports.get_transactions = exports.get_transactions_command = exports.get_transaction = exports.get_transaction_command = exports.get_wallet_balance = exports.get_wallet_balance_command = exports.create_new_wallet = exports.create_new_wallet_command = exports.get_wallets = exports.get_wallets_command = exports.get_network_info_of_wallet = exports.get_network_info_command_of_wallet = exports.get_initial_freeze_period_of_wallet = exports.get_initial_freeze_period_command_of_wallet = exports.farm_block = exports.farm_block_command = exports.push_tx = exports.push_tx_command = exports.get_height_info = exports.get_height_info_command = exports.get_sync_status = exports.get_sync_status_command = exports.delete_all_keys = exports.delete_all_keys_command = exports.check_delete_key = exports.check_delete_key_command = exports.delete_key = exports.delete_key_command = exports.add_key = exports.add_key_command = exports.generate_mnemonic = exports.generate_mnemonic_command = exports.get_private_key = exports.get_private_key_command = exports.get_public_keys = exports.get_public_keys_command = exports.get_logged_in_fingerprint = exports.get_logged_in_fingerprint_command = exports.log_in = exports.log_in_command = exports.chia_wallet_service = void 0;
|
|
13
|
+
exports.did_create_backup_file_command = exports.did_get_information_needed_for_recovery = exports.did_get_information_needed_for_recovery_command = exports.did_create_attest = exports.did_create_attest_command = exports.did_get_recovery_list = exports.did_get_recovery_list_command = exports.did_recovery_spend = exports.did_recovery_spend_command = exports.did_get_did = exports.did_get_did_command = exports.did_get_pubkey = exports.did_get_pubkey_command = exports.did_spend = exports.did_spend_command = exports.did_update_recovery_ids = exports.did_update_recovery_ids_command = exports.get_cat_list = exports.get_cat_list_command = exports.cancel_offer = exports.cancel_offer_command = exports.get_offers_count = exports.get_offers_count_command = exports.get_all_offers = exports.get_all_offers_command = exports.get_offer = exports.get_offer_command = exports.take_offer = exports.take_offer_command = exports.check_offer_validity = exports.check_offer_validity_command = exports.get_offer_summary = exports.get_offer_summary_command = exports.create_offer_for_ids = exports.create_offer_for_ids_command = exports.cat_get_asset_id = exports.cat_get_asset_id_command = exports.cat_spend = exports.cat_spend_command = exports.cat_get_name = exports.cat_get_name_command = exports.cat_asset_id_to_name = exports.cat_asset_id_to_name_command = exports.cat_set_name = exports.cat_set_name_command = exports.delete_unconfirmed_transactions = exports.delete_unconfirmed_transactions_command = exports.create_signed_transaction = exports.create_signed_transaction_command = exports.get_farmed_amount = void 0;
|
|
14
|
+
exports.pw_status = exports.pw_status_command = exports.pw_absorb_rewards = exports.pw_absorb_rewards_command = exports.pw_self_pool = exports.pw_self_pool_command = exports.pw_join_pool = exports.pw_join_pool_command = exports.add_rate_limited_funds = exports.add_rate_limited_funds_command = exports.send_clawback_transaction = exports.send_clawback_transaction_command = exports.rl_set_user_info = exports.rl_set_user_info_command = exports.did_create_backup_file = void 0;
|
|
15
15
|
exports.chia_wallet_service = "chia_wallet";
|
|
16
16
|
// # Key management
|
|
17
17
|
exports.log_in_command = "log_in";
|
|
@@ -21,6 +21,13 @@ function log_in(agent, data) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
exports.log_in = log_in;
|
|
24
|
+
exports.get_logged_in_fingerprint_command = "get_logged_in_fingerprint";
|
|
25
|
+
function get_logged_in_fingerprint(agent) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
return agent.sendMessage(exports.chia_wallet_service, exports.get_logged_in_fingerprint_command);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
exports.get_logged_in_fingerprint = get_logged_in_fingerprint;
|
|
24
31
|
exports.get_public_keys_command = "get_public_keys";
|
|
25
32
|
function get_public_keys(agent) {
|
|
26
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -85,6 +92,13 @@ function get_height_info(agent) {
|
|
|
85
92
|
});
|
|
86
93
|
}
|
|
87
94
|
exports.get_height_info = get_height_info;
|
|
95
|
+
exports.push_tx_command = "push_tx";
|
|
96
|
+
function push_tx(agent, data) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
return agent.sendMessage(exports.chia_wallet_service, exports.push_tx_command, data);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
exports.push_tx = push_tx;
|
|
88
102
|
exports.farm_block_command = "farm_block";
|
|
89
103
|
function farm_block(agent, data) {
|
|
90
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -164,13 +178,6 @@ function send_transaction_multi(agent, data) {
|
|
|
164
178
|
});
|
|
165
179
|
}
|
|
166
180
|
exports.send_transaction_multi = send_transaction_multi;
|
|
167
|
-
exports.create_backup_command = "create_backup";
|
|
168
|
-
function create_backup(agent, data) {
|
|
169
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
-
return agent.sendMessage(exports.chia_wallet_service, exports.create_backup_command, data);
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
exports.create_backup = create_backup;
|
|
174
181
|
exports.get_transaction_count_command = "get_transaction_count";
|
|
175
182
|
function get_transaction_count(agent, data) {
|
|
176
183
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -199,35 +206,42 @@ function delete_unconfirmed_transactions(agent, data) {
|
|
|
199
206
|
});
|
|
200
207
|
}
|
|
201
208
|
exports.delete_unconfirmed_transactions = delete_unconfirmed_transactions;
|
|
202
|
-
// #
|
|
203
|
-
exports.
|
|
204
|
-
function
|
|
209
|
+
// # CATs and Trading
|
|
210
|
+
exports.cat_set_name_command = "cat_set_name";
|
|
211
|
+
function cat_set_name(agent, data) {
|
|
205
212
|
return __awaiter(this, void 0, void 0, function* () {
|
|
206
|
-
return agent.sendMessage(exports.chia_wallet_service, exports.
|
|
213
|
+
return agent.sendMessage(exports.chia_wallet_service, exports.cat_set_name_command, data);
|
|
207
214
|
});
|
|
208
215
|
}
|
|
209
|
-
exports.
|
|
210
|
-
exports.
|
|
211
|
-
function
|
|
216
|
+
exports.cat_set_name = cat_set_name;
|
|
217
|
+
exports.cat_asset_id_to_name_command = "cat_asset_id_to_name";
|
|
218
|
+
function cat_asset_id_to_name(agent, data) {
|
|
212
219
|
return __awaiter(this, void 0, void 0, function* () {
|
|
213
|
-
return agent.sendMessage(exports.chia_wallet_service, exports.
|
|
220
|
+
return agent.sendMessage(exports.chia_wallet_service, exports.cat_asset_id_to_name_command, data);
|
|
214
221
|
});
|
|
215
222
|
}
|
|
216
|
-
exports.
|
|
217
|
-
exports.
|
|
218
|
-
function
|
|
223
|
+
exports.cat_asset_id_to_name = cat_asset_id_to_name;
|
|
224
|
+
exports.cat_get_name_command = "cat_get_name";
|
|
225
|
+
function cat_get_name(agent, data) {
|
|
219
226
|
return __awaiter(this, void 0, void 0, function* () {
|
|
220
|
-
return agent.sendMessage(exports.chia_wallet_service, exports.
|
|
227
|
+
return agent.sendMessage(exports.chia_wallet_service, exports.cat_get_name_command, data);
|
|
221
228
|
});
|
|
222
229
|
}
|
|
223
|
-
exports.
|
|
224
|
-
exports.
|
|
225
|
-
function
|
|
230
|
+
exports.cat_get_name = cat_get_name;
|
|
231
|
+
exports.cat_spend_command = "cat_spend";
|
|
232
|
+
function cat_spend(agent, data) {
|
|
226
233
|
return __awaiter(this, void 0, void 0, function* () {
|
|
227
|
-
return agent.sendMessage(exports.chia_wallet_service, exports.
|
|
234
|
+
return agent.sendMessage(exports.chia_wallet_service, exports.cat_spend_command, data);
|
|
228
235
|
});
|
|
229
236
|
}
|
|
230
|
-
exports.
|
|
237
|
+
exports.cat_spend = cat_spend;
|
|
238
|
+
exports.cat_get_asset_id_command = "cat_get_asset_id";
|
|
239
|
+
function cat_get_asset_id(agent, data) {
|
|
240
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
241
|
+
return agent.sendMessage(exports.chia_wallet_service, exports.cat_get_asset_id_command, data);
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
exports.cat_get_asset_id = cat_get_asset_id;
|
|
231
245
|
exports.create_offer_for_ids_command = "create_offer_for_ids";
|
|
232
246
|
function create_offer_for_ids(agent, data) {
|
|
233
247
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -235,41 +249,62 @@ function create_offer_for_ids(agent, data) {
|
|
|
235
249
|
});
|
|
236
250
|
}
|
|
237
251
|
exports.create_offer_for_ids = create_offer_for_ids;
|
|
238
|
-
exports.
|
|
239
|
-
function
|
|
252
|
+
exports.get_offer_summary_command = "get_offer_summary";
|
|
253
|
+
function get_offer_summary(agent, data) {
|
|
254
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
255
|
+
return agent.sendMessage(exports.chia_wallet_service, exports.get_offer_summary_command, data);
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
exports.get_offer_summary = get_offer_summary;
|
|
259
|
+
exports.check_offer_validity_command = "check_offer_validity";
|
|
260
|
+
function check_offer_validity(agent, data) {
|
|
261
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
262
|
+
return agent.sendMessage(exports.chia_wallet_service, exports.check_offer_validity_command, data);
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
exports.check_offer_validity = check_offer_validity;
|
|
266
|
+
exports.take_offer_command = "take_offer";
|
|
267
|
+
function take_offer(agent, data) {
|
|
268
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
269
|
+
return agent.sendMessage(exports.chia_wallet_service, exports.take_offer_command, data);
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
exports.take_offer = take_offer;
|
|
273
|
+
exports.get_offer_command = "get_offer";
|
|
274
|
+
function get_offer(agent, data) {
|
|
240
275
|
return __awaiter(this, void 0, void 0, function* () {
|
|
241
|
-
return agent.sendMessage(exports.chia_wallet_service, exports.
|
|
276
|
+
return agent.sendMessage(exports.chia_wallet_service, exports.get_offer_command, data);
|
|
242
277
|
});
|
|
243
278
|
}
|
|
244
|
-
exports.
|
|
245
|
-
exports.
|
|
246
|
-
function
|
|
279
|
+
exports.get_offer = get_offer;
|
|
280
|
+
exports.get_all_offers_command = "get_all_offers";
|
|
281
|
+
function get_all_offers(agent, data) {
|
|
247
282
|
return __awaiter(this, void 0, void 0, function* () {
|
|
248
|
-
return agent.sendMessage(exports.chia_wallet_service, exports.
|
|
283
|
+
return agent.sendMessage(exports.chia_wallet_service, exports.get_all_offers_command, data);
|
|
249
284
|
});
|
|
250
285
|
}
|
|
251
|
-
exports.
|
|
252
|
-
exports.
|
|
253
|
-
function
|
|
286
|
+
exports.get_all_offers = get_all_offers;
|
|
287
|
+
exports.get_offers_count_command = "get_offers_count";
|
|
288
|
+
function get_offers_count(agent) {
|
|
254
289
|
return __awaiter(this, void 0, void 0, function* () {
|
|
255
|
-
return agent.sendMessage(exports.chia_wallet_service, exports.
|
|
290
|
+
return agent.sendMessage(exports.chia_wallet_service, exports.get_offers_count_command);
|
|
256
291
|
});
|
|
257
292
|
}
|
|
258
|
-
exports.
|
|
259
|
-
exports.
|
|
260
|
-
function
|
|
293
|
+
exports.get_offers_count = get_offers_count;
|
|
294
|
+
exports.cancel_offer_command = "cancel_offer";
|
|
295
|
+
function cancel_offer(agent, data) {
|
|
261
296
|
return __awaiter(this, void 0, void 0, function* () {
|
|
262
|
-
return agent.sendMessage(exports.chia_wallet_service, exports.
|
|
297
|
+
return agent.sendMessage(exports.chia_wallet_service, exports.cancel_offer_command, data);
|
|
263
298
|
});
|
|
264
299
|
}
|
|
265
|
-
exports.
|
|
266
|
-
exports.
|
|
267
|
-
function
|
|
300
|
+
exports.cancel_offer = cancel_offer;
|
|
301
|
+
exports.get_cat_list_command = "get_cat_list";
|
|
302
|
+
function get_cat_list(agent) {
|
|
268
303
|
return __awaiter(this, void 0, void 0, function* () {
|
|
269
|
-
return agent.sendMessage(exports.chia_wallet_service, exports.
|
|
304
|
+
return agent.sendMessage(exports.chia_wallet_service, exports.get_cat_list_command);
|
|
270
305
|
});
|
|
271
306
|
}
|
|
272
|
-
exports.
|
|
307
|
+
exports.get_cat_list = get_cat_list;
|
|
273
308
|
// # DID Wallet
|
|
274
309
|
exports.did_update_recovery_ids_command = "did_update_recovery_ids";
|
|
275
310
|
function did_update_recovery_ids(agent, data) {
|
package/api/types.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { NodeType } from "./chia/server/outbound_message";
|
|
2
|
+
import { float, int, str, uint16 } from "./chia/types/_python_types_";
|
|
3
|
+
import { bytes32 } from "./chia/types/blockchain_format/sized_bytes";
|
|
1
4
|
export declare type GetMessageType<O extends string, C extends string, D> = {
|
|
2
5
|
origin: O;
|
|
3
6
|
command: C;
|
|
@@ -7,3 +10,16 @@ export declare type GetMessageType<O extends string, C extends string, D> = {
|
|
|
7
10
|
destination: string;
|
|
8
11
|
};
|
|
9
12
|
export declare const wallet_ui_service = "wallet_ui";
|
|
13
|
+
export declare const metrics_service = "metrics";
|
|
14
|
+
export declare type TConnectionGeneral = {
|
|
15
|
+
type: NodeType;
|
|
16
|
+
local_port: int;
|
|
17
|
+
peer_host: str;
|
|
18
|
+
peer_port: uint16;
|
|
19
|
+
peer_server_port?: uint16;
|
|
20
|
+
node_id: bytes32;
|
|
21
|
+
creation_time: float;
|
|
22
|
+
bytes_read: int;
|
|
23
|
+
bytes_written: int;
|
|
24
|
+
last_message_time: float;
|
|
25
|
+
};
|
package/api/types.js
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { bytes32 } from "../../chia/types/blockchain_format/sized_bytes";
|
|
2
|
+
import { int, str, uint64 } from "../../chia/types/_python_types_";
|
|
3
|
+
import { TDaemon } from "../../../daemon/index";
|
|
4
|
+
import { GetMessageType } from "../../types";
|
|
5
|
+
export declare const chia_crawler_service = "chia_crawler";
|
|
6
|
+
export declare type chia_crawler_service = typeof chia_crawler_service;
|
|
7
|
+
export declare type TPeerCounts = {
|
|
8
|
+
total_last_5_days: int;
|
|
9
|
+
reliable_nodes: int;
|
|
10
|
+
ipv4_last_5_days: bytes32;
|
|
11
|
+
ipv6_last_5_days: uint64;
|
|
12
|
+
versions: Record<str, int>;
|
|
13
|
+
};
|
|
14
|
+
export declare const loaded_initial_peers_command = "loaded_initial_peers";
|
|
15
|
+
export declare type loaded_initial_peers_command = typeof loaded_initial_peers_command;
|
|
16
|
+
export declare type TLoadedInitialPeersBroadCast = {
|
|
17
|
+
peer_counts: TPeerCounts;
|
|
18
|
+
};
|
|
19
|
+
export declare function on_loaded_initial_peers(daemon: TDaemon, callback: (e: GetMessageType<chia_crawler_service, loaded_initial_peers_command, TLoadedInitialPeersBroadCast>) => unknown): Promise<() => void>;
|
|
20
|
+
export declare const crawl_batch_completed_command = "crawl_batch_completed";
|
|
21
|
+
export declare type crawl_batch_completed_command = typeof crawl_batch_completed_command;
|
|
22
|
+
export declare type TCrawlBatchCompletedBroadCast = {
|
|
23
|
+
peer_counts: TPeerCounts;
|
|
24
|
+
};
|
|
25
|
+
export declare function on_crawl_batch_completed(daemon: TDaemon, callback: (e: GetMessageType<chia_crawler_service, crawl_batch_completed_command, TCrawlBatchCompletedBroadCast>) => unknown): Promise<() => void>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.on_crawl_batch_completed = exports.crawl_batch_completed_command = exports.on_loaded_initial_peers = exports.loaded_initial_peers_command = exports.chia_crawler_service = void 0;
|
|
13
|
+
const types_1 = require("../../types");
|
|
14
|
+
exports.chia_crawler_service = "chia_crawler";
|
|
15
|
+
exports.loaded_initial_peers_command = "loaded_initial_peers";
|
|
16
|
+
function on_loaded_initial_peers(daemon, callback) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
yield daemon.subscribe(types_1.metrics_service);
|
|
19
|
+
const messageListener = (e) => {
|
|
20
|
+
if (e.origin === exports.chia_crawler_service && e.command === exports.loaded_initial_peers_command) {
|
|
21
|
+
callback(e);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
return daemon.addMessageListener(exports.chia_crawler_service, messageListener);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
exports.on_loaded_initial_peers = on_loaded_initial_peers;
|
|
28
|
+
exports.crawl_batch_completed_command = "crawl_batch_completed";
|
|
29
|
+
function on_crawl_batch_completed(daemon, callback) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
yield daemon.subscribe(types_1.metrics_service);
|
|
32
|
+
const messageListener = (e) => {
|
|
33
|
+
if (e.origin === exports.chia_crawler_service && e.command === exports.crawl_batch_completed_command) {
|
|
34
|
+
callback(e);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return daemon.addMessageListener(exports.chia_crawler_service, messageListener);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
exports.on_crawl_batch_completed = on_crawl_batch_completed;
|
package/api/ws/daemon/index.d.ts
CHANGED
|
@@ -339,6 +339,14 @@ export declare type TGetStatusResponse = {
|
|
|
339
339
|
genesis_initialized: True;
|
|
340
340
|
};
|
|
341
341
|
export declare function get_status(daemon: TDaemon): Promise<GetMessageType<"daemon", "get_status", TGetStatusResponse>>;
|
|
342
|
+
export declare const get_version_command = "get_version";
|
|
343
|
+
export declare type get_version_command = typeof get_version_command;
|
|
344
|
+
export declare type TGetVersionRequest = {};
|
|
345
|
+
export declare type TGetVersionResponse = {
|
|
346
|
+
success: bool;
|
|
347
|
+
version: string;
|
|
348
|
+
};
|
|
349
|
+
export declare function get_version(daemon: TDaemon): Promise<GetMessageType<"daemon", "get_version", TGetVersionResponse>>;
|
|
342
350
|
export declare const get_plotters_command = "get_plotters";
|
|
343
351
|
export declare type get_plotters_command = typeof get_plotters_command;
|
|
344
352
|
export declare type TGetPlottersRequest = {};
|
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_plotters = void 0;
|
|
12
|
+
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 = 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.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_private_key = exports.add_private_key_command = exports.is_running = exports.is_running_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_plotters = exports.get_plotters_command = exports.get_version = 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";
|
|
@@ -182,6 +182,13 @@ function get_status(daemon) {
|
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
184
|
exports.get_status = get_status;
|
|
185
|
+
exports.get_version_command = "get_version";
|
|
186
|
+
function get_version(daemon) {
|
|
187
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
188
|
+
return daemon.sendMessage(exports.daemon_service, exports.get_version_command);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
exports.get_version = get_version;
|
|
185
192
|
exports.get_plotters_command = "get_plotters";
|
|
186
193
|
function get_plotters(daemon) {
|
|
187
194
|
return __awaiter(this, void 0, void 0, function* () {
|
package/api/ws/farmer/index.d.ts
CHANGED
|
@@ -3,10 +3,16 @@ import { NewSignagePoint } from "../../chia/protocols/farmer_protocol";
|
|
|
3
3
|
import { bytes32 } from "../../chia/types/blockchain_format/sized_bytes";
|
|
4
4
|
import { uint32, uint64 } from "../../chia/types/_python_types_";
|
|
5
5
|
import { TDaemon } from "../../../daemon/index";
|
|
6
|
-
import { GetMessageType } from "../../types";
|
|
6
|
+
import { GetMessageType, TConnectionGeneral } from "../../types";
|
|
7
7
|
import { TGetHarvestersResponse } from "../../rpc/farmer/index";
|
|
8
8
|
export declare const chia_farmer_service = "chia_farmer";
|
|
9
9
|
export declare type chia_farmer_service = typeof chia_farmer_service;
|
|
10
|
+
export declare const get_connections_command = "get_connections";
|
|
11
|
+
export declare type get_connections_command = typeof get_connections_command;
|
|
12
|
+
export declare type TGetConnectionsBroadCast = {
|
|
13
|
+
connections: TConnectionGeneral[];
|
|
14
|
+
};
|
|
15
|
+
export declare function on_get_connections(daemon: TDaemon, callback: (e: GetMessageType<chia_farmer_service, get_connections_command, TGetConnectionsBroadCast>) => unknown): Promise<() => void>;
|
|
10
16
|
export declare const new_farming_info_command = "new_farming_info";
|
|
11
17
|
export declare type new_farming_info_command = typeof new_farming_info_command;
|
|
12
18
|
export declare type TNewFarmingInfoBroadCast = {
|
|
@@ -31,6 +37,6 @@ export declare const new_plots_command = "get_harvesters";
|
|
|
31
37
|
export declare type new_plots_command = typeof new_plots_command;
|
|
32
38
|
export declare type TNewPlotsBroadCast = TGetHarvestersResponse;
|
|
33
39
|
export declare function on_new_plots(daemon: TDaemon, callback: (e: GetMessageType<chia_farmer_service, new_plots_command, TNewPlotsBroadCast>) => unknown): Promise<() => void>;
|
|
34
|
-
export declare type chia_farmer_commands = new_farming_info_command | new_signage_point_command | new_plots_command;
|
|
35
|
-
export declare type TChiaFarmerBroadcast = TNewFarmingInfoBroadCast | TNewSignagePointBroadCast | TNewPlotsBroadCast;
|
|
40
|
+
export declare type chia_farmer_commands = get_connections_command | new_farming_info_command | new_signage_point_command | new_plots_command;
|
|
41
|
+
export declare type TChiaFarmerBroadcast = TGetConnectionsBroadCast | TNewFarmingInfoBroadCast | TNewSignagePointBroadCast | TNewPlotsBroadCast;
|
|
36
42
|
export declare function on_message_from_farmer(daemon: TDaemon, callback: (e: GetMessageType<chia_farmer_service, chia_farmer_commands, TChiaFarmerBroadcast>) => unknown): Promise<() => void>;
|
package/api/ws/farmer/index.js
CHANGED
|
@@ -9,9 +9,22 @@ 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_farmer = exports.on_new_plots = exports.new_plots_command = exports.on_new_signage_point = exports.new_signage_point_command = exports.on_new_farming_info = exports.new_farming_info_command = exports.chia_farmer_service = void 0;
|
|
12
|
+
exports.on_message_from_farmer = exports.on_new_plots = exports.new_plots_command = exports.on_new_signage_point = exports.new_signage_point_command = exports.on_new_farming_info = exports.new_farming_info_command = exports.on_get_connections = exports.get_connections_command = exports.chia_farmer_service = void 0;
|
|
13
13
|
const types_1 = require("../../types");
|
|
14
14
|
exports.chia_farmer_service = "chia_farmer";
|
|
15
|
+
exports.get_connections_command = "get_connections";
|
|
16
|
+
function on_get_connections(daemon, callback) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
yield daemon.subscribe(types_1.wallet_ui_service);
|
|
19
|
+
const messageListener = (e) => {
|
|
20
|
+
if (e.origin === exports.chia_farmer_service && e.command === exports.get_connections_command) {
|
|
21
|
+
callback(e);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
return daemon.addMessageListener(exports.chia_farmer_service, messageListener);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
exports.on_get_connections = on_get_connections;
|
|
15
28
|
exports.new_farming_info_command = "new_farming_info";
|
|
16
29
|
function on_new_farming_info(daemon, callback) {
|
|
17
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -38,7 +51,7 @@ function on_new_signage_point(daemon, callback) {
|
|
|
38
51
|
});
|
|
39
52
|
}
|
|
40
53
|
exports.on_new_signage_point = on_new_signage_point;
|
|
41
|
-
exports.new_plots_command = "get_harvesters"; // not "new_plots" for now.
|
|
54
|
+
exports.new_plots_command = "get_harvesters"; // not "new_plots" for now. See https://github.com/Chia-Network/chia-blockchain/blob/773d692fc5a7ee539392c78902857c3c03e00560/chia/rpc/farmer_rpc_api.py#L50
|
|
42
55
|
function on_new_plots(daemon, callback) {
|
|
43
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
57
|
yield daemon.subscribe(types_1.wallet_ui_service);
|
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
import { BlockRecord } from "../../chia/consensus/block_record";
|
|
2
|
-
import { bool, int, uint128, uint32, uint64 } from "../../chia/types/_python_types_";
|
|
2
|
+
import { bool, float, int, None, str, uint128, uint32, uint64, uint8 } from "../../chia/types/_python_types_";
|
|
3
3
|
import { TDaemon } from "../../../daemon/index";
|
|
4
|
-
import { GetMessageType } from "../../types";
|
|
4
|
+
import { GetMessageType, TConnectionGeneral } from "../../types";
|
|
5
|
+
import { bytes32 } from "../../chia/types/blockchain_format/sized_bytes";
|
|
6
|
+
import { NewSignagePoint } from "../../chia/protocols/farmer_protocol";
|
|
7
|
+
import { ReceiveBlockResult } from "../../chia/consensus/blockchain";
|
|
5
8
|
export declare const chia_full_node_service = "chia_full_node";
|
|
6
9
|
export declare type chia_full_node_service = typeof chia_full_node_service;
|
|
10
|
+
export declare type TConnectionFullNode = ({
|
|
11
|
+
peak_height: uint32;
|
|
12
|
+
peak_weight: uint128;
|
|
13
|
+
peak_hash: bytes32;
|
|
14
|
+
} | {
|
|
15
|
+
peak_height: None;
|
|
16
|
+
peak_weight: None;
|
|
17
|
+
peak_hash: None;
|
|
18
|
+
}) & TConnectionGeneral;
|
|
19
|
+
export declare const get_connections_command = "get_connections";
|
|
20
|
+
export declare type get_connections_command = typeof get_connections_command;
|
|
21
|
+
export declare type TGetConnectionsBroadCast = {
|
|
22
|
+
connections: TConnectionFullNode[];
|
|
23
|
+
};
|
|
24
|
+
export declare function on_get_connections(daemon: TDaemon, callback: (e: GetMessageType<chia_full_node_service, get_connections_command, TGetConnectionsBroadCast>) => unknown): Promise<() => void>;
|
|
7
25
|
export declare const get_blockchain_state_command = "get_blockchain_state";
|
|
8
26
|
export declare type get_blockchain_state_command = typeof get_blockchain_state_command;
|
|
9
27
|
export declare type TGetBlockchainStateBroadCast = {
|
|
@@ -20,9 +38,37 @@ export declare type TGetBlockchainStateBroadCast = {
|
|
|
20
38
|
sub_slot_iters: uint64;
|
|
21
39
|
space: uint128;
|
|
22
40
|
mempool_size: int;
|
|
41
|
+
mempool_cost: int;
|
|
42
|
+
"mempool_min_fees": {
|
|
43
|
+
"cost_5000000": float;
|
|
44
|
+
};
|
|
45
|
+
"mempool_max_total_cost": int;
|
|
46
|
+
"block_max_cost": int;
|
|
47
|
+
"node_id": str;
|
|
23
48
|
};
|
|
24
49
|
};
|
|
25
50
|
export declare function on_get_blockchain_state(daemon: TDaemon, callback: (e: GetMessageType<chia_full_node_service, get_blockchain_state_command, TGetBlockchainStateBroadCast>) => unknown): Promise<() => void>;
|
|
26
|
-
export declare
|
|
27
|
-
export declare type
|
|
51
|
+
export declare const block_command = "block";
|
|
52
|
+
export declare type block_command = typeof block_command;
|
|
53
|
+
export declare type TBlockBroadCast = {} | {
|
|
54
|
+
transaction_block: bool;
|
|
55
|
+
k_size: uint8;
|
|
56
|
+
header_hash: bytes32;
|
|
57
|
+
height: uint32;
|
|
58
|
+
block_cost?: uint64;
|
|
59
|
+
block_fees?: uint64;
|
|
60
|
+
timestamp?: uint64;
|
|
61
|
+
transaction_generator_size_bytes?: int;
|
|
62
|
+
transaction_generator_ref_list: uint32[];
|
|
63
|
+
receive_block_result?: ReceiveBlockResult;
|
|
64
|
+
};
|
|
65
|
+
export declare function on_block(daemon: TDaemon, callback: (e: GetMessageType<chia_full_node_service, block_command, TBlockBroadCast>) => unknown): Promise<() => void>;
|
|
66
|
+
export declare const signage_point_command = "signage_point";
|
|
67
|
+
export declare type signage_point_command = typeof signage_point_command;
|
|
68
|
+
export declare type TSignagePointBroadCast = {
|
|
69
|
+
broadcast_farmer: NewSignagePoint;
|
|
70
|
+
};
|
|
71
|
+
export declare function on_signage_point(daemon: TDaemon, callback: (e: GetMessageType<chia_full_node_service, signage_point_command, TSignagePointBroadCast>) => unknown): Promise<() => void>;
|
|
72
|
+
export declare type chia_full_node_commands = get_blockchain_state_command | get_connections_command | block_command | signage_point_command;
|
|
73
|
+
export declare type TChiaFullNodeBroadcast = TGetBlockchainStateBroadCast | TGetConnectionsBroadCast | TBlockBroadCast | TSignagePointBroadCast;
|
|
28
74
|
export declare function on_message_from_full_node(daemon: TDaemon, callback: (e: GetMessageType<chia_full_node_service, chia_full_node_commands, TChiaFullNodeBroadcast>) => unknown): Promise<() => void>;
|
|
@@ -9,9 +9,22 @@ 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_get_blockchain_state = exports.get_blockchain_state_command = exports.chia_full_node_service = void 0;
|
|
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;
|
|
13
13
|
const types_1 = require("../../types");
|
|
14
14
|
exports.chia_full_node_service = "chia_full_node";
|
|
15
|
+
exports.get_connections_command = "get_connections";
|
|
16
|
+
function on_get_connections(daemon, callback) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
yield daemon.subscribe(types_1.wallet_ui_service);
|
|
19
|
+
const messageListener = (e) => {
|
|
20
|
+
if (e.origin === exports.chia_full_node_service && e.command === exports.get_connections_command) {
|
|
21
|
+
callback(e);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
return daemon.addMessageListener(exports.chia_full_node_service, messageListener);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
exports.on_get_connections = on_get_connections;
|
|
15
28
|
exports.get_blockchain_state_command = "get_blockchain_state";
|
|
16
29
|
function on_get_blockchain_state(daemon, callback) {
|
|
17
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -25,6 +38,32 @@ function on_get_blockchain_state(daemon, callback) {
|
|
|
25
38
|
});
|
|
26
39
|
}
|
|
27
40
|
exports.on_get_blockchain_state = on_get_blockchain_state;
|
|
41
|
+
exports.block_command = "block";
|
|
42
|
+
function on_block(daemon, callback) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
yield daemon.subscribe(types_1.metrics_service);
|
|
45
|
+
const messageListener = (e) => {
|
|
46
|
+
if (e.origin === exports.chia_full_node_service && e.command === exports.block_command) {
|
|
47
|
+
callback(e);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
return daemon.addMessageListener(exports.chia_full_node_service, messageListener);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
exports.on_block = on_block;
|
|
54
|
+
exports.signage_point_command = "signage_point";
|
|
55
|
+
function on_signage_point(daemon, callback) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
yield daemon.subscribe(types_1.metrics_service);
|
|
58
|
+
const messageListener = (e) => {
|
|
59
|
+
if (e.origin === exports.chia_full_node_service && e.command === exports.signage_point_command) {
|
|
60
|
+
callback(e);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
return daemon.addMessageListener(exports.chia_full_node_service, messageListener);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
exports.on_signage_point = on_signage_point;
|
|
28
67
|
function on_message_from_full_node(daemon, callback) {
|
|
29
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
69
|
yield daemon.subscribe(types_1.wallet_ui_service);
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { Plot } from "../../chia/harvester/harvester";
|
|
2
2
|
import { TDaemon } from "../../../daemon/index";
|
|
3
|
-
import { GetMessageType } from "../../types";
|
|
3
|
+
import { GetMessageType, TConnectionGeneral } from "../../types";
|
|
4
4
|
export declare const chia_harvester_service = "chia_harvester";
|
|
5
5
|
export declare type chia_harvester_service = typeof chia_harvester_service;
|
|
6
|
+
export declare const get_connections_command = "get_connections";
|
|
7
|
+
export declare type get_connections_command = typeof get_connections_command;
|
|
8
|
+
export declare type TGetConnectionsBroadCast = {
|
|
9
|
+
connections: TConnectionGeneral[];
|
|
10
|
+
};
|
|
11
|
+
export declare function on_get_connections(daemon: TDaemon, callback: (e: GetMessageType<chia_harvester_service, get_connections_command, TGetConnectionsBroadCast>) => unknown): Promise<() => void>;
|
|
6
12
|
export declare const get_plots_command = "get_plots";
|
|
7
13
|
export declare type get_plots_command = typeof get_plots_command;
|
|
8
14
|
export declare type TGetPlotsBroadCast = {
|
|
@@ -11,6 +17,6 @@ export declare type TGetPlotsBroadCast = {
|
|
|
11
17
|
not_found_filenames: string[];
|
|
12
18
|
};
|
|
13
19
|
export declare function on_get_plots(daemon: TDaemon, callback: (e: GetMessageType<chia_harvester_service, get_plots_command, TGetPlotsBroadCast>) => unknown): Promise<() => void>;
|
|
14
|
-
export declare type chia_harvester_commands = get_plots_command;
|
|
15
|
-
export declare type TChiaHarvesterBroadcast = TGetPlotsBroadCast;
|
|
20
|
+
export declare type chia_harvester_commands = get_plots_command | get_connections_command;
|
|
21
|
+
export declare type TChiaHarvesterBroadcast = TGetPlotsBroadCast | TGetConnectionsBroadCast;
|
|
16
22
|
export declare function on_message_from_harvester(daemon: TDaemon, callback: (e: GetMessageType<chia_harvester_service, chia_harvester_commands, TChiaHarvesterBroadcast>) => unknown): Promise<() => void>;
|
|
@@ -9,9 +9,22 @@ 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_harvester = exports.on_get_plots = exports.get_plots_command = exports.chia_harvester_service = void 0;
|
|
12
|
+
exports.on_message_from_harvester = exports.on_get_plots = exports.get_plots_command = exports.on_get_connections = exports.get_connections_command = exports.chia_harvester_service = void 0;
|
|
13
13
|
const types_1 = require("../../types");
|
|
14
14
|
exports.chia_harvester_service = "chia_harvester";
|
|
15
|
+
exports.get_connections_command = "get_connections";
|
|
16
|
+
function on_get_connections(daemon, callback) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
yield daemon.subscribe(types_1.wallet_ui_service);
|
|
19
|
+
const messageListener = (e) => {
|
|
20
|
+
if (e.origin === exports.chia_harvester_service && e.command === exports.get_connections_command) {
|
|
21
|
+
callback(e);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
return daemon.addMessageListener(exports.chia_harvester_service, messageListener);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
exports.on_get_connections = on_get_connections;
|
|
15
28
|
exports.get_plots_command = "get_plots";
|
|
16
29
|
function on_get_plots(daemon, callback) {
|
|
17
30
|
return __awaiter(this, void 0, void 0, function* () {
|