Skip to content

Latest commit

 

History

History
1769 lines (1709 loc) · 108 KB

CHANGELOG.md

File metadata and controls

1769 lines (1709 loc) · 108 KB

Changelog

Changed

  • The default service name which Daemon client tries to register is now wallet_ui.
    Previously chia_agent service and optionally wallet_ui service were registered to chia-blockchain's Daemon.

Changed

  • Error logs are generated when
    • an error occurs during sending a message.
    • it receives a websocket message with unexpected format.
  • Debug logs are generated when ping/pong events are triggered.

Changed

  • Added a Host header when sending https request to a remote host.

Changed

  • Removed RpcWalletMessageOnWs since it's costly to maintain while there are a few use cases.
  • Enhanced type resolutions on Wallet RPC APIs with TXEndpointRequest

Removed

  • Removed deprecated TCreate_New_RL_WalletRequest and TCreate_New_RL_WalletResponse

Added

Fixed

Changed

  • For the log which is output when success property in API response is false, the log level is now INFO instead of ERROR.

Changed

  • daemon.connect() now returns a rejected promise on failure instead of throwing an uncaught exception
  • daemon.connect() now accepts connection timeout in milliseconds.

Note

  • add_private_key
    • The request parameters kc_user and kc_service is temporarily not working with 2.4.0 and 2.4.1 of chia-blockchain. (2.4.2 fixed this issue)
      This is a bug and not spec change so chia-agent stays to be able to set those params for now.

Changed

Added

Removed

Fixed

Changed

-get_network_info RPC API is now commonized and available in addition to full_node and wallet.

Added

Fixed

  • Renamed ReceiveBlockResult to AddBlockResult (type ReceiveBlockResult is still available to avoid breaking change)
  • Fixed an invalid TCreate_New_DAO_WalletRequest README location.
  • Fixed an issue where pubkey and pubhash in request of Wallet RPC API did_recovery_spend was not optional in the API doc.
  • Fixed lint errors

Removed

Breaking change

  • When RPC API responds with success: false, its Promise now does reject. (Previously it does resolve)
  • At [email protected], in chia/consensus/cost_calculator.py,
    NPCResult.cost was removed.
    As a result, the RPC APIs below might be incompatible between 2.1.4 and 2.2.1.
    • get_all_mempool_items of FullNode RPC API
    • get_mempool_item_by_tx_id of FullNode RPC API

Changed

  • Loosened a type of agent to call RPC APIs. RPC APIs can be invoked with agent which just implements sendMessage method depicted as below.
export interface APIAgent {
  sendMessage<M extends unknown>(
          destination: string,
          command: string,
          data?: Record<string, unknown>,
  ): Promise<M>;
}

Added

  • Added connectivity options for RPCAgent.
    • keepAlive (default: true)
    • keepAliveMsecs (default: 1000)
    • maxSockets (default: Infinity)
    • timeout (default: undefined)
// Usage
const {RPCAgent} = require("chia-agent");
const {get_plots} = require("chia-agent/api/rpc");

const agent = new RPCAgent({
  service: "harvester",
  keepAlive: true,
  keepAliveMsecs: 3000,
  maxSockets: 1, // Avoid to set `1` if your requests may be sent in parallel.
  timeout: 5000,
});
const res = await get_plots(agent);
  • Added httpsAgent, httpAgent option for RPCAgent. You can now configure and inject your own require('https').Agent into RPCAgent.
// Usage
const {Agent: HttpsAgent} = require("https"); // or const {Agent: HttpAgent} = require('http');
const {RPCAgent} = require("chia-agent");
const {get_plots} = require("chia-agent/api/rpc");

const httpsAgent = new HttpsAgent({
  host: "localhost",
  port: 8560,
  ca: ...,
  cert: ...,
  key: ...,
  rejectUnauthorized: false,
});
const agent = new RPCAgent({httpsAgent: httpsAgent}); // `new RPCAgent({httpAgent: httpAgent});` is also allowed.
const res = await get_plots(agent);

Fixed

  • Fixed an issue where some of the RPC Pool APIs did not handle request parameters correctly.
  • Added missing attribute peak_height to NewSignagePoint

Added

Changed

  • RPC Agent
    • Allow to specify host / port on instantiating RPCAgent when protocol is not specified.
    const agent = new RPCAgent({host: 'example.com', port: 8444, service: 'full_node', configPath: '...'});
  • Farmer RPC API
    • get_pool_state
      • Added new properties
        • insufficient_partials_since_start
        • insufficient_partials_24h
  • Wallet RPC API
    • select_coins
      • The types of both excluded_coins and exclude_coins were changed to Coin[] from str[].
      • Please note that both of the above properties are just kept for compatibility so don't use them unless you have strong reasons. Use excluded_coin_ids: str[] instead.
    • sign_message_by_address
      • Added safe_mode to request parameter
    • sign_message_by_id
      • Added safe_mode to request parameter

