chia-agent 3.0.1-beta.0 → 5.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +148 -0
  2. package/README.md +7 -11
  3. package/api/chia/consensus/blockchain.d.ts +1 -0
  4. package/api/chia/{types/condition_with_args.js → consensus/blockchain.js} +0 -0
  5. package/api/chia/consensus/cost_calculator.d.ts +3 -3
  6. package/api/chia/pools/pool_config.d.ts +0 -1
  7. package/api/chia/server/outbound_message.d.ts +1 -0
  8. package/api/chia/{types/name_puzzle_condition.js → server/outbound_message.js} +0 -0
  9. package/api/chia/timelord/types.d.ts +1 -0
  10. package/api/chia/{wallet/util/backup_utils.js → timelord/types.js} +0 -0
  11. package/api/chia/types/coin_record.d.ts +3 -1
  12. package/api/chia/types/spend_bundle_condition.d.ts +18 -0
  13. package/api/chia/{wallet/util/trade_utils.js → types/spend_bundle_condition.js} +0 -0
  14. package/api/chia/wallet/cat_wallet/cat_constants.d.ts +6 -0
  15. package/api/chia/wallet/cat_wallet/cat_constants.js +2 -0
  16. package/api/chia/wallet/trade_record.d.ts +24 -0
  17. package/api/chia/wallet/trade_record.js +1 -0
  18. package/api/chia/wallet/transaction_record.d.ts +7 -2
  19. package/api/chia/wallet/util/wallet_types.d.ts +1 -1
  20. package/api/chia/wallet/util/wallet_types.js +1 -1
  21. package/api/rpc/common/index.d.ts +40 -0
  22. package/api/rpc/common/index.js +48 -0
  23. package/api/rpc/crawler/index.d.ts +29 -0
  24. package/api/rpc/crawler/index.js +27 -0
  25. package/api/rpc/full_node/index.d.ts +39 -8
  26. package/api/rpc/full_node/index.js +21 -1
  27. package/api/rpc/index.d.ts +13 -7
  28. package/api/rpc/index.js +36 -12
  29. package/api/rpc/wallet/index.d.ts +198 -114
  30. package/api/rpc/wallet/index.js +98 -49
  31. package/api/types.d.ts +16 -0
  32. package/api/types.js +2 -1
  33. package/api/ws/crawler/index.d.ts +25 -0
  34. package/api/ws/crawler/index.js +40 -0
  35. package/api/ws/daemon/index.d.ts +8 -0
  36. package/api/ws/daemon/index.js +9 -2
  37. package/api/ws/farmer/index.d.ts +9 -3
  38. package/api/ws/farmer/index.js +15 -2
  39. package/api/ws/full_node/index.d.ts +50 -4
  40. package/api/ws/full_node/index.js +40 -1
  41. package/api/ws/harvester/index.d.ts +9 -3
  42. package/api/ws/harvester/index.js +14 -1
  43. package/api/ws/index.d.ts +22 -16
  44. package/api/ws/index.js +52 -32
  45. package/api/ws/timelord/index.d.ts +38 -0
  46. package/api/ws/timelord/index.js +66 -0
  47. package/api/ws/wallet/index.d.ts +32 -6
  48. package/api/ws/wallet/index.js +42 -3
  49. package/daemon/connection.d.ts +2 -2
  50. package/daemon/index.d.ts +6 -6
  51. package/index.d.ts +0 -2
  52. package/package.json +2 -2
  53. package/api/chia/types/condition_opcodes.d.ts +0 -20
  54. package/api/chia/types/condition_opcodes.js +0 -31
  55. package/api/chia/types/condition_with_args.d.ts +0 -6
  56. package/api/chia/types/name_puzzle_condition.d.ts +0 -8
  57. package/api/chia/wallet/util/backup_utils.d.ts +0 -25
  58. package/api/chia/wallet/util/trade_utils.d.ts +0 -11
package/CHANGELOG.md CHANGED
@@ -1,8 +1,154 @@
1
1
  # Changelog
2
2
 
