chia-agent 14.3.3 → 14.5.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 CHANGED
@@ -1,5 +1,111 @@
1
1
  # Changelog
2
2
 
3
+ ## [14.5.0]
4
+ ### Changed
5
+ - Added error logs
6
+ - [Wallet RPC API](./src/api/rpc/wallet)
7
+ - Added CHIP-0029 support for the following Wallet RPC APIs
8
+ - [`set_wallet_resync_on_startup`](./src/api/rpc/wallet/README.md#set_wallet_resync_on_startupagent-params)
9
+ - [`get_sync_status`](./src/api/rpc/wallet/README.md#get_sync_statusagent)
10
+ - [`get_height_info`](./src/api/rpc/wallet/README.md#get_height_infoagent)
11
+ - [`push_tx`](./src/api/rpc/wallet/README.md#push_txagent-params)
12
+ - [`push_transactions`](./src/api/rpc/wallet/README.md#push_transactionsagent-params)
13
+ - [`get_timestamp_for_height`](./src/api/rpc/wallet/README.md#get_timestamp_for_heightagent)
14
+ - [`set_auto_claim`](./src/api/rpc/wallet/README.md#set_auto_claimagent-params)
15
+ - [`get_auto_claim`](./src/api/rpc/wallet/README.md#get_auto_claimagent-params)
16
+ - [`vc_mint`](./src/api/rpc/wallet/README.md#vc_mintagent-params)
17
+ - [`vc_get`](./src/api/rpc/wallet/README.md#vc_getagent-params)
18
+ - [`vc_get_list`](./src/api/rpc/wallet/README.md#vc_get_listagent-params)
19
+ - [`vc_spend`](./src/api/rpc/wallet/README.md#vc_spendagent-params)
20
+ - [`vc_add_proofs`](./src/api/rpc/wallet/README.md#vc_add_proofsagent-params)
21
+ - [`vc_get_proofs_for_root`](./src/api/rpc/wallet/README.md#vc_get_proofs_for_rootagent-params)
22
+ - [`vc_revoke`](./src/api/rpc/wallet/README.md#vc_revokeagent-params)
23
+ - [`vc_get_list`](./src/api/rpc/wallet/README.md#vc_get_listagent-params)
24
+ - Changed the response type of `proofs`
25
+ - [`vc_add_proofs`](./src/api/rpc/wallet/README.md#vc_add_proofsagent-params)
26
+ - Changed the request type
27
+ - [`vc_get_proofs_for_root`](./src/api/rpc/wallet/README.md#vc_get_proofs_for_rootagent-params)
28
+ - Changed the response type
29
+ - [`vc_mint`](./src/api/rpc/wallet/README.md#vc_mintagent-params)
30
+ - Removed `signing_responses` from the response properties.
31
+ - [`vc_spend`](./src/api/rpc/wallet/README.md#vc_spendagent-params)
32
+ - Removed `signing_responses` from the response properties.
33
+ - [`vc_revoke`](./src/api/rpc/wallet/README.md#vc_revokeagent-params)
34
+ - Removed `signing_responses` from the response properties.
35
+ - Add the following properties to `SpendBundleConditions`
36
+ - `validated_signature`
37
+ - `execution_cost`
38
+ - `condition_cost`
39
+ ### Added
40
+ - [New Common RPC API](./src/api/rpc/common)
41
+ - [`get_log_level`](./src/api/rpc/common/README.md#get_log_levelagent)
42
+ - [`set_log_level`](./src/api/rpc/common/README.md#set_log_levelagent-params)
43
+ - [`reset_log_level`](./src/api/rpc/common/README.md#reset_log_levelagent)
44
+ ### Fixed
45
+ - [`get_timestamp_for_height`](./src/api/rpc/wallet/README.md#get_timestamp_for_heightagent)
46
+ - Fixed a missing request param
47
+ - [`vc_get`](./src/api/rpc/wallet/README.md#vc_getagent-params)
48
+ - Fixed the response type to `Optional<VCRecord>` from `VCRecord | None`.
49
+ - [`push_transactions`](./src/api/rpc/wallet/README.md#push_transactionsagent-params)
50
+ - Each element of `transactions` in the request can be `TransactionRecord`
51
+ - Fixed the type of [`TransactionEndpointResponseCHIP0029`](./src/api/chia/rpc/wallet_request_types.ts)
52
+ - Fixed a typo: `VersionBlob` -> `VersionedBlob`
53
+ - Fixed incorrect type of [`WalletCoinRecordWithMetadata`](./src/api/chia/wallet/wallet_coin_record.ts)
54
+
55
+ ## [14.4.0]
56
+ ### Changed
57
+ - Updated npm dependencies
58
+ - `ws` to 8.18.0 from 8.17.0
59
+ - `@types/ws` to 8.5.12 from 8.5.10
60
+ - Changed the response type of `spend_bundle` for some Wallet RPC API to `WalletSpendBundle` from `SpendBundle`.
61
+ (Currently `WalletSpendBundle` is equivalent to `SpendBundle`)
62
+ - [`nft_mint_bulk`](./src/api/rpc/wallet/README.md#nft_mint_bulkagent-params)
63
+ - [`nft_set_did_bulk`](./src/api/rpc/wallet/README.md#nft_set_did_bulkagent-params)
64
+ - [`nft_transfer_bulk`](./src/api/rpc/wallet/README.md#nft_transfer_bulkagent-params)
65
+ - [`did_update_metadata`](./src/api/rpc/wallet/README.md#did_update_metadataagent-params)
66
+ - [`did_message_spend`](./src/api/rpc/wallet/README.md#did_message_spendagent-params)
67
+ - [`nft_mint_nft`](./src/api/rpc/wallet/README.md#nft_mint_nftagent-params)
68
+ - [`nft_set_nft_did`](./src/api/rpc/wallet/README.md#nft_set_nft_didagent-params)
69
+ - [`nft_transfer_nft`](./src/api/rpc/wallet/README.md#nft_transfer_nftagent-params)
70
+ - [`nft_add_uri`](./src/api/rpc/wallet/README.md#nft_add_uriagent-params)
71
+ - [`log_in`](./src/api/rpc/wallet/README.md#log_inagent-params)
72
+ - Changed the type of `fingerprint` request/response properties to `uint32` from `int`
73
+ - [`get_logged_in_fingerprint`](./src/api/rpc/wallet/README.md#get_logged_in_fingerprintagent)
74
+ - Changed the type of `fingerprint` response properties to `uint32` from `int`
75
+ - [`get_public_keys`](./src/api/rpc/wallet/README.md#get_public_keysagent)
76
+ - Made response type of `public_key_fingerprints` optional and `uint32[]`
77
+ - [`get_private_key`](./src/api/rpc/wallet/README.md#get_private_keyagent-params)
78
+ - Dropped one of the possible response type where its `success` property is `False`.
79
+ - [`add_key`](./src/api/rpc/wallet/README.md#add_keyagent-params)
80
+ - Dropped one of the possible response type where its `success` property is `False`.
81
+ - Changed the type of `fingerprint` response properties to `uint32` from `int`
82
+ - [`delete_key`](./src/api/rpc/wallet/README.md#delete_keyagent-params)
83
+ - Changed the type of `fingerprint` request properties to `uint32` from `int`
84
+ - [`check_delete_key`](./src/api/rpc/wallet/README.md#check_delete_keyagent-params)
85
+ - Changed the type of `fingerprint` request/response properties to `uint32` from `int`
86
+ - Changed the type of `max_ph_to_search` request properties to `uint32?` from `int?`
87
+ - [`delete_all_keys`](./src/api/rpc/wallet/README.md#delete_all_keysagent)
88
+ - Dropped one of the possible response type where its `success` property is `False`.
89
+ - [`push_transactions`](./src/api/rpc/wallet/README.md#push_transactionsagent-params)
90
+ - Added `TXEndpointRequest` to request
91
+ - Removed `sign` request property
92
+ - Added `fee` request property
93
+ - [`select_coins`](./src/api/rpc/wallet/README.md#select_coinsagent-params)
94
+ - `CoinSelectionConfigLoader` was replaced by `TXConfigLoader`
95
+ - [`dl_owned_singletons`](./src/api/rpc/wallet/README.md#dl_owned_singletonsagent-params)
96
+ - Added error response
97
+ - Updated the type of `spend_bundle` in [`TransactionRecordOld`](./src/api/chia/wallet/transaction_record.ts) to `WalletSpendBundle` from `SpendBundle`
98
+ - Renamed `Spend` to [`SpendConditions`](./src/api/chia_rs/chia-consensus/gen/owned_conditions.ts)
99
+ ### Removed
100
+ - Removed document of `get_initial_freeze_period` (Wallet/FullNode RPC API) since it was removed in `chia-blockchain@2.4.4`
101
+ ### Added
102
+ - [New Wallet RPC API](./src/api/rpc/wallet)
103
+ - [`split_coins`](./src/api/rpc/wallet/README.md#split_coinsagent-params)
104
+ - [`combine_coins`](./src/api/rpc/wallet/README.md#combine_coinsagent-params)
105
+ ### Fixed
106
+ - Fixed `dao_rules` property was set [unknown](./src/api/chia/wallet/dao_wallet/dao_wallet.ts). (`unknown` -> `DAORules`)
107
+ - Fixed missing types in [`ParsedProposalSpend`](./src/api/chia/wallet/dao_wallet/dao_wallet.ts)
108
+
3
109
  ## [14.3.3]
4
110
  ### Changed
5
111
  - The default service name which [`Daemon`](./src/daemon/index.ts) client tries to register is now `wallet_ui`.
@@ -1720,6 +1826,8 @@ daemon.sendMessage(destination, get_block_record_by_height_command, data);
1720
1826
  Initial release.
1721
1827
 
1722
1828
  <!-- [Unreleased]: https://github.com/Chia-Mine/chia-agent/compare/v0.0.1...v0.0.2 -->
1829
+ [14.4.1]: https://github.com/Chia-Mine/chia-agent/compare/v14.4.0...v14.4.1
1830
+ [14.4.0]: https://github.com/Chia-Mine/chia-agent/compare/v14.3.3...v14.4.0
1723
1831
  [14.3.3]: https://github.com/Chia-Mine/chia-agent/compare/v14.3.2...v14.3.3
1724
1832
  [14.3.2]: https://github.com/Chia-Mine/chia-agent/compare/v14.3.1...v14.3.2
1725
1833
  [14.3.1]: https://github.com/Chia-Mine/chia-agent/compare/v14.3.0...v14.3.1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
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)
3
3
 
4
4
  chia rpc/websocket client library for NodeJS.
5
- Supports all RPC/Websocket API available at `2.4.3` of [`chia-blockchain`](https://github.com/Chia-Network/chia-blockchain/).
5
+ Supports all RPC/Websocket API available at `2.5.1`/`2.5.2` of [`chia-blockchain`](https://github.com/Chia-Network/chia-blockchain/).
6
6
  \(If you need previous version, search for the corresponding release [here](https://github.com/Chia-Mine/chia-agent/releases)\)
7
7
 
8
8
  you can develop your own nodejs script with `chia-agent` to:
@@ -22,12 +22,12 @@ yarn add chia-agent
22
22
 
23
23
  ## Compatibility
24
24
  This code is compatible with:
25
- - [`85ca5802143f6a7a0ec4e7c17c84e1ed9875770b`](https://github.com/Chia-Network/chia-blockchain/tree/85ca5802143f6a7a0ec4e7c17c84e1ed9875770b) of [chia-blockchain 2.4.3](https://github.com/Chia-Network/chia-blockchain)
26
- - [Diff to the main branch of chia-blockchain](https://github.com/Chia-Network/chia-blockchain/compare/85ca5802143f6a7a0ec4e7c17c84e1ed9875770b...main)
27
- - [`0ee875ec25d458e3537df54728ea0a9f6b402eae`](https://github.com/Chia-Network/pool-reference/tree/0ee875ec25d458e3537df54728ea0a9f6b402eae) 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/0ee875ec25d458e3537df54728ea0a9f6b402eae...main)
29
- - [`a1f567fab32c341006cad9ba83863054dbfe63f8`](https://github.com/Chia-Network/chia_rs/tree/a1f567fab32c341006cad9ba83863054dbfe63f8) of [chia_rs 0.10.0](https://github.com/Chia-Network/chia_rs)
30
- - [Diff to the main branch of chia_rs](https://github.com/Chia-Network/chia_rs/compare/a1f567fab32c341006cad9ba83863054dbfe63f8...main)
25
+ - [`ddd5a0cbcb7a4ebb106ee4d27692b3118b6fdc4a`](https://github.com/Chia-Network/chia-blockchain/tree/ddd5a0cbcb7a4ebb106ee4d27692b3118b6fdc4a) of [chia-blockchain 2.5.2](https://github.com/Chia-Network/chia-blockchain)
26
+ - [Diff to the main branch of chia-blockchain](https://github.com/Chia-Network/chia-blockchain/compare/ddd5a0cbcb7a4ebb106ee4d27692b3118b6fdc4a...main)
27
+ - [`ac72355b9220fa975bab857fe740892845017a30`](https://github.com/Chia-Network/pool-reference/tree/ac72355b9220fa975bab857fe740892845017a30) 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/ac72355b9220fa975bab857fe740892845017a30...main)
29
+ - [`0b6571ea254fe22dfc692f9ef058b6a4e224a081`](https://github.com/Chia-Network/chia_rs/tree/0b6571ea254fe22dfc692f9ef058b6a4e224a081) of [chia_rs 0.18.0](https://github.com/Chia-Network/chia_rs)
30
+ - [Diff to the main branch of chia_rs](https://github.com/Chia-Network/chia_rs/compare/0b6571ea254fe22dfc692f9ef058b6a4e224a081...main)
31
31
 
32
32
  ## API
33
33
  There are 2 kinds of APIs in chia.
@@ -1,31 +1,16 @@
1
- import { bool, False, int, str, True } from "../types/_python_types_";
2
- import { Condition, ConditionValidTimes } from "../wallet/conditions";
3
- import { TXConfigLoader, TXEndpointForCompat } from "../wallet/util/tx_config";
4
- import { UnsignedTransaction } from "../wallet/signer_protocol";
1
+ import { int, str, True } from "../types/_python_types_";
2
+ import { Condition } from "../wallet/conditions";
5
3
  export type ExtraCondition = {
6
4
  opcode: str | int;
7
5
  args: Condition;
8
6
  };
9
7
  export type TranslationLayerKey = "CHIP-0028";
10
8
  export type CHIP0029 = {
11
- "CHIP-0029"?: True;
12
- } | {
13
- "CHIP-0029"?: False;
9
+ "CHIP-0029": True;
14
10
  };
15
11
  export type Marshall = {
16
12
  translation?: TranslationLayerKey;
17
13
  } & CHIP0029;
18
- export type TXEndpointRequest = {
19
- wallet_type: str;
20
- extra_conditions?: ExtraCondition[];
21
- push?: bool;
22
- merge_spends?: bool;
23
- sign?: bool;
24
- translation?: TranslationLayerKey;
25
- } & CHIP0029 & TXConfigLoader & TXEndpointForCompat & Partial<ConditionValidTimes>;
26
- export type CHIP0029UnsignedTransaction<T extends TXEndpointRequest> = T extends {
27
- "CHIP-0029"?: True;
28
- } ? str[] : UnsignedTransaction[];
29
- export type TxeResp<Req extends TXEndpointRequest, Res> = Res & {
30
- unsigned_transactions: CHIP0029UnsignedTransaction<Req>;
31
- };
14
+ export type MaybeMarshall<T, Res, MarshalledRes> = T extends {
15
+ "CHIP-0029": True;
16
+ } ? MarshalledRes : Res;
@@ -1,8 +1,12 @@
1
- import { bool, str, uint32 } from "../types/_python_types_";
1
+ import { bool, G1Element, Optional, PrivateKey, str, uint16, uint32, uint64 } from "../types/_python_types_";
2
2
  import { bytes32 } from "../types/blockchain_format/sized_bytes";
3
3
  import { Notification } from "../wallet/notification_store";
4
- import { SignedTransaction, SigningInstructions, SigningResponse, Spend } from "../wallet/signer_protocol";
4
+ import { SignedTransaction, SigningInstructions, SigningResponse, Spend, UnsignedTransaction } from "../wallet/signer_protocol";
5
5
  import { Marshall } from "./util";
6
+ import { TransactionRecord, TransactionRecordConvenience } from "../wallet/transaction_record";
7
+ import { WalletSpendBundle } from "../wallet/wallet_spend_bundle";
8
+ import { TXEndpointRequest } from "./wallet_rpc_api";
9
+ import { VCRecord } from "../wallet/vc_wallet/vc_store";
6
10
  export type GetNotifications = {
7
11
  ids?: bytes32[];
8
12
  start?: uint32;
@@ -63,3 +67,175 @@ export type ExecuteSigningInstructionsResponse = {
63
67
  export type ExecuteSigningInstructionsResponseCHIP0029 = {
64
68
  signing_responses: str[];
65
69
  };
70
+ export type TransactionEndpointRequest = {
71
+ fee: uint64;
72
+ push?: bool;
73
+ };
74
+ export type TransactionEndpointResponse = {
75
+ unsigned_transactions: UnsignedTransaction[];
76
+ transactions: TransactionRecord[];
77
+ };
78
+ export type TransactionEndpointResponseCHIP0029 = {
79
+ unsigned_transactions: str[];
80
+ transactions: TransactionRecord[];
81
+ };
82
+ export type PushTransactions = TransactionEndpointRequest & {
83
+ transactions: Array<TransactionRecord | TransactionRecordConvenience | str>;
84
+ push: Optional<bool>;
85
+ } & TXEndpointRequest;
86
+ export type PushTransactionsCHIP0029 = PushTransactions & Marshall;
87
+ export type PushTransactionsResponse = TransactionEndpointResponse;
88
+ export type PushTransactionsResponseCHIP0029 = TransactionEndpointResponseCHIP0029;
89
+ export type GetTimestampForHeightRequest = {
90
+ height: uint32;
91
+ };
92
+ export type GetTimestampForHeightRequestCHIP0029 = GetTimestampForHeightRequest & Marshall;
93
+ export type GetTimestampForHeightResponse = {
94
+ timestamp: uint64;
95
+ };
96
+ export type SplitCoins = TransactionEndpointRequest & {
97
+ wallet_id: uint32;
98
+ number_of_coins: uint16;
99
+ amount_per_coin: uint64;
100
+ target_coin_id: bytes32;
101
+ } & TXEndpointRequest;
102
+ export type SplitCoinsCHIP0029 = SplitCoins & Marshall;
103
+ export type SplitCoinsResponse = TransactionEndpointResponse;
104
+ export type SplitCoinsResponseCHIP0029 = TransactionEndpointResponseCHIP0029;
105
+ export type CombineCoins = TransactionEndpointRequest & {
106
+ wallet_id: uint32;
107
+ number_of_coins: uint16;
108
+ largest_first: bool;
109
+ target_coin_ids: bytes32[];
110
+ target_coin_amount?: uint64;
111
+ coin_num_limit: uint16;
112
+ } & TXEndpointRequest;
113
+ export type CombineCoinsCHIP0029 = CombineCoins & Marshall;
114
+ export type CombineCoinsResponse = TransactionEndpointResponse;
115
+ export type CombineCoinsResponseCHIP0029 = TransactionEndpointResponseCHIP0029;
116
+ export type VCMint = TransactionEndpointRequest & {
117
+ did_id: str;
118
+ target_address: Optional<str>;
119
+ } & TXEndpointRequest;
120
+ export type VCMintCHIP0029 = VCMint & Marshall;
121
+ export type VcMintResponse = TransactionEndpointResponse & {
122
+ vc_record: VCRecord;
123
+ };
124
+ export type VcMintResponseCHIP0029 = TransactionEndpointResponseCHIP0029 & {
125
+ vc_record: VCRecord;
126
+ };
127
+ export type VCGet = {
128
+ vc_id: bytes32;
129
+ };
130
+ export type VCGetCHIP0029 = VCGet & Marshall;
131
+ export type VcGetResponse = {
132
+ vc_record: Optional<VCRecord>;
133
+ };
134
+ export type VcGetList = {
135
+ start: uint32;
136
+ end: uint32;
137
+ };
138
+ export type VcGetListCHIP0029 = VcGetList & Marshall;
139
+ export type VCProofsRPC = {
140
+ key_value_pairs: Array<[str, str]>;
141
+ };
142
+ export type VCProofWithHash = {
143
+ hash: bytes32;
144
+ proof: Optional<VCProofsRPC>;
145
+ };
146
+ export type VcRecordWithCoinID = VCRecord & {
147
+ coin_id: bytes32;
148
+ };
149
+ export type VcGetListResponse = {
150
+ vc_records: VcRecordWithCoinID[];
151
+ proofs: VCProofWithHash[];
152
+ };
153
+ export type VcSpend = TransactionEndpointRequest & {
154
+ vc_id: bytes32;
155
+ new_puzhash: Optional<bytes32>;
156
+ new_proof_hash: Optional<bytes32>;
157
+ provider_inner_puzhash: Optional<bytes32>;
158
+ } & TXEndpointRequest;
159
+ export type VcSpendCHIP0029 = VcSpend & Marshall;
160
+ export type VcSpendResponse = TransactionEndpointResponse;
161
+ export type VcSpendResponseCHIP0029 = TransactionEndpointResponseCHIP0029;
162
+ export type VcAddProofs = VCProofsRPC;
163
+ export type VcAddProofsCHIP0029 = VCProofsRPC & Marshall;
164
+ export type VCGetProofsForRoot = {
165
+ root: bytes32;
166
+ };
167
+ export type VCGetProofsForRootCHIP0029 = VCGetProofsForRoot & Marshall;
168
+ export type VCGetProofsForRootResponse = VCProofsRPC;
169
+ export type VcRevoke = TransactionEndpointRequest & {
170
+ vc_parent_id: bytes32;
171
+ } & TXEndpointRequest;
172
+ export type VcRevokeCHIP0029 = VcRevoke & Marshall;
173
+ export type VcRevokeResponse = TransactionEndpointResponse;
174
+ export type VcRevokeResponseCHIP0029 = TransactionEndpointResponseCHIP0029;
175
+ export type LogIn = {
176
+ fingerprint: uint32;
177
+ };
178
+ export type LogInResponse = {
179
+ fingerprint: uint32;
180
+ };
181
+ export type GetLoggedInFingerprintResponse = {
182
+ fingerprint: Optional<uint32>;
183
+ };
184
+ export type GetPublicKeysResponse = {
185
+ keyring_is_locked: bool;
186
+ public_key_fingerprints?: uint32[];
187
+ };
188
+ export type GetPrivateKeyRequest = {
189
+ fingerprint: uint32;
190
+ };
191
+ export type GetPrivateKeyFormat = {
192
+ fingerprint: uint32;
193
+ sk: PrivateKey;
194
+ pk: G1Element;
195
+ farmer_pk: G1Element;
196
+ pool_pk: G1Element;
197
+ seed: Optional<str>;
198
+ };
199
+ export type GetPrivateKeyResponse = {
200
+ private_key: GetPrivateKeyFormat;
201
+ };
202
+ export type GenerateMnemonicResponse = {
203
+ mnemonic: str[];
204
+ };
205
+ export type AddKeyRequest = {
206
+ mnemonic: str[];
207
+ };
208
+ export type AddKeyResponse = {
209
+ fingerprint: uint32;
210
+ };
211
+ export type DeleteKeyRequest = {
212
+ fingerprint: uint32;
213
+ };
214
+ export type CheckDeleteKeyRequest = {
215
+ fingerprint: uint32;
216
+ max_ph_to_search?: uint32;
217
+ };
218
+ export type CheckDeleteKeyResponse = {
219
+ fingerprint: uint32;
220
+ used_for_farmer_rewards: bool;
221
+ used_for_pool_rewards: bool;
222
+ wallet_balance: bool;
223
+ };
224
+ export type SetWalletResyncOnStartup = {
225
+ enable?: bool;
226
+ };
227
+ export type SetWalletResyncOnStartupCHIP0029 = SetWalletResyncOnStartup & Marshall;
228
+ export type GetSyncStatus = Marshall;
229
+ export type GetSyncStatusResponse = {
230
+ synced: bool;
231
+ syncing: bool;
232
+ genesis_initialized: bool;
233
+ };
234
+ export type GetHeightInfo = Marshall;
235
+ export type GetHeightInfoResponse = {
236
+ height: uint32;
237
+ };
238
+ export type PushTX = {
239
+ spend_bundle: WalletSpendBundle | str;
240
+ };
241
+ export type PushTXCHIP0029 = PushTX & Marshall;
@@ -0,0 +1,19 @@
1
+ import { bool, str, True } from "../types/_python_types_";
2
+ import { TXConfigLoader, TXEndpointForCompat } from "../wallet/util/tx_config";
3
+ import { ConditionValidTimes } from "../wallet/conditions";
4
+ import { UnsignedTransaction } from "../wallet/signer_protocol";
5
+ import { CHIP0029, ExtraCondition, TranslationLayerKey } from "./util";
6
+ export type TXEndpointRequest = {
7
+ wallet_type: str;
8
+ extra_conditions?: ExtraCondition[];
9
+ push?: bool;
10
+ merge_spends?: bool;
11
+ sign?: bool;
12
+ translation?: TranslationLayerKey;
13
+ } & CHIP0029 & TXConfigLoader & TXEndpointForCompat & Partial<ConditionValidTimes>;
14
+ export type CHIP0029UnsignedTransaction<T extends TXEndpointRequest> = T extends {
15
+ "CHIP-0029"?: True;
16
+ } ? str[] : UnsignedTransaction[];
17
+ export type TxeResp<Req extends TXEndpointRequest, Res> = {
18
+ unsigned_transactions: CHIP0029UnsignedTransaction<Req>;
19
+ } & Res;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,5 @@
1
1
  import { bytes, uint16 } from "../types/_python_types_";
2
- export type VersionBlob = {
2
+ export type VersionedBlob = {
3
3
  version: uint16;
4
4
  blob: bytes;
5
5
  };
@@ -1,5 +1,6 @@
1
1
  import { bool, bytes, int, None } from "../../types/_python_types_";
2
2
  import { Program } from "../../types/blockchain_format/program";
3
+ import { DAORules } from "./dao_info";
3
4
  export type ProposalState = {
4
5
  total_votes_needed: int;
5
6
  yes_votes_needed: int;
@@ -23,9 +24,12 @@ export type ParsedProposalSpend = {
23
24
  amount: int;
24
25
  }>;
25
26
  }>;
26
- };
27
+ } & ({
28
+ mint_amount: int;
29
+ new_cat_puzhash: bytes;
30
+ } | object);
27
31
  export type ParsedProposalUpdate = {
28
32
  state: ProposalState;
29
33
  proposal_type: "u";
30
- dao_rules: unknown;
34
+ dao_rules: DAORules;
31
35
  };
@@ -1,11 +1,13 @@
1
1
  import { bool, uint16, uint64 } from "../../../types/_python_types_";
2
2
  import { bytes32 } from "../../../types/blockchain_format/sized_bytes";
3
+ import { Marshall } from "../../../rpc/util";
3
4
  export type AutoClaimSettings = {
4
5
  enabled: bool;
5
6
  tx_fee: uint64;
6
7
  min_amount: uint64;
7
8
  batch_size: uint16;
8
9
  };
10
+ export type AutoClaimSettingsCHIP0029 = AutoClaimSettings & Marshall;
9
11
  export type ClawbackMetadata = {
10
12
  time_lock: uint64;
11
13
  sender_puzzle_hash: bytes32;
@@ -1,9 +1,9 @@
1
1
  import { bool, bytes, Optional, str, uint32, uint64, uint8 } from "../types/_python_types_";
2
- import { SpendBundle } from "../types/spend_bundle";
3
2
  import { Coin } from "../types/blockchain_format/coin";
4
3
  import { bytes32 } from "../types/blockchain_format/sized_bytes";
5
4
  import { ClawbackMetadata } from "./puzzles/clawback/metadata";
6
5
  import { ConditionValidTimes } from "./conditions";
6
+ import { WalletSpendBundle } from "./wallet_spend_bundle";
7
7
  export type TransactionRecordOld = {
8
8
  confirmed_at_height: uint32;
9
9
  created_at_time: uint64;
@@ -12,7 +12,7 @@ export type TransactionRecordOld = {
12
12
  fee_amount: uint64;
13
13
  confirmed: bool;
14
14
  sent: uint32;
15
- spend_bundle: Optional<SpendBundle>;
15
+ spend_bundle: Optional<WalletSpendBundle>;
16
16
  additions: Coin[];
17
17
  removals: Coin[];
18
18
  wallet_id: uint32;
@@ -1,8 +1,9 @@
1
- import { bool, int, Optional, str, uint32 } from "../types/_python_types_";
1
+ import { bool, int, Optional, str, uint32, uint64 } from "../types/_python_types_";
2
2
  import { Coin } from "../types/blockchain_format/coin";
3
3
  import { CoinType, StreamableWalletIdentifier, WalletType } from "./util/wallet_types";
4
4
  import { ClawbackMetadata } from "./puzzles/clawback/metadata";
5
- import { VersionBlob } from "../util/streamable";
5
+ import { VersionedBlob } from "../util/streamable";
6
+ import { bytes32 } from "../types/blockchain_format/sized_bytes";
6
7
  export type WalletCoinRecord = {
7
8
  coin: Coin;
8
9
  confirmed_block_height: uint32;
@@ -12,9 +13,12 @@ export type WalletCoinRecord = {
12
13
  wallet_type: typeof WalletType[keyof typeof WalletType];
13
14
  wallet_id: int;
14
15
  coin_type: typeof CoinType[keyof typeof CoinType];
15
- metadata: Optional<VersionBlob>;
16
+ metadata: Optional<VersionedBlob>;
16
17
  };
17
- export type WalletCoinRecordWithMetadata = WalletCoinRecord & {
18
+ export type WalletCoinRecordWithMetadata = {
19
+ parent_coin_info: bytes32;
20
+ puzzle_hash: bytes32;
21
+ amount: uint64;
18
22
  id: str;
19
23
  type: typeof CoinType[keyof typeof CoinType];
20
24
  wallet_identifier: StreamableWalletIdentifier;
@@ -0,0 +1,2 @@
1
+ import { SpendBundle } from "../types/spend_bundle";
2
+ export type WalletSpendBundle = SpendBundle;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
- import { bytes, Optional, uint128, uint32, uint64 } from "../../../chia/types/_python_types_";
1
+ import { bool, bytes, Optional, uint128, uint32, uint64 } from "../../../chia/types/_python_types_";
2
2
  import { bytes32 } from "../../../chia/types/blockchain_format/sized_bytes";
3
3
  import { PublicKey } from "../../chia-bls/public_key";
4
- export type Spend = {
4
+ export type SpendConditions = {
5
5
  coin_id: bytes32;
6
6
  parent_id: bytes32;
7
7
  puzzle_hash: bytes32;
@@ -23,7 +23,7 @@ export type Spend = {
23
23
  flags: uint32;
24
24
  };
25
25
  export type SpendBundleConditions = {
26
- spends: Spend[];
26
+ spends: SpendConditions[];
27
27
  reserve_fee: uint64;
28
28
  height_absolute: uint32;
29
29
  seconds_absolute: uint64;
@@ -33,4 +33,7 @@ export type SpendBundleConditions = {
33
33
  cost: uint64;
34
34
  removal_amount: uint128;
35
35
  addition_amount: uint128;
36
+ validated_signature: bool;
37
+ execution_cost: uint64;
38
+ condition_cost: uint64;
36
39
  };
@@ -1,4 +1,4 @@
1
- import { False, str, True, uint16 } from "../../chia/types/_python_types_";
1
+ import { bool, False, str, True, uint16 } from "../../chia/types/_python_types_";
2
2
  import { TRPCAgent } from "../../../rpc/index";
3
3
  import { GetMessageType, ResType, TConnectionGeneral } from "../../types";
4
4
  import { TConnectionFullNode } from "../../ws/full_node/index";
@@ -74,5 +74,30 @@ export type THealthzResponse = {
74
74
  };
75
75
  export type WsHealthzMessage = GetMessageType<chia_common_service, healthz_command, THealthzResponse>;
76
76
  export declare function healthz<T extends TRPCAgent | TDaemon>(agent: T): Promise<ResType<T, THealthzResponse, WsHealthzMessage>>;
77
- export type RpcCommonMessage = TGetNetworkInfoResponse | TGetConnectionsResponse | TOpenConnectionResponse | TCloseConnectionResponse | TStopNodeResponse | TGetRoutesResponse | TGetVersionResponse | THealthzResponse;
78
- export type RpcCommonMessageOnWs = WsGetNetworkInfoMessage | WsGetConnectionsMessage | WsOpenConnectionMessage | WsCloseConnectionMessage | WsStopNodeMessage | WsGetRoutesMessage | WsGetVersionMessage | WsHealthzMessage;
77
+ export declare const get_log_level_command = "get_log_level";
78
+ export type get_log_level_command = typeof get_log_level_command;
79
+ export type TGetLogLevelResponse = {
80
+ success: True;
81
+ level: str;
82
+ available_levels: str[];
83
+ };
84
+ export type WsGetLogLevelMessage = GetMessageType<chia_common_service, get_log_level_command, TGetLogLevelResponse>;
85
+ export declare function get_log_level<T extends TRPCAgent | TDaemon>(agent: T): Promise<ResType<T, TGetLogLevelResponse, WsGetLogLevelMessage>>;
86
+ export declare const set_log_level_command = "set_log_level";
87
+ export type set_log_level_command = typeof set_log_level_command;
88
+ export type TSetLogLevelRequest = {
89
+ level: str;
90
+ };
91
+ export type TSetLogLevelResponse = TGetLogLevelResponse & {
92
+ success: bool;
93
+ errors: str[];
94
+ };
95
+ export type WsSetLogLevelMessage = GetMessageType<chia_common_service, set_log_level_command, TSetLogLevelResponse>;
96
+ export declare function set_log_level<T extends TRPCAgent | TDaemon>(agent: T, params: TSetLogLevelRequest): Promise<ResType<T, TSetLogLevelResponse, WsSetLogLevelMessage>>;
97
+ export declare const reset_log_level_command = "reset_log_level";
98
+ export type reset_log_level_command = typeof reset_log_level_command;
99
+ export type TResetLogLevelResponse = TSetLogLevelResponse;
100
+ export type WsResetLogLevelMessage = GetMessageType<chia_common_service, reset_log_level_command, TResetLogLevelResponse>;
101
+ export declare function reset_log_level<T extends TRPCAgent | TDaemon>(agent: T): Promise<ResType<T, TSetLogLevelResponse, WsResetLogLevelMessage>>;
102
+ export type RpcCommonMessage = TGetNetworkInfoResponse | TGetConnectionsResponse | TOpenConnectionResponse | TCloseConnectionResponse | TStopNodeResponse | TGetRoutesResponse | TGetVersionResponse | THealthzResponse | TGetLogLevelResponse | TSetLogLevelResponse | TResetLogLevelResponse;
103
+ export type RpcCommonMessageOnWs = WsGetNetworkInfoMessage | WsGetConnectionsMessage | WsOpenConnectionMessage | WsCloseConnectionMessage | WsStopNodeMessage | WsGetRoutesMessage | WsGetVersionMessage | WsHealthzMessage | WsGetLogLevelMessage | WsSetLogLevelMessage | WsResetLogLevelMessage;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.healthz = exports.healthz_command = exports.get_version = exports.get_version_command = 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.get_network_info = exports.get_network_info_command = exports.chia_common_service = void 0;
12
+ exports.reset_log_level = exports.reset_log_level_command = exports.set_log_level = exports.set_log_level_command = exports.get_log_level = exports.get_log_level_command = exports.healthz = exports.healthz_command = exports.get_version = exports.get_version_command = 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.get_network_info = exports.get_network_info_command = exports.chia_common_service = void 0;
13
13
  exports.chia_common_service = "";
14
14
  exports.get_network_info_command = "get_network_info";
15
15
  function get_network_info(agent) {
@@ -67,3 +67,24 @@ function healthz(agent) {
67
67
  });
68
68
  }
69
69
  exports.healthz = healthz;
70
+ exports.get_log_level_command = "get_log_level";
71
+ function get_log_level(agent) {
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ return agent.sendMessage(exports.chia_common_service, exports.get_log_level_command);
74
+ });
75
+ }
76
+ exports.get_log_level = get_log_level;
77
+ exports.set_log_level_command = "set_log_level";
78
+ function set_log_level(agent, params) {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ return agent.sendMessage(exports.chia_common_service, exports.set_log_level_command, params);
81
+ });
82
+ }
83
+ exports.set_log_level = set_log_level;
84
+ exports.reset_log_level_command = "reset_log_level";
85
+ function reset_log_level(agent) {
86
+ return __awaiter(this, void 0, void 0, function* () {
87
+ return agent.sendMessage(exports.chia_common_service, exports.reset_log_level_command);
88
+ });
89
+ }
90
+ exports.reset_log_level = reset_log_level;
@@ -103,6 +103,7 @@ function get_aggsig_additional_data(agent) {
103
103
  });
104
104
  }
105
105
  exports.get_aggsig_additional_data = get_aggsig_additional_data;
106
+ // This API was removed in `chia-blockchain@2.4.4`. Will be removed from `chia-agent` in the future.
106
107
  exports.get_initial_freeze_period_command_of_full_node = "get_initial_freeze_period";
107
108
  function get_initial_freeze_period_of_full_node(agent) {
108
109
  return __awaiter(this, void 0, void 0, function* () {