Fixed

  • Typo in SpendBundle: cons_spends renamed to coin_spends
  • Fixed an issue where sometimes error logs were not reported due to circular dependencies.

Added

Changed

Fixed

Changed

Breaking change

  • The format of PoolState) has been changed.
    • points_found_24h and points_acknowledged_24h are now Array<[uint32, uint64]> (they were Array<[float, uint64]>)
    • pool_errors_24h is now Array<[uint32, ErrorResponse]> (it was ErrorResponse[])
  • The following request properties of send_transaction and cat_spend Wallet RPC API were renamed
    • exclude_coin_amounts -> excluded_coin_amounts
    • exclude_coins -> excluded_coins
    • The previous property names(exclude_coin_amounts, exclude_coins) are preserved for backward compatibility
  • The following request properties of create_signed_transaction Wallet RPC API were renamed
    • exclude_coin_amounts -> excluded_coin_amounts
    • exclude_coins -> excluded_coins
    • The previous property name (exclude_coins) is preserved for backward compatibility
    • Unlike send_transaction and cat_spend, exclude_coin_amounts is removed by accident and not backward compatible.

Changed

Added

Fixed

  • Fixed documentation for plotter params.
    • bladebit_params => bladebit_ramplot_params
    • bladebit2_params => bladebit_diskplot_params
  • Fixed an issue where ts files related to the data layer RPC API had a circular dependency.
  • Fixed an issue where the following request parameters for the did_find_lost_did Wallet RPC API were missing.
    • recovery_list_hash
    • num_verification
    • metadata

Changed

Added

Changed

  • Replace the npm module json-bigint to @chiamine/json-bigint.

Fixed

  • Fixed the type of int64, uint64, uint128, uint512 to number | bigint.

Breaking change

Now the types of int64, uint64, uint128, uint512 are number | BigInt (Originally it was number).
When the numeric value is larger than Number.MAX_SAFE_INTEGER, the value is parsed as a BigInt.
You need to check a numeric member of API responses whether it is a number or BigInt if the type of it is either int64, uint64, uint128 or uint512.
You may also use BigInt for API request inputs wherever the type is one of the above.

Just updated documents. You don't need to update chia-agent from 11.1.0 for [email protected] because there are no API changes.

Changed

  • Wallet RPC API
    • get_wallet_balance
      • Part of response properties are replaced by Balance type.
        (* No new properties were added and no properties were removed to the response. Just part of props were managed separately)
    • cat_spend
      • Added extra_delta, tail_reveal and tail_solution to request parameter.
    • In chia/wallet/nft_wallet/nft_info.py, nft_coin_confirmation_height was added to NFTInfo.
      As a result of this change, the responses from following RPC API is affected.
  • Updated yaml to 2.2.2

Added

Fixed

  • Added missing get_sync_status to README.md for RPC APIs
  • Added missing property launcher_id to dl_history in DataLayer RPC API

Breaking change

JSONified MempoolItem replaced original MempoolItem in chia/types/mempool_items.py for 2 RPC API responses listed below.
As a result of this change, removals was added and height_added_to_mempool/assert_height were removed from those RPC API responses.

Changed

In chia/wallet/nft_wallet/nft_info.py, nft_id was added to NftInfo.
As a result of this change, the responses from following RPC APIs are affected.

Added

Fixed

Indirect Change

In chia/types/mempool_items.py, assert_height was added to MempoolItem.
As a result of this change, the responses from following RPC APIs are affected.

Added

Changed

Fixed

Breaking change

In chia/types/mempool_items.py, removals of MempoolItem is now flagged as @property. As a result of this, removals of MempoolItem is removed from 2 RPC API responses listed below.

Minor breaking change

  • Response params ofkeyring_status daemon WebSocket API below are deprecated
    • needs_migration
    • can_remove_legacy_keys

Removed

  • Daemon WebSocket API
    (Code will remain awhile on chia-agent for backward compatibility. Only document is removed for now.)
    • Removed migrate_keyring
    • Removed notify_keyring_migration_completed

Added