3
+ ## [5.0.0]
4
+ ### Breaking Change
5
+ - At chia-blockchain@1.3.4, in `chia/consensus/cost_calculator.py`,
6
+ `NPCResult.npc_list` was removed and `NPCResult.conds` was added.
7
+ As a result, the RPC APIs below might be incompatible between `1.3.3` and `1.3.4`.
8
+ - `get_all_mempool_items` Of FullNode RPC API
9
+ - `get_mempool_item_by_tx_id` Of FullNode RPC API
10
+ ### Added
11
+ - [New FullNode RPC API](./src/api/rpc/full_node)
12
+ - [`get_coin_records_by_hint`](./src/api/rpc/full_node/README.md#get_coin_records_by_hintagent-params)
13
+ - [New Wallet RPC API](./src/api/rpc/wallet)
14
+ - [`select_coins`](./src/api/rpc/wallet/README.md#select_coinsagent-params)
15
+ - [`get_stray_cats`](./src/api/rpc/wallet/README.md#get_stray_catsagent)
16
+ ### Changed
17
+ - [FullNode RPC API](./src/api/rpc/full_node)
18
+ - Updated [`get_additions_and_removals`](./src/api/rpc/full_node/README.md#get_additions_and_removalsagent-params)
19
+ - [Wallet RPC API](./src/api/rpc/wallet)
20
+ - Updated [`get_wallets`](./src/api/rpc/wallet/README.md#get_walletsagent-params)
21
+ - Updated [`pw_absorb_rewards`](./src/api/rpc/wallet/README.md#pw_absorb_rewardsagent-params)
22
+ - The following APIs changed because a new property was added to `TradeRecord` class at `chia/wallet/trade_record.py`
23
+ This is not a breaking change because just adding a property is backward compatible.
24
+ - [`create_offer_for_ids`](./src/api/rpc/wallet/README.md#create_offer_for_idsagent-params)
25
+ - [`take_offer`](./src/api/rpc/wallet/README.md#take_offeragent-params)
26
+ - [`get_offer`](./src/api/rpc/wallet/README.md#get_offeragent-params)
27
+ - [`get_all_offers`](./src/api/rpc/wallet/README.md#get_all_offersagent-params)
28
+ ### Fixed
29
+ - Fixed issues where the following full_node RPC APIs were not exported from `api/rpc/index.ts`.
30
+ - `get_coin_record_by_names`
31
+ - `get_coin_records_by_parent_ids`
32
+ - Fixed issues where the following wallet RPC APIs were not exported from `api/rpc/index.ts`.
33
+ - `delete_unconfirmed_transactions`
34
+ - Fixed an issue where README description of `get_blockchain_state` of FullNode RPC API was missing some properties.
35
+
36
+ ## [4.0.0]
37
+ ### Breaking Change
38
+ - At chia-blockchain@1.3.0, in `chia/consensus/cost_calculator.py`,
39
+ `NPCResult.clvm_cost` was renamed to `NPCResult.cost`.
40
+ As a result, the RPC APIs below might be incompatible between `1.2.11` and `1.3.0`.
41
+ - `get_all_mempool_items` Of FullNode RPC API
42
+ - `get_mempool_item_by_tx_id` Of FullNode RPC API
43
+ - In `chia/pools/pool_config.py`,
44
+ `authentication_public_key` was removed from `PoolWalletConfig`.
45
+ As a result, the RPC APIs below might be incompatible between `1.2.11` and `1.3.0`.
46
+ - `get_pool_state` of Farmer RPC API
47
+ - In `chia/types/coin_record.py`, `CoinRecord.spent` was removed and turned into a getter method.
48
+ As a result, the RPC APIs below might be incompatible between `1.2.11` and `1.3.0`.
49
+ - `get_additions_and_removals` of FullNode RPC API
50
+ - Wallet RPC API `create_backup` was removed
51
+ - Wallet RPC API `get_discrepancies_for_offer` was removed
52
+ - Wallet RPC API `respond_to_offer` was removed
53
+ - Wallet RPC API `get_trade` was removed
54
+ - Wallet RPC API `get_all_trades` was removed
55
+ - Wallet RPC API `cancel_trade` was removed
56
+ - Wallet RPC API `cc_set_name` was renamed to `cat_set_name`
57
+ - Wallet RPC API `cc_get_name` was renamed to `cat_get_name`
58
+ - Wallet RPC API `cc_spend` was renamed to `cat_spend`
59
+ - Wallet RPC API `cc_get_colour` was renamed to `cat_get_asset_id`
60
+ - The request parameter of Wallet RPC API `create_offer_for_ids` was changed and incompatible with older API.
61
+ - The request parameter of Wallet RPC API `create_new_wallet` was changed and incompatible with older API.
62
+ ### Removed
63
+ - Removed `create_backup` of Wallet RPC API
64
+ - Removed `get_discrepancies_for_offer` of Wallet RPC API
65
+ - Removed `respond_to_offer` of Wallet RPC API
66
+ - Removed `get_trade` of Wallet RPC API
67
+ - Removed `get_all_trades` of Wallet RPC API
68
+ - Removed `cancel_trade` of Wallet RPC API
69
+ - Removed `TradeRecordInJson` at `src/api/chia/wallet/util/trade_utils.ts`
70
+ ### Added
71
+ - Added `metrics` service
72
+ - [Common RPC API](./src/api/rpc/common)
73
+ - [`get_connections`](./src/api/rpc/common/README.md#get_connectionsagent-params)
74
+ - [`open_connection`](./src/api/rpc/common/README.md#open_connectionagent-params)
75
+ - [`close_connection`](./src/api/rpc/common/README.md#close_connectionagent-params)
76
+ - [`stop_node`](./src/api/rpc/common/README.md#stop_nodeagent)
77
+ - [`get_routes`](./src/api/rpc/common/README.md#get_routesagent)
78
+ - [Timelord WebSocket API](./src/api/ws/timelord/README.md#usage)
79
+ - [`finished_pot`](./src/api/ws/timelord/README.md#on_finished_pot)
80
+ - [`new_compact_proof`](./src/api/ws/timelord/README.md#on_new_compact_proof)
81
+ - [`skipping_peak`](./src/api/ws/timelord/README.md#on_skipping_peak)
82
+ - [`new_peak`](./src/api/ws/timelord/README.md#on_new_peak)
83
+ - [Crawler RPC API](./src/api/rpc/crawler)
84
+ - [`get_peer_counts`](./src/api/rpc/crawler/README.md#get_peer_countsagent)
85
+ - [`get_ips_after_timestamp`](./src/api/rpc/crawler/README.md#get_ips_after_timestampagent-params)
86
+ - [Crawler WebSocket API](./src/api/ws/crawler)
87
+ - [`on_message_from_crawler`](./src/api/ws/crawler/README.md#on_message_from_crawler)
88
+ - [`on_loaded_initial_peers`](./src/api/ws/crawler/README.md#on_loaded_initial_peers)
89
+ - [`on_crawl_batch_completed`](./src/api/ws/crawler/README.md#on_crawl_batch_completed)
90
+ - [New farmer WebSocket API](./src/api/ws/farmer)
91
+ - [`get_connections`](./src/api/ws/farmer/README.md#on_get_connections)
92
+ - [New FullNode RPC API](./src/api/rpc/full_node)
93
+ - [`get_block_count_metrics`](./src/api/rpc/full_node/README.md#get_block_count_metricsagent)
94
+ - [New FullNode WebSocket API](./src/api/ws/full_node)
95
+ - [`get_connections`](./src/api/ws/full_node/README.md#on_get_connections)
96
+ - [`block`](./src/api/ws/full_node/README.md#on_block)
97
+ - [`signage_point`](./src/api/ws/full_node/README.md#on_signage_point)
98
+ - [New harvester WebSocket API](./src/api/ws/harvester)
99
+ - [`get_connections`](./src/api/ws/harvester/README.md#on_get_connections)
100
+ - [New wallet RPC API](./src/api/rpc/wallet)
101
+ - [`get_logged_in_fingerprint`](./src/api/rpc/wallet/README.md#get_logged_in_fingerprintagent)
102
+ - [`push_tx`](./src/api/rpc/wallet/README.md#push_txagent-params)
103
+ - [`cat_asset_id_to_name`](./src/api/rpc/wallet/README.md#cat_asset_id_to_nameagent-params)
104
+ - [`get_offer_summary`](./src/api/rpc/wallet/README.md#get_offer_summaryagent-params)
105
+ - [`check_offer_validity`](./src/api/rpc/wallet/README.md#check_offer_validityagent-params)
106
+ - [`take_offer`](./src/api/rpc/wallet/README.md#take_offeragent-params)
107
+ - [`get_offer`](./src/api/rpc/wallet/README.md#get_offeragent-params)
108
+ - [`get_all_offers`](./src/api/rpc/wallet/README.md#get_all_offersagent-params)
109
+ - [`get_offers_count`](./src/api/rpc/wallet/README.md#get_offers_countagent)
110
+ - [`cancel_offer`](./src/api/rpc/wallet/README.md#cancel_offeragent-params)
111
+ - [`get_cat_list`](./src/api/rpc/wallet/README.md#get_cat_listagent)
112
+ - [New wallet WebSocket API](./src/api/ws/wallet)
113
+ - [`get_connections`](./src/api/ws/wallet/README.md#on_get_connections)
114
+ - [`sync_changed`](./src/api/ws/wallet/README.md#on_sync_changed_of_wallet)
115
+ - [`coin_added`](./src/api/ws/wallet/README.md#on_coin_added)
116
+ - [New daemon API](./src/api/ws/daemon)
117
+ - [`get_version`](./src/api/ws/daemon/README.md#get_versiondaemon)
118
+ ### Changed
119
+ - Renamed `NPCResult.clvm_cost` to `NPCResult.cost`
120
+ - Removed `authentication_public_key` from `PoolWalletConfig`
121
+ - Set actual value to `destination` property on websocket APIs. (i.e. `wallet_ui`, `metrics`)
122
+ - Updated [`get_blockchain_state`](./src/api/rpc/full_node/README.md#get_blockchain_stateagent) of FullNode RPC API
123
+ - Updated [`get_blocks`](./src/api/rpc/full_node/README.md#get_blocksagent-params) of FullNode RPC API
124
+ - Renamed `cc_set_name` of Wallet RPC API to [`cat_set_name`](./src/api/rpc/wallet/README.md#cat_set_nameagent-params)
125
+ - Renamed `cc_get_name` of Wallet RPC API to [`cat_get_name`](./src/api/rpc/wallet/README.md#cat_get_nameagent-params)
126
+ - Renamed `cc_spend` of Wallet RPC API to [`cat_spend`](./src/api/rpc/wallet/README.md#cat_spendagent-params)
127
+ - Renamed `cc_get_colour` of Wallet RPC API to [`cat_get_asset_id`](./src/api/rpc/wallet/README.md#cat_get_asset_idagent-params)
128
+ - Updated [`create_offer_for_ids`](./src/api/rpc/wallet/README.md#create_offer_for_idsagent-params) of Wallet RPC API
129
+ - Updated [`log_in`](./src/api/rpc/wallet/README.md#log_inagent-params) of Wallet RPC API
130
+ - Updated [`add_key`](./src/api/rpc/wallet/README.md#add_keyagent-params) of Wallet RPC API
131
+ - Updated [`create_new_wallet`](./src/api/rpc/wallet/README.md#create_new_walletagent-params) of Wallet RPC API
132
+ - Updated [`get_wallet_balance`](./src/api/rpc/wallet/README.md#get_wallet_balanceagent-params) of Wallet RPC API
133
+ - Updated [`get_transaction`](./src/api/rpc/wallet/README.md#get_transactionagent-params) of Wallet RPC API
134
+ - Updated [`get_transactions`](./src/api/rpc/wallet/README.md#get_transactionsagent-params) of Wallet RPC API
135
+ - Updated [`send_transaction`](./src/api/rpc/wallet/README.md#send_transactionagent-params) of Wallet RPC API
136
+ - Updated [`send_transaction_multi`](./src/api/rpc/wallet/README.md#send_transaction_multiagent-params) of Wallet RPC API
137
+ - Updated [`create_signed_transaction`](./src/api/rpc/wallet/README.md#create_signed_transactionagent-params) of Wallet RPC API
138
+ - Updated [`pw_join_pool`](./src/api/rpc/wallet/README.md#pw_join_poolagent-params) of Wallet RPC API
139
+ - Updated [`pw_self_pool`](./src/api/rpc/wallet/README.md#pw_self_poolagent-params) of Wallet RPC API
140
+ - Updated [`pw_absorb_rewards`](./src/api/rpc/wallet/README.md#pw_absorb_rewardsagent-params) of Wallet RPC API
141
+ - Added `memos` to `TransactionRecord` in `src/api/chia/wallet/transaction_record.ts`.
142
+ - Renamed `COLOURED_COIN` to `CAT` of `WalletType` in `src/api/chia/wallet/util/wallet_type.ts`.
143
+ ### Fixed
144
+ - Replaced `unknown` type with actual type for `on_state_changed_of_wallet` in wallet WebSocket API
145
+
3
146
  ## [3.0.1]
4
147
  ### Added
5
148
  - Added `skip_hostname_verification` option for `RPCAgent`
149
+ ### Fixed
150
+ - Fixed an issue where wallet WebSocket message from daemon was not captured.
151
+ Thank you! @joshpainter
6
152
 
7
153
  ## [3.0.0]
8
154
  ### Minor Breaking Change
@@ -207,6 +353,8 @@ daemon.sendMessage(destination, get_block_record_by_height_command, data);
207
353
  Initial release.
208
354
 
209
355
  <!-- [Unreleased]: https://github.com/Chia-Mine/chia-agent/compare/v0.0.1...v0.0.2 -->
356
+ [5.0.0]: https://github.com/Chia-Mine/chia-agent/compare/v4.0.0...v5.0.0
357
+ [4.0.0]: https://github.com/Chia-Mine/chia-agent/compare/v3.0.1...v4.0.0
210
358
  [3.0.1]: https://github.com/Chia-Mine/chia-agent/compare/v3.0.0...v3.0.1
211
359
  [3.0.0]: https://github.com/Chia-Mine/chia-agent/compare/v2.0.6...v3.0.0
212
360
  [2.0.6]: https://github.com/Chia-Mine/chia-agent/compare/v2.0.5...v2.0.6
package/README.md CHANGED
@@ -1,16 +1,12 @@
1
- **Now supports New Pool API! :tada::tada:**
2
-
3
- ---
4
-
5
1
  # chia-agent
6
2
  [![npm version](https://badge.fury.io/js/chia-agent.svg)](https://badge.fury.io/js/chia-agent) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
3
 
8
4
  chia rpc/websocket client library for NodeJS.
9
- Supports all RPC/Websocket API available at `chia 1.2.11`.
5
+ Supports all RPC/Websocket API available at `chia 1.3.4`.
10
6
  \(If you need previous version, search for the corresponding release [here](https://github.com/Chia-Mine/chia-agent/releases)\)
11
7
 
12
8
  you can develop your own nodejs script with `chia-agent` to:
13
- - retrieve latest data from RPC servers like `farmer`, `harvester`, `full_node`, `wallet`, `pool`.
9
+ - retrieve latest data from RPC servers like `farmer`, `harvester`, `full_node`, `wallet`, `pool`, `crawler`.
14
10
  - send email when proof is found.
15
11
  - trigger scripts when target event is observed.
16
12
  - start/stop services.
@@ -26,17 +22,17 @@ yarn add chia-agent
26
22
 
27
23
  ## Compatibility
28
24
  This code is compatible with:
29
- - [`b74a3f3849cadeece2fac3efa3cb55d7d3a0647f`](https://github.com/Chia-Network/chia-blockchain/tree/b74a3f3849cadeece2fac3efa3cb55d7d3a0647f) of [chia-blockchain@1.2.11](https://github.com/Chia-Network/chia-blockchain)
30
- - [Diff to the latest chia-blockchain](https://github.com/Chia-Network/chia-blockchain/compare/b74a3f3849cadeece2fac3efa3cb55d7d3a0647f...main)
31
- - [`d6d1d0ea41b81e1c6b23688206c6ab3ba6418a95`](https://github.com/Chia-Network/pool-reference/tree/d6d1d0ea41b81e1c6b23688206c6ab3ba6418a95) of [pool-reference](https://github.com/Chia-Network/pool-reference)
32
- - [Diff to the latest pool-reference](https://github.com/Chia-Network/pool-reference/compare/d6d1d0ea41b81e1c6b23688206c6ab3ba6418a95...main)
25
+ - [`d154105a6b35f94649f15bca4e3fb8a11a39e70e`](https://github.com/Chia-Network/chia-blockchain/tree/d154105a6b35f94649f15bca4e3fb8a11a39e70e) of [chia-blockchain 1.3.4](https://github.com/Chia-Network/chia-blockchain)
26
+ - [Diff to the latest chia-blockchain](https://github.com/Chia-Network/chia-blockchain/compare/d154105a6b35f94649f15bca4e3fb8a11a39e70e...main)
27
+ - [`374e7e6dc2d6d7941bb650f0e4ac5c01db104569`](https://github.com/Chia-Network/pool-reference/tree/374e7e6dc2d6d7941bb650f0e4ac5c01db104569) of [pool-reference](https://github.com/Chia-Network/pool-reference)
28
+ - [Diff to the latest pool-reference](https://github.com/Chia-Network/pool-reference/compare/374e7e6dc2d6d7941bb650f0e4ac5c01db104569...main)
33
29
 
34
30
  ## API
35
31
  There are 2 kinds of APIs in chia.
36
32
  `RPC API` and `Websocket API`.
37
33
 
38
34
  ### RPC API
39
- RPC API is used to send message directly to chia services like `farmer`, `harvester`, `full_node`, `wallet`.
35
+ RPC API is used to send message directly to chia services like `farmer`, `harvester`, `full_node`, `wallet`, `crawler`.
40
36
 
41
37
  RPC API is just an async function in a traditional request/response style.
42
38
 
@@ -0,0 +1 @@
1
+ export declare type ReceiveBlockResult = 1 | 2 | 3 | 4 | 5;
@@ -1,7 +1,7 @@
1
- import { NPC } from "../types/name_puzzle_condition";
1
+ import { SpendBundleConditions } from "../types/spend_bundle_condition";
2
2
  import { Optional, uint16, uint64 } from "../types/_python_types_";
3
3
  export declare type NPCResult = {
4
4
  error: Optional<uint16>;
5
- npc_list: NPC[];
6
- clvm_cost: uint64;
5
+ conds: Optional<SpendBundleConditions>;
6
+ cost: uint64;
7
7
  };
@@ -7,5 +7,4 @@ export declare type PoolWalletConfig = {
7
7
  target_puzzle_hash: bytes32;
8
8
  p2_singleton_puzzle_hash: bytes32;
9
9
  owner_public_key: G1Element;
10
- authentication_public_key: G1Element;
11
10
  };
@@ -0,0 +1 @@
1
+ export declare type NodeType = 1 | 2 | 3 | 4 | 5 | 6;
@@ -0,0 +1 @@
1
+ export declare type Chain = 1 | 2 | 3 | 4;
@@ -4,7 +4,9 @@ export declare type CoinRecord = {
4
4
  coin: Coin;
5
5
  confirmed_block_index: uint32;
6
6
  spent_block_index: uint32;
7
- spent: bool;
8
7
  coinbase: bool;
9
8
  timestamp: uint64;
10
9
  };
10
+ export declare type CoinRecordBackwardCompatible = CoinRecord & {
11
+ spent: bool;
12
+ };
@@ -0,0 +1,18 @@
1
+ import { bytes32, bytes48 } from "./blockchain_format/sized_bytes";
2
+ import { bytes, Optional, uint32, uint64 } from "./_python_types_";
3
+ export declare type Spend = {
4
+ coin_id: bytes32;
5
+ puzzle_hash: bytes32;
6
+ height_relative: Optional<uint32>;
7
+ seconds_relative: uint64;
8
+ create_coin: Array<[bytes32, uint64, bytes]>;
9
+ agg_sig_me: Array<[bytes48, bytes]>;
10
+ };
11
+ export declare type SpendBundleConditions = {
12
+ spends: Spend[];
13
+ reserve_fee: uint64;
14
+ height_absolute: uint32;
15
+ seconds_absolute: uint64;
16
+ agg_sig_unsafe: Array<[bytes48, bytes]>;
17
+ cost: uint64;
18
+ };
@@ -0,0 +1,6 @@
1
+ import { str } from "../../types/_python_types_";
2
+ export declare type CAT = {
3
+ asset_id: str;
4
+ name: str;
5
+ symbol: str;
6
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,24 @@
1
+ import { bool, bytes, int, Optional, str, uint32, uint64, uint8 } from "../types/_python_types_";
2
+ import { Coin } from "../types/blockchain_format/coin";
3
+ import { bytes32 } from "../types/blockchain_format/sized_bytes";
4
+ export declare type TradeRecord = {
5
+ confirmed_at_index: uint32;
6
+ accepted_at_time: Optional<uint64>;
7
+ created_at_time: uint64;
8
+ is_my_offer: bool;
9
+ sent: uint32;
10
+ offer: bytes;
11
+ taken_offer: Optional<bytes>;
12
+ coins_of_interest: Coin[];
13
+ trade_id: bytes32;
14
+ status: uint32;
15
+ sent_to: Array<[str, uint8, Optional<str>]>;
16
+ };
17
+ export declare type TradeRecordConvenience = {
18
+ summary: {
19
+ offered: Record<str, int>;
20
+ requested: Record<str, int>;
21
+ fees: int;
22
+ };
23
+ pending: Record<str, int>;
24
+ } & Omit<TradeRecord, "offer">;
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  // dependency: TradeRecord, by: `get_trade` of Wallet RPC API
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- import { bool, Optional, uint32, uint64, uint8 } from "../types/_python_types_";
1
+ import { bool, bytes, Optional, str, uint32, uint64, uint8 } from "../types/_python_types_";
2
2
  import { SpendBundle } from "../types/spend_bundle";
3
3
  import { Coin } from "../types/blockchain_format/coin";
4
4
  import { bytes32 } from "../types/blockchain_format/sized_bytes";
@@ -12,10 +12,15 @@ export declare type TransactionRecord = {
12
12
  sent: uint32;
13
13
  spend_bundle: Optional<SpendBundle>;
14
14
  additions: Coin[];
15
- removals: Coin;
15
+ removals: Coin[];
16
16
  wallet_id: uint32;
17
17
  sent_to: Array<[string, uint8, string | undefined]>;
18
18
  trade_id: Optional<bytes32>;
19
19
  type: uint32;
20
20
  name: bytes32;
21
+ memos: Array<[bytes32, bytes[]]>;
21
22
  };
23
+ export declare type TransactionRecordConvenience = {
24
+ to_address: str;
25
+ memos: Record<str, str>;
26
+ } & TransactionRecord;
@@ -5,7 +5,7 @@ export declare const WalletType: {
5
5
  AUTHORIZED_PAYEE: number;
6
6
  MULTI_SIG: number;
7
7
  CUSTODY: number;
8
- COLOURED_COIN: number;
8
+ CAT: number;
9
9
  RECOVERABLE: number;
10
10
  DISTRIBUTED_ID: number;
11
11
  POOLING_WALLET: number;
@@ -9,7 +9,7 @@ exports.WalletType = {
9
9
  AUTHORIZED_PAYEE: 3,
10
10
  MULTI_SIG: 4,
11
11
  CUSTODY: 5,
12
- COLOURED_COIN: 6,
12
+ CAT: 6,
13
13
  RECOVERABLE: 7,
14
14
  DISTRIBUTED_ID: 8,
15
15
  POOLING_WALLET: 9,
@@ -0,0 +1,40 @@
1
+ import { str, uint16 } from "../../chia/types/_python_types_";
2
+ import { TRPCAgent } from "../../../rpc/index";
3
+ import { TConnectionGeneral } from "../../types";
4
+ import { TConnectionFullNode } from "../../ws/full_node/index";
5
+ export declare const chia_common_service = "";
6
+ export declare type chia_common_service = typeof chia_common_service;
7
+ export declare const get_connections_command = "get_connections";
8
+ export declare type get_connections_command = typeof get_connections_command;
9
+ export declare type TGetConnectionsRequest = {
10
+ node_type?: str;
11
+ };
12
+ export declare type TGetConnectionsResponse = {
13
+ connections: TConnectionGeneral[] | TConnectionFullNode[];
14
+ };
15
+ export declare function get_connections(agent: TRPCAgent, params: TGetConnectionsRequest): Promise<TGetConnectionsResponse>;
16
+ export declare const open_connection_command = "open_connection";
17
+ export declare type open_connection_command = typeof open_connection_command;
18
+ export declare type TOpenConnectionRequest = {
19
+ host: str;
20
+ port: uint16;
21
+ };
22
+ export declare type TOpenConnectionResponse = {};
23
+ export declare function open_connection(agent: TRPCAgent, params: TOpenConnectionRequest): Promise<TOpenConnectionResponse>;
24
+ export declare const close_connection_command = "close_connection";
25
+ export declare type close_connection_command = typeof close_connection_command;
26
+ export declare type TCloseConnectionRequest = {
27
+ node_id: str;
28
+ };
29
+ export declare type TCloseConnectionResponse = {};
30
+ export declare function close_connection(agent: TRPCAgent, params: TCloseConnectionRequest): Promise<TCloseConnectionResponse>;
31
+ export declare const stop_node_command = "stop_node";
32
+ export declare type stop_node_command = typeof stop_node_command;
33
+ export declare type TStopNodeResponse = {};
34
+ export declare function stop_node(agent: TRPCAgent): Promise<TStopNodeResponse>;
35
+ export declare const get_routes_command = "get_routes";
36
+ export declare type get_routes_command = typeof get_routes_command;
37
+ export declare type TGetRoutesResponse = {
38
+ routes: str[];
39
+ };
40
+ export declare function get_routes(agent: TRPCAgent): Promise<TGetRoutesResponse>;
@@ -0,0 +1,48 @@
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.get_routes = exports.get_routes_command = exports.stop_node = exports.stop_node_command = exports.close_connection = exports.close_connection_command = exports.open_connection = exports.open_connection_command = exports.get_connections = exports.get_connections_command = exports.chia_common_service = void 0;
13
+ exports.chia_common_service = "";
14
+ exports.get_connections_command = "get_connections";
15
+ function get_connections(agent, params) {
16
+ return __awaiter(this, void 0, void 0, function* () {
17
+ return agent.sendMessage(exports.chia_common_service, exports.get_connections_command, params);
18
+ });
19
+ }
20
+ exports.get_connections = get_connections;
21
+ exports.open_connection_command = "open_connection";
22
+ function open_connection(agent, params) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ return agent.sendMessage(exports.chia_common_service, exports.open_connection_command, params);
25
+ });
26
+ }
27
+ exports.open_connection = open_connection;
28
+ exports.close_connection_command = "close_connection";
29
+ function close_connection(agent, params) {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ return agent.sendMessage(exports.chia_common_service, exports.close_connection_command, params);
32
+ });
33
+ }
34
+ exports.close_connection = close_connection;
35
+ exports.stop_node_command = "stop_node";
36
+ function stop_node(agent) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ return agent.sendMessage(exports.chia_common_service, exports.stop_node_command);
39
+ });
40
+ }
41
+ exports.stop_node = stop_node;
42
+ exports.get_routes_command = "get_routes";
43
+ function get_routes(agent) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ return agent.sendMessage(exports.chia_common_service, exports.get_routes_command);
46
+ });
47
+ }
48
+ exports.get_routes = get_routes;
@@ -0,0 +1,29 @@
1
+ import { int, str, uint64 } from "../../chia/types/_python_types_";
2
+ import { bytes32 } from "../../chia/types/blockchain_format/sized_bytes";
3
+ import { TRPCAgent } from "../../../rpc/index";
4
+ export declare const chia_crawler_service = "chia_crawler";
5
+ export declare type chia_crawler_service = typeof chia_crawler_service;
6
+ export declare const get_peer_counts_command = "get_peer_counts";
7
+ export declare type get_peer_counts_command = typeof get_peer_counts_command;
8
+ export declare type TGetPeerCountsResponse = {
9
+ peer_counts: {
10
+ total_last_5_days: int;
11
+ reliable_nodes: int;
12
+ ipv4_last_5_days: bytes32;
13
+ ipv6_last_5_days: uint64;
14
+ versions: Record<str, int>;
15
+ };
16
+ };
17
+ export declare function get_peer_counts(agent: TRPCAgent): Promise<TGetPeerCountsResponse>;
18
+ export declare const get_ips_after_timestamp_command = "get_ips_after_timestamp";
19
+ export declare type get_ips_after_timestamp_command = typeof get_ips_after_timestamp_command;
20
+ export declare type TGetIpsAfterTimestampRequest = {
21
+ after: int;
22
+ offset?: int;
23
+ limit?: int;
24
+ };
25
+ export declare type TGetIpsAfterTimestampResponse = {
26
+ ips: str[];
27
+ total: int;
28
+ };
29
+ export declare function get_ips_after_timestamp(agent: TRPCAgent, params: TGetIpsAfterTimestampRequest): Promise<TGetIpsAfterTimestampResponse>;
@@ -0,0 +1,27 @@
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.get_ips_after_timestamp = exports.get_ips_after_timestamp_command = exports.get_peer_counts = exports.get_peer_counts_command = exports.chia_crawler_service = void 0;
13
+ exports.chia_crawler_service = "chia_crawler";
14
+ exports.get_peer_counts_command = "get_peer_counts";
15
+ function get_peer_counts(agent) {
16
+ return __awaiter(this, void 0, void 0, function* () {
17
+ return agent.sendMessage(exports.chia_crawler_service, exports.get_peer_counts_command);
18
+ });
19
+ }
20
+ exports.get_peer_counts = get_peer_counts;
21
+ exports.get_ips_after_timestamp_command = "get_ips_after_timestamp";
22
+ function get_ips_after_timestamp(agent, params) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ return agent.sendMessage(exports.chia_crawler_service, exports.get_ips_after_timestamp_command, params);
25
+ });
26
+ }
27
+ exports.get_ips_after_timestamp = get_ips_after_timestamp;
@@ -2,7 +2,7 @@ import { FullBlock } from "../../chia/types/full_block";
2
2
  import { BlockRecord } from "../../chia/consensus/block_record";
3
3
  import { bool, float, int, Optional, str, uint128, uint32, uint64 } from "../../chia/types/_python_types_";
4
4
  import { UnfinishedHeaderBlock } from "../../chia/types/unfinished_header_block";
5
- import { CoinRecord } from "../../chia/types/coin_record";
5
+ import { CoinRecordBackwardCompatible } from "../../chia/types/coin_record";
6
6
  import { SpendBundle } from "../../chia/types/spend_bundle";
7
7
  import { bytes32 } from "../../chia/types/blockchain_format/sized_bytes";
8
8
  import { MempoolItem } from "../../chia/types/mempool_item";
@@ -29,6 +29,13 @@ export declare type TGetBlockchainStateResponse = {
29
29
  sub_slot_iters: uint64;
30
30
  space: uint128;
31
31
  mempool_size: int;
32
+ mempool_cost: int;
33
+ mempool_min_fees: {
34
+ cost_5000000: float;
35
+ };
36
+ mempool_max_total_cost: int;
37
+ block_max_cost: int;
38
+ node_id: str;
32
39
  };
33
40
  };
34
41
  export declare function get_blockchain_state(agent: TRPCAgent): Promise<TGetBlockchainStateResponse>;
@@ -47,6 +54,7 @@ export declare type TGetBlocksRequest = {
47
54
  start: int;
48
55
  end: int;
49
56
  exclude_header_hash?: bool;
57
+ exclude_reorged?: bool;
50
58
  };
51
59
  export declare type TGetBlocksResponse = {
52
60
  blocks: FullBlock[] | Array<FullBlock & {
@@ -54,6 +62,16 @@ export declare type TGetBlocksResponse = {
54
62
  }>;
55
63
  };
56
64
  export declare function get_blocks(agent: TRPCAgent, data: TGetBlocksRequest): Promise<TGetBlocksResponse>;
65
+ export declare const get_block_count_metrics_command = "get_block_count_metrics";
66
+ export declare type get_block_count_metrics_command = typeof get_block_count_metrics_command;
67
+ export declare type TGetBlockCountMetricsResponse = {
68
+ metrics: {
69
+ "compact_blocks": int;
70
+ "uncompact_blocks": int;
71
+ "hint_count": int;
72
+ };
73
+ };
74
+ export declare function get_block_count_metrics(agent: TRPCAgent): Promise<TGetBlockCountMetricsResponse>;
57
75
  export declare const get_block_record_by_height_command = "get_block_record_by_height";
58
76
  export declare type get_block_record_by_height_command = typeof get_block_record_by_height_command;
59
77
  export declare type TGetBlockRecordByHeightRequest = {
@@ -105,8 +123,8 @@ export declare type TGetAdditionsAndRemovalsRequest = {
105
123
  header_hash: str;
106
124
  };
107
125
  export declare type TGetAdditionsAndRemovalsResponse = {
108
- additions: CoinRecord[];
109
- removals: CoinRecord[];
126
+ additions: CoinRecordBackwardCompatible[];
127
+ removals: CoinRecordBackwardCompatible[];
110
128
  };
111
129
  export declare function get_additions_and_removals(agent: TRPCAgent, data: TGetAdditionsAndRemovalsRequest): Promise<TGetAdditionsAndRemovalsResponse>;
112
130
  export declare const get_initial_freeze_period_command_of_full_node = "get_initial_freeze_period";
@@ -150,7 +168,7 @@ export declare type TGetCoinRecordsByPuzzleHashRequest = {
150
168
  include_spent_coins: bool;
151
169
  };
152
170
  export declare type TGetCoinRecordsByPuzzleHashResponse = {
153
- coin_records: CoinRecord[];
171
+ coin_records: CoinRecordBackwardCompatible[];
154
172
  };
155
173
  export declare function get_coin_records_by_puzzle_hash(agent: TRPCAgent, data: TGetCoinRecordsByPuzzleHashRequest): Promise<TGetCoinRecordsByPuzzleHashResponse>;
156
174
  export declare const get_coin_records_by_puzzle_hashes_command = "get_coin_records_by_puzzle_hashes";
@@ -162,7 +180,7 @@ export declare type TGetCoinRecordsByPuzzleHashesRequest = {
162
180
  include_spent_coins: bool;
163
181
  };
164
182
  export declare type TGetCoinRecordsByPuzzleHashesResponse = {
165
- coin_records: CoinRecord[];
183
+ coin_records: CoinRecordBackwardCompatible[];
166
184
  };
167
185
  export declare function get_coin_records_by_puzzle_hashes(agent: TRPCAgent, data: TGetCoinRecordsByPuzzleHashesRequest): Promise<TGetCoinRecordsByPuzzleHashesResponse>;
168
186
  export declare const get_coin_record_by_name_command = "get_coin_record_by_name";
@@ -171,7 +189,7 @@ export declare type TGetCoinRecordByNameRequest = {
171
189
  name: str;
172
190
  };
173
191
  export declare type TGetCoinRecordByNameResponse = {
174
- coin_record: CoinRecord;
192
+ coin_record: CoinRecordBackwardCompatible;
175
193
  };
176
194
  export declare function get_coin_record_by_name(agent: TRPCAgent, data: TGetCoinRecordByNameRequest): Promise<TGetCoinRecordByNameResponse>;
177
195
  export declare const get_coin_records_by_names_command = "get_coin_records_by_names";
@@ -183,7 +201,7 @@ export declare type TGetCoinRecordsByNamesRequest = {
183
201
  include_spent_coins?: bool;
184
202
  };
185
203
  export declare type TGetCoinRecordsByNamesResponse = {
186
- coin_records: CoinRecord[];
204
+ coin_records: CoinRecordBackwardCompatible[];
187
205
  };
188
206
  export declare function get_coin_records_by_names(agent: TRPCAgent, data: TGetCoinRecordsByNamesRequest): Promise<TGetCoinRecordsByNamesResponse>;
189
207
  export declare const get_coin_records_by_parent_ids_command = "get_coin_records_by_parent_ids";
@@ -195,8 +213,21 @@ export declare type TGetCoinRecordsByParentIdsRequest = {
195
213
  include_spent_coins?: bool;
196
214
  };
197
215
  export declare type TGetCoinRecordsByParentIdsResponse = {
198
- coin_records: CoinRecord[];
216
+ coin_records: CoinRecordBackwardCompatible[];
217
+ };
218
+ export declare function get_coin_records_by_parent_ids(agent: TRPCAgent, data: TGetCoinRecordsByParentIdsRequest): Promise<TGetCoinRecordsByParentIdsResponse>;
219
+ export declare const get_coin_records_by_hint_command = "get_coin_records_by_hint";
220
+ export declare type get_coin_records_by_hint_command = typeof get_coin_records_by_hint_command;
221
+ export declare type TGetCoinRecordsByHintRequest = {
222
+ hint: str;
223
+ start_height?: uint32;
224
+ end_height?: uint32;
225
+ include_spent_coins?: bool;
226
+ };
227
+ export declare type TGetCoinRecordsByHintResponse = {
228
+ coin_records: CoinRecordBackwardCompatible[];
199
229
  };
230
+ export declare function get_coin_records_by_hint(agent: TRPCAgent, data: TGetCoinRecordsByHintRequest): Promise<TGetCoinRecordsByHintResponse>;
200
231
  export declare const push_tx_command = "push_tx";
201
232
  export declare type push_tx_command = typeof push_tx_command;
202
233
  export declare type TPushTxRequest = {