chia-agent 9.2.0 → 10.1.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 +179 -1
- package/README.md +12 -5
- package/api/chia/data_layer/data_layer_util.d.ts +8 -1
- package/api/chia/types/mempool_item.d.ts +2 -2
- package/api/chia/types/mojos.d.ts +2 -0
- package/api/chia/types/mojos.js +2 -0
- package/api/chia/types/signing_mode.d.ts +4 -0
- package/api/chia/types/signing_mode.js +2 -0
- package/api/rpc/common/index.d.ts +23 -9
- package/api/rpc/crawler/index.d.ts +8 -2
- package/api/rpc/data_layer/index.d.ts +68 -27
- package/api/rpc/data_layer/index.js +8 -1
- package/api/rpc/farmer/index.d.ts +30 -13
- package/api/rpc/full_node/index.d.ts +69 -28
- package/api/rpc/harvester/index.d.ts +16 -6
- package/api/rpc/index.d.ts +10 -17
- package/api/rpc/index.js +7 -3
- package/api/rpc/wallet/index.d.ts +390 -107
- package/api/rpc/wallet/index.js +68 -4
- package/api/types.d.ts +3 -0
- package/api/ws/chia_plots_create/index.d.ts +4 -2
- package/api/ws/crawler/index.d.ts +5 -2
- package/api/ws/daemon/index.d.ts +71 -38
- package/api/ws/farmer/index.d.ts +16 -8
- package/api/ws/full_node/index.d.ts +10 -5
- package/api/ws/harvester/index.d.ts +7 -3
- package/api/ws/index.d.ts +8 -17
- package/api/ws/timelord/index.d.ts +9 -4
- package/api/ws/wallet/index.d.ts +11 -6
- package/daemon/index.d.ts +6 -7
- package/package.json +1 -1
- package/rpc/index.d.ts +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,180 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [10.1.0]
|
|
4
|
+
### Indirect Change
|
|
5
|
+
In `chia/types/mempool_items.py`, `assert_height` was added to `MempoolItem`.
|
|
6
|
+
As a result of this change, the responses from following RPC APIs are affected.
|
|
7
|
+
- [FullNode RPC API](./src/api/rpc/full_node)
|
|
8
|
+
- [`get_all_mempool_items`](./src/api/rpc/full_node/README.md#getallmempoolitemsagent)
|
|
9
|
+
- [`get_mempool_item_by_tx_id`](./src/api/rpc/full_node/README.md#getmempoolitembytxidagent-params)
|
|
10
|
+
### Added
|
|
11
|
+
- [New Wallet RPC API](./src/api/rpc/wallet)
|
|
12
|
+
- [`get_timestamp_for_height`](./src/api/rpc/wallet/README.md#gettimestampforheightagent)
|
|
13
|
+
- [`nft_transfer_bulk`](./src/api/rpc/wallet/README.md#nfttransferbulkagent-params)
|
|
14
|
+
### Changed
|
|
15
|
+
- [Common RPC API](./src/api/rpc/common)
|
|
16
|
+
- [`open_connection`](./src/api/rpc/common/README.md#openconnectionagent-params)
|
|
17
|
+
- Added `success` to response
|
|
18
|
+
- Added `error` to response when `success` is `False`
|
|
19
|
+
- [FullNode RPC API](./src/api/rpc/full_node)
|
|
20
|
+
- [`get_blockchain_state`](./src/api/rpc/full_node/README.md#getblockchainstateagent)
|
|
21
|
+
- Added `mempool_fees` to response
|
|
22
|
+
- [`get_fee_estimate`](./src/api/rpc/full_node/README.md#getfeeestimateagent-params)
|
|
23
|
+
- Added `spend_type` to request parameter
|
|
24
|
+
- Added `spend_count` to request parameter
|
|
25
|
+
- Added `mempool_fees` to response
|
|
26
|
+
- Added `num_spends` to response
|
|
27
|
+
- Added `last_block_cost` to response
|
|
28
|
+
- Added `fees_last_block` to response
|
|
29
|
+
- Added `fee_rate_last_block` to response
|
|
30
|
+
- Added `last_tx_block_height` to response
|
|
31
|
+
- [Wallet RPC API](./src/api/rpc/wallet)
|
|
32
|
+
- [`get_notifications`](./src/api/rpc/wallet/README.md#getnotificationsagent-params)
|
|
33
|
+
- Added `height` to response
|
|
34
|
+
- [`verify_signature`](./src/api/rpc/wallet/README.md#verifysignatureagent-params)
|
|
35
|
+
- Added `signing_mode` to request parameter
|
|
36
|
+
- [`sign_message_by_address`](./src/api/rpc/wallet/README.md#signmessagebyaddressagent-params)
|
|
37
|
+
- Added `signing_mode` to response
|
|
38
|
+
- [`sign_message_by_id`](./src/api/rpc/wallet/README.md#signmessagebyidagent-params)
|
|
39
|
+
- Added `None` type to `latest_coin_id` in response
|
|
40
|
+
- Added `signing_mode` to response
|
|
41
|
+
- [`cat_spend`](./src/api/rpc/wallet/README.md#catspendagent-params)
|
|
42
|
+
- Added `coins` to response
|
|
43
|
+
- [`get_offer_summary`](./src/api/rpc/wallet/README.md#getoffersummaryagent-params)
|
|
44
|
+
- Added `id` to response
|
|
45
|
+
- [`check_offer_validity`](./src/api/rpc/wallet/README.md#checkoffervalidityagent-params)
|
|
46
|
+
- Added `id` to response
|
|
47
|
+
- [`did_message_spend`](./src/api/rpc/wallet/README.md#didmessagespendagent-params)
|
|
48
|
+
- Removed error response
|
|
49
|
+
- [`nft_set_did_bulk`](./src/api/rpc/wallet/README.md#nftsetdidbulkagent-params)
|
|
50
|
+
- Added `tx_num to response
|
|
51
|
+
- [`nft_get_wallet_did`](./src/api/rpc/wallet/README.md#nftgetwalletdidagent-params)
|
|
52
|
+
- Removed error response
|
|
53
|
+
- [`nft_set_nft_status`](./src/api/rpc/wallet/README.md#nftsetnftstatusagent-params)
|
|
54
|
+
- Removed error response
|
|
55
|
+
### Fixed
|
|
56
|
+
- [FullNode RPC API](./src/api/rpc/full_node)
|
|
57
|
+
- [`get_blockchain_state`](./src/api/rpc/full_node/README.md#getblockchainstateagent)
|
|
58
|
+
- Changed the type of `mempool_size` in response from `int` to `CLVMCost`(actually `uint64`)
|
|
59
|
+
- [Wallet RPC API](./src/api/rpc/wallet)
|
|
60
|
+
- [`nft_set_did_bulk`](./src/api/rpc/wallet/README.md#nftsetdidbulkagent-params)
|
|
61
|
+
- Fixed missing export and entry in [README](./src/api/README.md)
|
|
62
|
+
- [`verify_signature`](./src/api/rpc/wallet/README.md#verifysignatureagent-params)
|
|
63
|
+
- Added missing `message` to request parameter
|
|
64
|
+
|
|
65
|
+
## [10.0.0]
|
|
66
|
+
### Breaking change
|
|
67
|
+
In `chia/types/mempool_items.py`, `removals` of `MempoolItem` is now flagged as `@property`.
|
|
68
|
+
As a result of this, `removals` of `MempoolItem` is removed from 2 RPC API responses listed below.
|
|
69
|
+
- [FullNode RPC API](./src/api/rpc/full_node)
|
|
70
|
+
- [`get_all_mempool_items`](./src/api/rpc/full_node/README.md#getallmempoolitemsagent)
|
|
71
|
+
- [`get_mempool_item_by_tx_id`](./src/api/rpc/full_node/README.md#getmempoolitembytxidagent-params)
|
|
72
|
+
### Minor breaking change
|
|
73
|
+
- Response params of`keyring_status` daemon WebSocket API below are deprecated
|
|
74
|
+
- `needs_migration`
|
|
75
|
+
- `can_remove_legacy_keys`
|
|
76
|
+
### Removed
|
|
77
|
+
- [Daemon WebSocket API](./src/api/ws/daemon)
|
|
78
|
+
(Code will remain awhile on chia-agent for backward compatibility. Only document is removed for now.)
|
|
79
|
+
- Removed `migrate_keyring`
|
|
80
|
+
- Removed `notify_keyring_migration_completed`
|
|
81
|
+
### Added
|
|
82
|
+
- [New DataLayer RPC API](./src/api/rpc/data_layer)
|
|
83
|
+
- [`get_sync_status`](./src/api/rpc/data_layer/README.md#getsyncstatusagent-params)
|
|
84
|
+
- [New Wallet RPC API](./src/api/rpc/wallet)
|
|
85
|
+
- [`get_spendable_coins`](./src/api/rpc/wallet/README.md#getspendablecoinsagent-params)
|
|
86
|
+
- [`get_coin_records_by_names`](./src/api/rpc/wallet/README.md#getcoinrecordsbynamesagent-params)
|
|
87
|
+
- [`verify_signature`](./src/api/rpc/wallet/README.md#verifysignatureagent-params)
|
|
88
|
+
- [`did_message_spend`](./src/api/rpc/wallet/README.md#didmessagespendagent-params)
|
|
89
|
+
- [`did_get_info`](./src/api/rpc/wallet/README.md#didgetinfoagent-params)
|
|
90
|
+
- [`did_find_lost_did`](./src/api/rpc/wallet/README.md#didfindlostdidagent-params)
|
|
91
|
+
- [`nft_set_did_bulk`](./src/api/rpc/wallet/README.md#nftsetdidbulkagent-params)
|
|
92
|
+
### Changed
|
|
93
|
+
- [Daemon WebSocket API](./src/api/ws/daemon)
|
|
94
|
+
- [`keyring_status`](./src/api/ws/daemon/README.md#keyringstatusdaemon)
|
|
95
|
+
- Removed `needs_migration` from response
|
|
96
|
+
- Removed `can_remove_legacy_keys` from response
|
|
97
|
+
- [FullNode RPC API](./src/api/rpc/full_node)
|
|
98
|
+
- [`get_mempool_item_by_tx_id`](./src/api/rpc/full_node/README.md#getmempoolitembytxidagent-params)
|
|
99
|
+
- Added `include_pending` to request parameter
|
|
100
|
+
- [Wallet RPC API](./src/api/rpc/wallet)
|
|
101
|
+
- [`send_transaction`](./src/api/rpc/wallet/README.md#sendtransactionagent-params)
|
|
102
|
+
- Added `max_coin_amount` to request parameter
|
|
103
|
+
- Added `exclude_coin_amounts` to request parameter
|
|
104
|
+
- Added `exclude_coin_ids` to request parameter
|
|
105
|
+
- [`send_transaction_multi`](./src/api/rpc/wallet/README.md#sendtransactionmultiagent-params)
|
|
106
|
+
- Added `max_coin_amount` to request parameter
|
|
107
|
+
- Added `exclude_coin_amounts` to request parameter
|
|
108
|
+
- Added parameters for cat spends.
|
|
109
|
+
- [`select_coins`](./src/api/rpc/wallet/README.md#selectcoinsagent-params)
|
|
110
|
+
- Added `max_coin_amount` to request parameter
|
|
111
|
+
- Added `exclude_coin_amounts` to request parameter
|
|
112
|
+
- [`cat_spend`](./src/api/rpc/wallet/README.md#catspendagent-params)
|
|
113
|
+
- Added `additions` to request parameter
|
|
114
|
+
- Added `max_coin_amount` to request parameter
|
|
115
|
+
- Added `exclude_coin_amounts` to request parameter
|
|
116
|
+
- Added `exclude_coin_ids` to request parameter
|
|
117
|
+
- [`sign_message_by_id`](./src/api/rpc/wallet/README.md#signmessagebyidagent-params)
|
|
118
|
+
- Added `latest_coin_id` to request parameter
|
|
119
|
+
- [`create_offer_for_ids`](./src/api/rpc/wallet/README.md#createofferforidsagent-params)
|
|
120
|
+
- Added `max_coin_amount` to request parameter
|
|
121
|
+
- [`take_offer`](./src/api/rpc/wallet/README.md#takeofferagent-params)
|
|
122
|
+
- Added `max_coin_amount` to request parameter
|
|
123
|
+
- [`nft_mint_nft`](./src/api/rpc/wallet/README.md#nftmintnftagent-params)
|
|
124
|
+
- Added `nft_id` to return parameter
|
|
125
|
+
- [`nft_mint_bulk`](./src/api/rpc/wallet/README.md#nftmintbulkagent-params)
|
|
126
|
+
- Added `nft_id_list` to return parameter
|
|
127
|
+
- [`create_signed_transaction`](./src/api/rpc/wallet/README.md#createsignedtransactionagent-params)
|
|
128
|
+
- Added `max_coin_amount` to return parameter
|
|
129
|
+
- Added `exclude_coin_amounts` to return parameter
|
|
130
|
+
- [Wallet WebSocket API](./src/api/ws/wallet)
|
|
131
|
+
- [`state_changed`](./src/api/ws/wallet/README.md#onstatechangedofwallet)
|
|
132
|
+
- Added `new_on_chain_notification` state.
|
|
133
|
+
- `TBladeBitParams` has been renamed to `TBladeBitRamParams`
|
|
134
|
+
- `plot_type: "ramplot"` has been added
|
|
135
|
+
- `TBladeBit2Params` has been renamed to `TBladeBitDiskParams`
|
|
136
|
+
- `plot_type: "diskplot"` has been added
|
|
137
|
+
- `plotter` type has been converted to `"bladebit"` from `"bladebit2"`
|
|
138
|
+
- Eased type requirement of `daemon.sendMessage()` and `agent.sendMessage()`
|
|
139
|
+
You can request **RPC** API on Daemon WebSocket channel like this:
|
|
140
|
+
```typescript
|
|
141
|
+
const {getDaemon} = require("chia-agent");
|
|
142
|
+
const {get_harvesters_summary} = require("chia-agent/api/rpc/farmer");
|
|
143
|
+
const daemon = getDaemon();
|
|
144
|
+
await daemon.connect();
|
|
145
|
+
res = await get_harvesters_summary(daemon);
|
|
146
|
+
// or specify service name and API command
|
|
147
|
+
res = await daemon.sendMessage("chia_farmer", "get_harvesters_summary");
|
|
148
|
+
/*
|
|
149
|
+
{
|
|
150
|
+
ack: true,
|
|
151
|
+
command: 'get_harvesters_summary',
|
|
152
|
+
data: { harvesters: [ [Object] ], success: true },
|
|
153
|
+
destination: 'chia_agent',
|
|
154
|
+
origin: 'chia_farmer',
|
|
155
|
+
request_id: '4e31c04df234538901d9270932d04301b5b3a1a895d762144400852b8167973f'
|
|
156
|
+
}
|
|
157
|
+
*/
|
|
158
|
+
```
|
|
159
|
+
Please note that when you use RPC API, you can directly request to the RPC endpoint of the service(full_node/farmer/...).
|
|
160
|
+
However, when you request RPC API on Daemon WebSocket channel, you get a response from the service
|
|
161
|
+
which the daemon is connecting to.
|
|
162
|
+
In other word, you can choose the exact ip:port of a service if you use RPC API,
|
|
163
|
+
while it is the daemon which chooses the services it connects to if you use Daemon WebSocket channel.
|
|
164
|
+
### Fixed
|
|
165
|
+
- [FullNode RPC API](./src/api/rpc/full_node)
|
|
166
|
+
- [`get_blockchain_state`](./src/api/rpc/full_node/README.md#getblockchainstateagent)
|
|
167
|
+
- Made `sync_tip_height` as `uint32`(previously `Optional<uint32>`) because `None` value would never be set
|
|
168
|
+
- [Wallet RPC API](./src/api/rpc/wallet)
|
|
169
|
+
- [`send_transaction_multi`](./src/api/rpc/wallet/README.md#sendtransactionmultiagent-params)
|
|
170
|
+
- Added missing `min_coin_amount` to request parameter
|
|
171
|
+
- Added missing `exclude_coins` to request parameter
|
|
172
|
+
- [`create_offer_for_ids`](./src/api/rpc/wallet/README.md#createofferforidsagent-params)
|
|
173
|
+
- Added missing `solver` to request parameter
|
|
174
|
+
- [`create_signed_transaction`](./src/api/rpc/wallet/README.md#createsignedtransactionagent-params)
|
|
175
|
+
- Added missing `wallet_id` to return parameter in README
|
|
176
|
+
- Added missing `exclude_coins` to return parameter in README
|
|
177
|
+
|
|
3
178
|
## [9.2.0]
|
|
4
179
|
### Minor breaking change
|
|
5
180
|
- `add_private_key` daemon WebSocket API now deprecated `passphrase` request param
|
|
@@ -39,7 +214,7 @@
|
|
|
39
214
|
- [`nft_calculate_royalties`](./src/api/rpc/wallet/README.md#nft_calculate_royaltiesagent-params)
|
|
40
215
|
- [`nft_mint_bulk`](./src/api/rpc/wallet/README.md#nft_mint_bulkagent-params)
|
|
41
216
|
### Changed
|
|
42
|
-
- [Daemon WebSocket API](./src/api/
|
|
217
|
+
- [Daemon WebSocket API](./src/api/ws/daemon)
|
|
43
218
|
- [`add_private_key`](./src/api/ws/daemon/README.md#add_private_keydaemon-params)
|
|
44
219
|
- Removed `passphrase` request parameter
|
|
45
220
|
- Added `label` request parameter
|
|
@@ -706,6 +881,9 @@ daemon.sendMessage(destination, get_block_record_by_height_command, data);
|
|
|
706
881
|
Initial release.
|
|
707
882
|
|
|
708
883
|
<!-- [Unreleased]: https://github.com/Chia-Mine/chia-agent/compare/v0.0.1...v0.0.2 -->
|
|
884
|
+
|
|
885
|
+
[10.1.0]: https://github.com/Chia-Mine/chia-agent/compare/v10.0.0...v10.1.0
|
|
886
|
+
[10.0.0]: https://github.com/Chia-Mine/chia-agent/compare/v9.2.0...v10.0.0
|
|
709
887
|
[9.2.0]: https://github.com/Chia-Mine/chia-agent/compare/v9.1.0...v9.2.0
|
|
710
888
|
[9.1.0]: https://github.com/Chia-Mine/chia-agent/compare/v9.0.1...v9.1.0
|
|
711
889
|
[9.0.1]: https://github.com/Chia-Mine/chia-agent/compare/v9.0.0...v9.0.1
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
[](https://badge.fury.io/js/chia-agent) [](https://opensource.org/licenses/MIT)
|
|
3
3
|
|
|
4
4
|
chia rpc/websocket client library for NodeJS.
|
|
5
|
-
Supports all RPC/Websocket API available at `chia 1.
|
|
5
|
+
Supports all RPC/Websocket API available at `chia 1.7.0`.
|
|
6
6
|
\(If you need previous version, search for the corresponding release [here](https://github.com/Chia-Mine/chia-agent/releases)\)
|
|
7
7
|
|
|
8
8
|
you can develop your own nodejs script with `chia-agent` to:
|
|
@@ -22,10 +22,10 @@ yarn add chia-agent
|
|
|
22
22
|
|
|
23
23
|
## Compatibility
|
|
24
24
|
This code is compatible with:
|
|
25
|
-
- [`
|
|
26
|
-
- [Diff to the main branch of chia-blockchain](https://github.com/Chia-Network/chia-blockchain/compare/
|
|
27
|
-
- [`
|
|
28
|
-
- [Diff to the main branch of pool-reference](https://github.com/Chia-Network/pool-reference/compare/
|
|
25
|
+
- [`a8bcb8516e695e69e271b78241c0b4b9f41093c4`](https://github.com/Chia-Network/chia-blockchain/tree/a8bcb8516e695e69e271b78241c0b4b9f41093c4) of [chia-blockchain 1.7.0](https://github.com/Chia-Network/chia-blockchain)
|
|
26
|
+
- [Diff to the main branch of chia-blockchain](https://github.com/Chia-Network/chia-blockchain/compare/a8bcb8516e695e69e271b78241c0b4b9f41093c4...main)
|
|
27
|
+
- [`f238c55ec5a5ad1ea2f4d3b7615f918dff492cd0`](https://github.com/Chia-Network/pool-reference/tree/f238c55ec5a5ad1ea2f4d3b7615f918dff492cd0) of [pool-reference](https://github.com/Chia-Network/pool-reference)
|
|
28
|
+
- [Diff to the main branch of pool-reference](https://github.com/Chia-Network/pool-reference/compare/f238c55ec5a5ad1ea2f4d3b7615f918dff492cd0...main)
|
|
29
29
|
|
|
30
30
|
## API
|
|
31
31
|
There are 2 kinds of APIs in chia.
|
|
@@ -61,6 +61,13 @@ console.log(res.plots[0]);
|
|
|
61
61
|
time_modified: 1619540745
|
|
62
62
|
}
|
|
63
63
|
*/
|
|
64
|
+
|
|
65
|
+
// Or you can request RPC API via daemon websocket like this
|
|
66
|
+
const {getDaemon, setLogLevel} = require("chia-agent");
|
|
67
|
+
const {get_plots} = require("chia-agent/api/rpc");
|
|
68
|
+
const daemon = getDaemon();
|
|
69
|
+
await daemon.connect(); // connect to local daemon using config file.
|
|
70
|
+
const res = await get_plots(daemon);
|
|
64
71
|
```
|
|
65
72
|
|
|
66
73
|
### Websocket API
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { str } from "../types/_python_types_";
|
|
1
|
+
import { int, str } from "../types/_python_types_";
|
|
2
|
+
import { bytes32 } from "../types/blockchain_format/sized_bytes";
|
|
2
3
|
export declare type KeyValueMarshalled = {
|
|
3
4
|
key: str;
|
|
4
5
|
value: str;
|
|
@@ -28,3 +29,9 @@ export declare type OfferMarshalled = {
|
|
|
28
29
|
taker: OfferStoreMarshalled[];
|
|
29
30
|
maker: StoreProofsMarshalled[];
|
|
30
31
|
};
|
|
32
|
+
export declare type SyncStatus = {
|
|
33
|
+
root_hash: bytes32;
|
|
34
|
+
generation: int;
|
|
35
|
+
target_root_hash: bytes32;
|
|
36
|
+
target_generation: int;
|
|
37
|
+
};
|
|
@@ -2,7 +2,7 @@ import { SpendBundle } from "./spend_bundle";
|
|
|
2
2
|
import { Coin } from "./blockchain_format/coin";
|
|
3
3
|
import { bytes32 } from "./blockchain_format/sized_bytes";
|
|
4
4
|
import { NPCResult } from "../consensus/cost_calculator";
|
|
5
|
-
import { uint32, uint64 } from "./_python_types_";
|
|
5
|
+
import { Optional, uint32, uint64 } from "./_python_types_";
|
|
6
6
|
export declare type MempoolItem = {
|
|
7
7
|
spend_bundle: SpendBundle;
|
|
8
8
|
fee: uint64;
|
|
@@ -10,6 +10,6 @@ export declare type MempoolItem = {
|
|
|
10
10
|
cost: uint64;
|
|
11
11
|
spend_bundle_name: bytes32;
|
|
12
12
|
additions: Coin[];
|
|
13
|
-
removals: Coin[];
|
|
14
13
|
height_added_to_mempool: uint32;
|
|
14
|
+
assert_height: Optional<uint32>;
|
|
15
15
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare type CHIP_0002 = "BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_AUG:CHIP-0002_";
|
|
2
|
+
export declare type BLS_MESSAGE_AUGMENTATION_UTF8_INPUT = "BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_AUG:utf8input_";
|
|
3
|
+
export declare type BLS_MESSAGE_AUGMENTATION_HEX_INPUT = "BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_AUG:hexinput_";
|
|
4
|
+
export declare type SigningMode = CHIP_0002 | BLS_MESSAGE_AUGMENTATION_UTF8_INPUT | BLS_MESSAGE_AUGMENTATION_HEX_INPUT;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { str, True, uint16 } from "../../chia/types/_python_types_";
|
|
1
|
+
import { False, str, True, uint16 } from "../../chia/types/_python_types_";
|
|
2
2
|
import { TRPCAgent } from "../../../rpc/index";
|
|
3
|
-
import { TConnectionGeneral } from "../../types";
|
|
3
|
+
import { GetMessageType, ResType, TConnectionGeneral } from "../../types";
|
|
4
4
|
import { TConnectionFullNode } from "../../ws/full_node/index";
|
|
5
|
+
import { TDaemon } from "../../../daemon/index";
|
|
5
6
|
export declare const chia_common_service = "";
|
|
6
7
|
export declare type chia_common_service = typeof chia_common_service;
|
|
7
8
|
export declare const get_connections_command = "get_connections";
|
|
@@ -12,36 +13,49 @@ export declare type TGetConnectionsRequest = {
|
|
|
12
13
|
export declare type TGetConnectionsResponse = {
|
|
13
14
|
connections: TConnectionGeneral[] | TConnectionFullNode[];
|
|
14
15
|
};
|
|
15
|
-
export declare
|
|
16
|
+
export declare type WsGetConnectionsMessage = GetMessageType<chia_common_service, get_connections_command, TGetConnectionsResponse>;
|
|
17
|
+
export declare function get_connections<T extends TRPCAgent | TDaemon>(agent: T, params: TGetConnectionsRequest): Promise<import("../../../rpc/index").ErrorResponse | ResType<T, TGetConnectionsResponse, WsGetConnectionsMessage>>;
|
|
16
18
|
export declare const open_connection_command = "open_connection";
|
|
17
19
|
export declare type open_connection_command = typeof open_connection_command;
|
|
18
20
|
export declare type TOpenConnectionRequest = {
|
|
19
21
|
host: str;
|
|
20
22
|
port: uint16;
|
|
21
23
|
};
|
|
22
|
-
export declare type TOpenConnectionResponse = {
|
|
23
|
-
|
|
24
|
+
export declare type TOpenConnectionResponse = {
|
|
25
|
+
success: False;
|
|
26
|
+
error: str;
|
|
27
|
+
} | {
|
|
28
|
+
success: True;
|
|
29
|
+
};
|
|
30
|
+
export declare type WsOpenConnectionMessage = GetMessageType<chia_common_service, open_connection_command, TOpenConnectionResponse>;
|
|
31
|
+
export declare function open_connection<T extends TRPCAgent | TDaemon>(agent: T, params: TOpenConnectionRequest): Promise<import("../../../rpc/index").ErrorResponse | ResType<T, TOpenConnectionResponse, WsOpenConnectionMessage>>;
|
|
24
32
|
export declare const close_connection_command = "close_connection";
|
|
25
33
|
export declare type close_connection_command = typeof close_connection_command;
|
|
26
34
|
export declare type TCloseConnectionRequest = {
|
|
27
35
|
node_id: str;
|
|
28
36
|
};
|
|
29
37
|
export declare type TCloseConnectionResponse = {};
|
|
30
|
-
export declare
|
|
38
|
+
export declare type WsCloseConnectionMessage = GetMessageType<chia_common_service, close_connection_command, TCloseConnectionResponse>;
|
|
39
|
+
export declare function close_connection<T extends TRPCAgent | TDaemon>(agent: T, params: TCloseConnectionRequest): Promise<import("../../../rpc/index").ErrorResponse | ResType<T, TCloseConnectionResponse, WsCloseConnectionMessage>>;
|
|
31
40
|
export declare const stop_node_command = "stop_node";
|
|
32
41
|
export declare type stop_node_command = typeof stop_node_command;
|
|
33
42
|
export declare type TStopNodeResponse = {};
|
|
34
|
-
export declare
|
|
43
|
+
export declare type WsStopNodeMessage = GetMessageType<chia_common_service, stop_node_command, TStopNodeResponse>;
|
|
44
|
+
export declare function stop_node<T extends TRPCAgent | TDaemon>(agent: T): Promise<import("../../../rpc/index").ErrorResponse | ResType<T, TStopNodeResponse, WsStopNodeMessage>>;
|
|
35
45
|
export declare const get_routes_command = "get_routes";
|
|
36
46
|
export declare type get_routes_command = typeof get_routes_command;
|
|
37
47
|
export declare type TGetRoutesResponse = {
|
|
38
48
|
success: True;
|
|
39
49
|
routes: str[];
|
|
40
50
|
};
|
|
41
|
-
export declare
|
|
51
|
+
export declare type WsGetRoutesMessage = GetMessageType<chia_common_service, get_routes_command, TGetRoutesResponse>;
|
|
52
|
+
export declare function get_routes<T extends TRPCAgent | TDaemon>(agent: T): Promise<import("../../../rpc/index").ErrorResponse | ResType<T, TGetRoutesResponse, WsGetRoutesMessage>>;
|
|
42
53
|
export declare const healthz_command = "healthz";
|
|
43
54
|
export declare type healthz_command = typeof healthz_command;
|
|
44
55
|
export declare type THealthzResponse = {
|
|
45
56
|
success: True;
|
|
46
57
|
};
|
|
47
|
-
export declare
|
|
58
|
+
export declare type WsHealthzMessage = GetMessageType<chia_common_service, healthz_command, THealthzResponse>;
|
|
59
|
+
export declare function healthz<T extends TRPCAgent | TDaemon>(agent: T): Promise<import("../../../rpc/index").ErrorResponse | ResType<T, THealthzResponse, WsHealthzMessage>>;
|
|
60
|
+
export declare type RpcCommonMessage = TGetConnectionsResponse | TOpenConnectionResponse | TCloseConnectionResponse | TStopNodeResponse | TGetRoutesResponse | THealthzResponse;
|
|
61
|
+
export declare type RpcCommonMessageOnWs = WsGetConnectionsMessage | WsOpenConnectionMessage | WsCloseConnectionMessage | WsStopNodeMessage | WsGetRoutesMessage | WsHealthzMessage;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { int, str, uint64 } from "../../chia/types/_python_types_";
|
|
2
2
|
import { bytes32 } from "../../chia/types/blockchain_format/sized_bytes";
|
|
3
3
|
import { TRPCAgent } from "../../../rpc/index";
|
|
4
|
+
import { TDaemon } from "../../../daemon/index";
|
|
5
|
+
import { GetMessageType, ResType } from "../../types";
|
|
4
6
|
export declare const chia_crawler_service = "chia_crawler";
|
|
5
7
|
export declare type chia_crawler_service = typeof chia_crawler_service;
|
|
6
8
|
export declare const get_peer_counts_command = "get_peer_counts";
|
|
@@ -14,7 +16,8 @@ export declare type TGetPeerCountsResponse = {
|
|
|
14
16
|
versions: Record<str, int>;
|
|
15
17
|
};
|
|
16
18
|
};
|
|
17
|
-
export declare
|
|
19
|
+
export declare type WsGetPeerCountsMessage = GetMessageType<chia_crawler_service, get_peer_counts_command, TGetPeerCountsResponse>;
|
|
20
|
+
export declare function get_peer_counts<T extends TRPCAgent | TDaemon>(agent: T): Promise<import("../../../rpc/index").ErrorResponse | ResType<T, TGetPeerCountsResponse, WsGetPeerCountsMessage>>;
|
|
18
21
|
export declare const get_ips_after_timestamp_command = "get_ips_after_timestamp";
|
|
19
22
|
export declare type get_ips_after_timestamp_command = typeof get_ips_after_timestamp_command;
|
|
20
23
|
export declare type TGetIpsAfterTimestampRequest = {
|
|
@@ -26,4 +29,7 @@ export declare type TGetIpsAfterTimestampResponse = {
|
|
|
26
29
|
ips: str[];
|
|
27
30
|
total: int;
|
|
28
31
|
};
|
|
29
|
-
export declare
|
|
32
|
+
export declare type WsGetIpsAfterTimestampMessage = GetMessageType<chia_crawler_service, get_ips_after_timestamp_command, TGetIpsAfterTimestampResponse>;
|
|
33
|
+
export declare function get_ips_after_timestamp<T extends TRPCAgent | TDaemon>(agent: T, params: TGetIpsAfterTimestampRequest): Promise<import("../../../rpc/index").ErrorResponse | ResType<T, TGetIpsAfterTimestampResponse, WsGetIpsAfterTimestampMessage>>;
|
|
34
|
+
export declare type RpcCrawlerMessage = TGetIpsAfterTimestampResponse | TGetPeerCountsResponse;
|
|
35
|
+
export declare type RpcCrawlerMessageOnWs = WsGetIpsAfterTimestampMessage | WsGetPeerCountsMessage;
|