Changed

  • Daemon WebSocket API
    • keyring_status
      • Removed needs_migration from response
      • Removed can_remove_legacy_keys from response
  • FullNode RPC API
  • Wallet RPC API
    • send_transaction
      • Added max_coin_amount to request parameter
      • Added exclude_coin_amounts to request parameter
      • Added exclude_coin_ids to request parameter
    • send_transaction_multi
      • Added max_coin_amount to request parameter
      • Added exclude_coin_amounts to request parameter
      • Added parameters for cat spends.
    • select_coins
      • Added max_coin_amount to request parameter
      • Added exclude_coin_amounts to request parameter
    • cat_spend
      • Added additions to request parameter
      • Added max_coin_amount to request parameter
      • Added exclude_coin_amounts to request parameter
      • Added exclude_coin_ids to request parameter
    • sign_message_by_id
      • Added latest_coin_id to request parameter
    • create_offer_for_ids
      • Added max_coin_amount to request parameter
    • take_offer
      • Added max_coin_amount to request parameter
    • nft_mint_nft
      • Added nft_id to return parameter
    • nft_mint_bulk
      • Added nft_id_list to return parameter
    • create_signed_transaction
      • Added max_coin_amount to return parameter
      • Added exclude_coin_amounts to return parameter
  • Wallet WebSocket API
  • TBladeBitParams has been renamed to TBladeBitRamParams
    • plot_type: "ramplot" has been added
  • TBladeBit2Params has been renamed to TBladeBitDiskParams
    • plot_type: "diskplot" has been added
    • plotter type has been converted to "bladebit" from "bladebit2"
  • Eased type requirement of daemon.sendMessage() and agent.sendMessage()
    You can request RPC API on Daemon WebSocket channel like this:
const {getDaemon} = require("chia-agent");
const {get_harvesters_summary} = require("chia-agent/api/rpc/farmer");
const daemon = getDaemon();
await daemon.connect();
res = await get_harvesters_summary(daemon);
// or specify service name and API command
res = await daemon.sendMessage("chia_farmer", "get_harvesters_summary");
/*
{
  ack: true,
  command: 'get_harvesters_summary',
  data: { harvesters: [ [Object] ], success: true },
  destination: 'chia_agent',
  origin: 'chia_farmer',
  request_id: '4e31c04df234538901d9270932d04301b5b3a1a895d762144400852b8167973f'
}
 */

Please note that when you use RPC API, you can directly request to the RPC endpoint of the service(full_node/farmer/...). However, when you request RPC API on Daemon WebSocket channel, you get a response from the service which the daemon is connecting to. In other word, you can choose the exact ip:port of a service if you use RPC API, while it is the daemon which chooses the services it connects to if you use Daemon WebSocket channel.

Fixed

Minor breaking change

  • add_private_key daemon WebSocket API now deprecated passphrase request param
    and added label param.
  • program property was removed from MempoolItem class.
    See MempoolItem for more detail.
    This impacts on API response below:

Removed

  • Wallet RPC API
    (Code will remain awhile on chia-agent for backward compatibility. Only document is removed for now.)
    • Removed rl_set_user_info
    • Removed send_clawback_transaction
    • Removed add_rate_limited_funds
    • Removed RL Wallet type from create_new_wallet API
  • Removed RATE_LIMITED from WalletType

Added

Changed

Fixed

Added

Changed

Fixed

  • Fixed an issue where wallet state_changed events(notified via WebSocket API) below were missing.
    • did_coin_added
    • nft_coin_added
    • nft_coin_removed
    • nft_coin_updated
    • nft_coin_did_set

Breaking Change

series_total and series_number in NFTInfo class have been renamed to edition_total and edition_number
(defined in chia/wallet/nft_wallet/nft_info.py.)
As a result, the following Wallet RPC APIs in [email protected] become not compatible with [email protected]

  • nft_get_info
    • nft_info.series_total was renamed to nft_info.edition_total
    • nft_info.series_number was renamed to nft_info.edition_number
  • nft_get_nfts
    • nft_list.series_total was renamed to nft_list.edition_total
    • nft_list.series_number was renamed to nft_list.edition_number

Added

Changed

Fixed

  • Fixed an issue where type information of get_puzzle_and_solution was missing.
  • Fixed an issue where event destination of sync_changed and coin_added Wallet WebSocket API was not correct.
  • Fixed an issue where healthz common RPC API was missing.

Breaking Change

  • nft_mint_nft
    • Renamed series_number to edition_number.
    • Renamed series_total to edition_total.

Added

Changed

Breaking Change

Added

Changed

  • get_reward_targets
    • Added max_ph_to_search to request parameter
  • check_delete_key
    • Added max_ph_to_search to request parameter
  • get_wallets
    • Added include_data to request parameter
  • create_new_wallet
    • Added metadata and wallet_name to request parameter for DID wallet
    • Changed parameter name from filename and backup_data for request parameter for DID wallet recovery
    • Added NFT Wallet type
  • create_offer_for_ids
    • Added driver_dict to request parameter
  • get_offer_summary
    • Added infos to response parameter
  • did_update_recovery_ids
    • Changed the type of wallet_id to uint32 from int.
  • did_get_did
    • Changed the type of wallet_id to uint32 from int.
  • did_get_recovery_list
    • Changed the type of wallet_id to uint32 from int.
    • Renamed recover_list to recovery_list.
  • did_recovery_spend
    • Changed the type of wallet_id to uint32 from int.
    • Renamed attest_filenames to attest_data.
    • Changed response dict format
  • did_get_pubkey
    • Changed the type of wallet_id to uint32 from int.
  • did_create_attest
    • Changed the type of wallet_id to uint32 from int.
    • Removed filename from request.
    • Added attest_data to response.
  • did_get_information_needed_for_recovery
    • Changed the type of wallet_id to uint32 from int.
  • did_create_backup_file
    • Changed the type of wallet_id to uint32 from int.
    • Removed filename from request.
    • Added backup_data to response.
  • TradeRecordConvenience type at chia/wallet/trade_record.py was changed.
    (Added infos property to summary dict)
    As a result, the following APIs are affected:
    • create_offer_for_ids of Wallet RPC API
    • take_offer of Wallet RPC API
    • get_offer of Wallet RPC API
    • get_all_offers of Wallet RPC API
  • Renamed DISTRIBUTED_ID to DECENTRALIZED_ID of WalletType in src/api/chia/wallet/util/wallet_type.ts.
  • Added NFT to WalletType in src/api/chia/wallet/util/wallet_type.ts.

Fixed

  • Fixed an issue where README description for did_get_pubkey was wrong.
  • Fixed an issue where the type of pubkey response property for did_get_pubkey was wrong.

Minor Breaking Change

  • At [email protected], a farmer websocket API new_plots was replaced by
    harvester_update and harvester_removed.
    This change is not critical because in application's point of view it may just miss new plot info but farming will continue without problem.

Removed

Added

Changed

  • Plot type at chia/harvester/harvester.py was changed.
    (Removed deprecated plot-seed and change the type of time_modified to int from float)
    As a result, the following APIs are affected:
    • get_plots of Harvester RPC API
    • on_get_plots of Harvester WebSocket API
  • get_pool_state
    • plot_count property is added

Fixed

  • Fixed an issue where README description of get_harvesters(Farmer RPC API) did not reflect actual API format
  • Added missing get_pool_login_link of Farmer RPC API to ./src/api/rpc/index.ts

Breaking Change

  • At [email protected], in chia/consensus/cost_calculator.py,
    NPCResult.npc_list was removed and NPCResult.conds was added.
    As a result, the RPC APIs below might be incompatible between 1.3.3 and 1.3.4.
    • get_all_mempool_items Of FullNode RPC API
    • get_mempool_item_by_tx_id Of FullNode RPC API

Added

Changed

Fixed

  • Fixed issues where the following full_node RPC APIs were not exported from api/rpc/index.ts.
    • get_coin_record_by_names
    • get_coin_records_by_parent_ids
  • Fixed issues where the following wallet RPC APIs were not exported from api/rpc/index.ts.
    • delete_unconfirmed_transactions
  • Fixed an issue where README description of get_blockchain_state of FullNode RPC API was missing some properties.

Breaking Change

  • At [email protected], in chia/consensus/cost_calculator.py,
    NPCResult.clvm_cost was renamed to NPCResult.cost.
    As a result, the RPC APIs below might be incompatible between 1.2.11 and 1.3.0.
    • get_all_mempool_items Of FullNode RPC API
    • get_mempool_item_by_tx_id Of FullNode RPC API
  • In chia/pools/pool_config.py, authentication_public_key was removed from PoolWalletConfig.
    As a result, the RPC APIs below might be incompatible between 1.2.11 and 1.3.0.
    • get_pool_state of Farmer RPC API
  • In chia/types/coin_record.py, CoinRecord.spent was removed and turned into a getter method.
    As a result, the RPC APIs below might be incompatible between 1.2.11 and 1.3.0.
    • get_additions_and_removals of FullNode RPC API
  • Wallet RPC API create_backup was removed
  • Wallet RPC API get_discrepancies_for_offer was removed
  • Wallet RPC API respond_to_offer was removed
  • Wallet RPC API get_trade was removed
  • Wallet RPC API get_all_trades was removed
  • Wallet RPC API cancel_trade was removed
  • Wallet RPC API cc_set_name was renamed to cat_set_name
  • Wallet RPC API cc_get_name was renamed to cat_get_name
  • Wallet RPC API cc_spend was renamed to cat_spend
  • Wallet RPC API cc_get_colour was renamed to cat_get_asset_id
  • The request parameter of Wallet RPC API create_offer_for_ids was changed and incompatible with older API.
  • The request parameter of Wallet RPC API create_new_wallet was changed and incompatible with older API.

Removed

  • Removed create_backup of Wallet RPC API
  • Removed get_discrepancies_for_offer of Wallet RPC API
  • Removed respond_to_offer of Wallet RPC API
  • Removed get_trade of Wallet RPC API
  • Removed get_all_trades of Wallet RPC API
  • Removed cancel_trade of Wallet RPC API
  • Removed TradeRecordInJson at src/api/chia/wallet/util/trade_utils.ts

Added

Changed

Fixed

  • Replaced unknown type with actual type for on_state_changed_of_wallet in wallet WebSocket API

Added

  • Added skip_hostname_verification option for RPCAgent

Fixed

  • Fixed an issue where wallet WebSocket message from daemon was not captured.
    Thank you! @joshpainter

Minor Breaking Change

  • Service name of plotter was changed:
    chia plots create => chia_plotter.
    If you have a code which starts plotting via daemon websocket API, you might write like this:
    const {getDaemon} = require("chia-agent");
    const {start_plotting} = require("chia-agent/api/ws");
    const daemon = getDaemon(); // This is the websocket connection handler
    await daemon.connect(); // connect to local daemon using config file.
    const response = await start_plotting(daemon, {service: "chia plots create", ...});
    On and after [email protected], you must rewrite the last line of the above code like this:
    const response = await start_plotting(daemon, {service: "chia_plotter", ...});
    Please note you need to also update other code lines which refers to old service name(chia plots create).

Changed

Added

Changed

Changed

Fixed

Added

Deprecated

  • did_spend
    Note: chia-blockchain no longer responds to /did_spend wallet API endpoint on and after 1.2.8.
    For now, I don't remove /did_spend from chia-agent but only remove from API document.

This release corresponds to [email protected], which introduced no external API changes.

This release corresponds to [email protected] which only updates install script.
There are no API changes at all.

Changed

Added

Added

I incremented major version. See "Changed" section for detail.

Changed

Added

1.1.0 - 2021-07-08

Changed

  • Update G1Element/G2Element type to string (Serialized hex string representation)
  • Updated get_private_key

Added

Fixed

  • Fixed RPC API document links
  • Fixed the type of SerializedProgram to str
  • Fixed an issue where submodule could not be loaded. e.g. const {...} = require("chia-agent/api/rpc");
  • Correct type name TCreate_New_RC_WalletRequest/Response to TCreate_New_RL_WalletRequest/Response
  • Fixed wrong create_new_wallet request format
  • Fixed an issue where array data in YAML file was not parsed as expected.
  • Fixed login response json of Wallet RPC API
  • Fixed get_private_key response json of Wallet RPC API
  • Fixed create_offer_for_ids response json of Wallet RPC API
  • Fixed get_discrepancies_for_offer response json of Wallet RPC API
  • Fixed did_get_pubkey response json of Wallet RPC API
  • Fixed did_recovery_spend response json of Wallet RPC API

1.0.1 - 2021-05-19

Fixed

  • Only fixed typo in README.md

1.0.0 - 2021-05-19

Added

  • Added new RPC client
  • Added new RPC API
  • Added new Websocket API
  • Added API type definitions
  • Added code samples

0.0.5 - 2021-05-13

Changed

  • Reorganized internal log level and locations.
  • daemon.connect() resolves to boolean value indicating whether connecting is success or failure.
  • Trying to re-connect to an url which is already active does not output warning anymore.

Added

  • Added types

Fixed

  • Fixed an issue where it could fail to catch response from chia daemon.

0.0.4 - 2021-05-13

Fixed

  • Fixed an issue where some requests were not responded by chia daemon.

0.0.3 - 2021-05-13

Changed

  • Changed argument order for daemon.sendMessage for previous one was not intuitive.
// Old
daemon.sendMessage(get_block_record_by_height_command, destination, data);
// Now
daemon.sendMessage(destination, get_block_record_by_height_command, data);

0.0.2 - 2021-05-13

Fixed

  • Fixed an issue where it cannot be executed via npx command.

0.0.1 - 2021-05-13

Initial release.