chia-blockchain 2.5.1rc1__py3-none-any.whl
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.
- chia/__init__.py +10 -0
- chia/__main__.py +5 -0
- chia/_tests/README.md +53 -0
- chia/_tests/__init__.py +0 -0
- chia/_tests/blockchain/__init__.py +0 -0
- chia/_tests/blockchain/blockchain_test_utils.py +195 -0
- chia/_tests/blockchain/config.py +4 -0
- chia/_tests/blockchain/test_augmented_chain.py +145 -0
- chia/_tests/blockchain/test_blockchain.py +4202 -0
- chia/_tests/blockchain/test_blockchain_transactions.py +1031 -0
- chia/_tests/blockchain/test_build_chains.py +59 -0
- chia/_tests/blockchain/test_get_block_generator.py +72 -0
- chia/_tests/blockchain/test_lookup_fork_chain.py +194 -0
- chia/_tests/build-init-files.py +92 -0
- chia/_tests/build-job-matrix.py +204 -0
- chia/_tests/check_pytest_monitor_output.py +34 -0
- chia/_tests/check_sql_statements.py +72 -0
- chia/_tests/chia-start-sim +42 -0
- chia/_tests/clvm/__init__.py +0 -0
- chia/_tests/clvm/benchmark_costs.py +23 -0
- chia/_tests/clvm/coin_store.py +149 -0
- chia/_tests/clvm/test_chialisp_deserialization.py +101 -0
- chia/_tests/clvm/test_clvm_step.py +37 -0
- chia/_tests/clvm/test_condition_codes.py +13 -0
- chia/_tests/clvm/test_curry_and_treehash.py +55 -0
- chia/_tests/clvm/test_message_conditions.py +184 -0
- chia/_tests/clvm/test_program.py +150 -0
- chia/_tests/clvm/test_puzzle_compression.py +143 -0
- chia/_tests/clvm/test_puzzle_drivers.py +45 -0
- chia/_tests/clvm/test_puzzles.py +242 -0
- chia/_tests/clvm/test_singletons.py +540 -0
- chia/_tests/clvm/test_spend_sim.py +181 -0
- chia/_tests/cmds/__init__.py +0 -0
- chia/_tests/cmds/cmd_test_utils.py +469 -0
- chia/_tests/cmds/config.py +3 -0
- chia/_tests/cmds/conftest.py +23 -0
- chia/_tests/cmds/test_click_types.py +200 -0
- chia/_tests/cmds/test_cmd_framework.py +620 -0
- chia/_tests/cmds/test_cmds_util.py +97 -0
- chia/_tests/cmds/test_daemon.py +92 -0
- chia/_tests/cmds/test_dev_gh.py +131 -0
- chia/_tests/cmds/test_farm_cmd.py +66 -0
- chia/_tests/cmds/test_show.py +116 -0
- chia/_tests/cmds/test_sim.py +207 -0
- chia/_tests/cmds/test_timelock_args.py +75 -0
- chia/_tests/cmds/test_tx_config_args.py +154 -0
- chia/_tests/cmds/testing_classes.py +59 -0
- chia/_tests/cmds/wallet/__init__.py +0 -0
- chia/_tests/cmds/wallet/test_consts.py +47 -0
- chia/_tests/cmds/wallet/test_dao.py +565 -0
- chia/_tests/cmds/wallet/test_did.py +403 -0
- chia/_tests/cmds/wallet/test_nft.py +471 -0
- chia/_tests/cmds/wallet/test_notifications.py +124 -0
- chia/_tests/cmds/wallet/test_offer.toffer +1 -0
- chia/_tests/cmds/wallet/test_tx_decorators.py +27 -0
- chia/_tests/cmds/wallet/test_vcs.py +400 -0
- chia/_tests/cmds/wallet/test_wallet.py +1125 -0
- chia/_tests/cmds/wallet/test_wallet_check.py +109 -0
- chia/_tests/conftest.py +1419 -0
- chia/_tests/connection_utils.py +125 -0
- chia/_tests/core/__init__.py +0 -0
- chia/_tests/core/cmds/__init__.py +0 -0
- chia/_tests/core/cmds/test_beta.py +382 -0
- chia/_tests/core/cmds/test_keys.py +1734 -0
- chia/_tests/core/cmds/test_wallet.py +126 -0
- chia/_tests/core/config.py +3 -0
- chia/_tests/core/consensus/__init__.py +0 -0
- chia/_tests/core/consensus/test_block_creation.py +54 -0
- chia/_tests/core/consensus/test_pot_iterations.py +117 -0
- chia/_tests/core/custom_types/__init__.py +0 -0
- chia/_tests/core/custom_types/test_coin.py +107 -0
- chia/_tests/core/custom_types/test_proof_of_space.py +144 -0
- chia/_tests/core/custom_types/test_spend_bundle.py +70 -0
- chia/_tests/core/daemon/__init__.py +0 -0
- chia/_tests/core/daemon/config.py +4 -0
- chia/_tests/core/daemon/test_daemon.py +2128 -0
- chia/_tests/core/daemon/test_daemon_register.py +109 -0
- chia/_tests/core/daemon/test_keychain_proxy.py +101 -0
- chia/_tests/core/data_layer/__init__.py +0 -0
- chia/_tests/core/data_layer/config.py +5 -0
- chia/_tests/core/data_layer/conftest.py +106 -0
- chia/_tests/core/data_layer/test_data_cli.py +56 -0
- chia/_tests/core/data_layer/test_data_layer.py +83 -0
- chia/_tests/core/data_layer/test_data_layer_util.py +218 -0
- chia/_tests/core/data_layer/test_data_rpc.py +3847 -0
- chia/_tests/core/data_layer/test_data_store.py +2424 -0
- chia/_tests/core/data_layer/test_data_store_schema.py +381 -0
- chia/_tests/core/data_layer/test_plugin.py +91 -0
- chia/_tests/core/data_layer/util.py +233 -0
- chia/_tests/core/farmer/__init__.py +0 -0
- chia/_tests/core/farmer/config.py +3 -0
- chia/_tests/core/farmer/test_farmer_api.py +103 -0
- chia/_tests/core/full_node/__init__.py +0 -0
- chia/_tests/core/full_node/config.py +4 -0
- chia/_tests/core/full_node/dos/__init__.py +0 -0
- chia/_tests/core/full_node/dos/config.py +3 -0
- chia/_tests/core/full_node/full_sync/__init__.py +0 -0
- chia/_tests/core/full_node/full_sync/config.py +4 -0
- chia/_tests/core/full_node/full_sync/test_full_sync.py +443 -0
- chia/_tests/core/full_node/ram_db.py +27 -0
- chia/_tests/core/full_node/stores/__init__.py +0 -0
- chia/_tests/core/full_node/stores/config.py +4 -0
- chia/_tests/core/full_node/stores/test_block_store.py +590 -0
- chia/_tests/core/full_node/stores/test_coin_store.py +897 -0
- chia/_tests/core/full_node/stores/test_full_node_store.py +1219 -0
- chia/_tests/core/full_node/stores/test_hint_store.py +229 -0
- chia/_tests/core/full_node/stores/test_sync_store.py +135 -0
- chia/_tests/core/full_node/test_address_manager.py +588 -0
- chia/_tests/core/full_node/test_block_height_map.py +556 -0
- chia/_tests/core/full_node/test_conditions.py +556 -0
- chia/_tests/core/full_node/test_full_node.py +2700 -0
- chia/_tests/core/full_node/test_generator_tools.py +82 -0
- chia/_tests/core/full_node/test_hint_management.py +104 -0
- chia/_tests/core/full_node/test_node_load.py +34 -0
- chia/_tests/core/full_node/test_performance.py +179 -0
- chia/_tests/core/full_node/test_subscriptions.py +492 -0
- chia/_tests/core/full_node/test_transactions.py +203 -0
- chia/_tests/core/full_node/test_tx_processing_queue.py +155 -0
- chia/_tests/core/large_block.py +2388 -0
- chia/_tests/core/make_block_generator.py +70 -0
- chia/_tests/core/mempool/__init__.py +0 -0
- chia/_tests/core/mempool/config.py +4 -0
- chia/_tests/core/mempool/test_mempool.py +3255 -0
- chia/_tests/core/mempool/test_mempool_fee_estimator.py +104 -0
- chia/_tests/core/mempool/test_mempool_fee_protocol.py +55 -0
- chia/_tests/core/mempool/test_mempool_item_queries.py +190 -0
- chia/_tests/core/mempool/test_mempool_manager.py +2084 -0
- chia/_tests/core/mempool/test_mempool_performance.py +64 -0
- chia/_tests/core/mempool/test_singleton_fast_forward.py +567 -0
- chia/_tests/core/node_height.py +28 -0
- chia/_tests/core/server/__init__.py +0 -0
- chia/_tests/core/server/config.py +3 -0
- chia/_tests/core/server/flood.py +84 -0
- chia/_tests/core/server/serve.py +135 -0
- chia/_tests/core/server/test_api_protocol.py +21 -0
- chia/_tests/core/server/test_capabilities.py +66 -0
- chia/_tests/core/server/test_dos.py +319 -0
- chia/_tests/core/server/test_event_loop.py +109 -0
- chia/_tests/core/server/test_loop.py +294 -0
- chia/_tests/core/server/test_node_discovery.py +73 -0
- chia/_tests/core/server/test_rate_limits.py +482 -0
- chia/_tests/core/server/test_server.py +226 -0
- chia/_tests/core/server/test_upnp.py +8 -0
- chia/_tests/core/services/__init__.py +0 -0
- chia/_tests/core/services/config.py +3 -0
- chia/_tests/core/services/test_services.py +188 -0
- chia/_tests/core/ssl/__init__.py +0 -0
- chia/_tests/core/ssl/config.py +3 -0
- chia/_tests/core/ssl/test_ssl.py +202 -0
- chia/_tests/core/test_coins.py +33 -0
- chia/_tests/core/test_cost_calculation.py +313 -0
- chia/_tests/core/test_crawler.py +175 -0
- chia/_tests/core/test_crawler_rpc.py +53 -0
- chia/_tests/core/test_daemon_rpc.py +24 -0
- chia/_tests/core/test_db_conversion.py +130 -0
- chia/_tests/core/test_db_validation.py +162 -0
- chia/_tests/core/test_farmer_harvester_rpc.py +505 -0
- chia/_tests/core/test_filter.py +35 -0
- chia/_tests/core/test_full_node_rpc.py +768 -0
- chia/_tests/core/test_merkle_set.py +343 -0
- chia/_tests/core/test_program.py +47 -0
- chia/_tests/core/test_rpc_util.py +86 -0
- chia/_tests/core/test_seeder.py +420 -0
- chia/_tests/core/test_setproctitle.py +13 -0
- chia/_tests/core/util/__init__.py +0 -0
- chia/_tests/core/util/config.py +4 -0
- chia/_tests/core/util/test_block_cache.py +44 -0
- chia/_tests/core/util/test_cached_bls.py +57 -0
- chia/_tests/core/util/test_config.py +337 -0
- chia/_tests/core/util/test_file_keyring_synchronization.py +105 -0
- chia/_tests/core/util/test_files.py +391 -0
- chia/_tests/core/util/test_jsonify.py +146 -0
- chia/_tests/core/util/test_keychain.py +522 -0
- chia/_tests/core/util/test_keyring_wrapper.py +491 -0
- chia/_tests/core/util/test_lockfile.py +380 -0
- chia/_tests/core/util/test_log_exceptions.py +187 -0
- chia/_tests/core/util/test_lru_cache.py +56 -0
- chia/_tests/core/util/test_significant_bits.py +40 -0
- chia/_tests/core/util/test_streamable.py +883 -0
- chia/_tests/db/__init__.py +0 -0
- chia/_tests/db/test_db_wrapper.py +566 -0
- chia/_tests/environments/__init__.py +0 -0
- chia/_tests/environments/common.py +35 -0
- chia/_tests/environments/full_node.py +47 -0
- chia/_tests/environments/wallet.py +429 -0
- chia/_tests/ether.py +19 -0
- chia/_tests/farmer_harvester/__init__.py +0 -0
- chia/_tests/farmer_harvester/config.py +3 -0
- chia/_tests/farmer_harvester/test_farmer.py +1264 -0
- chia/_tests/farmer_harvester/test_farmer_harvester.py +292 -0
- chia/_tests/farmer_harvester/test_filter_prefix_bits.py +131 -0
- chia/_tests/farmer_harvester/test_third_party_harvesters.py +528 -0
- chia/_tests/farmer_harvester/test_third_party_harvesters_data.json +29 -0
- chia/_tests/fee_estimation/__init__.py +0 -0
- chia/_tests/fee_estimation/config.py +3 -0
- chia/_tests/fee_estimation/test_fee_estimation_integration.py +262 -0
- chia/_tests/fee_estimation/test_fee_estimation_rpc.py +287 -0
- chia/_tests/fee_estimation/test_fee_estimation_unit_tests.py +144 -0
- chia/_tests/fee_estimation/test_mempoolitem_height_added.py +146 -0
- chia/_tests/generator/__init__.py +0 -0
- chia/_tests/generator/puzzles/__init__.py +0 -0
- chia/_tests/generator/puzzles/test_generator_deserialize.clsp +3 -0
- chia/_tests/generator/puzzles/test_generator_deserialize.clsp.hex +1 -0
- chia/_tests/generator/puzzles/test_multiple_generator_input_arguments.clsp +19 -0
- chia/_tests/generator/puzzles/test_multiple_generator_input_arguments.clsp.hex +1 -0
- chia/_tests/generator/test_compression.py +201 -0
- chia/_tests/generator/test_generator_types.py +44 -0
- chia/_tests/generator/test_rom.py +180 -0
- chia/_tests/plot_sync/__init__.py +0 -0
- chia/_tests/plot_sync/config.py +3 -0
- chia/_tests/plot_sync/test_delta.py +101 -0
- chia/_tests/plot_sync/test_plot_sync.py +618 -0
- chia/_tests/plot_sync/test_receiver.py +451 -0
- chia/_tests/plot_sync/test_sender.py +116 -0
- chia/_tests/plot_sync/test_sync_simulated.py +451 -0
- chia/_tests/plot_sync/util.py +68 -0
- chia/_tests/plotting/__init__.py +0 -0
- chia/_tests/plotting/config.py +3 -0
- chia/_tests/plotting/test_plot_manager.py +781 -0
- chia/_tests/plotting/util.py +12 -0
- chia/_tests/pools/__init__.py +0 -0
- chia/_tests/pools/config.py +5 -0
- chia/_tests/pools/test_pool_cli_parsing.py +128 -0
- chia/_tests/pools/test_pool_cmdline.py +1001 -0
- chia/_tests/pools/test_pool_config.py +42 -0
- chia/_tests/pools/test_pool_puzzles_lifecycle.py +397 -0
- chia/_tests/pools/test_pool_rpc.py +1123 -0
- chia/_tests/pools/test_pool_wallet.py +205 -0
- chia/_tests/pools/test_wallet_pool_store.py +161 -0
- chia/_tests/process_junit.py +348 -0
- chia/_tests/rpc/__init__.py +0 -0
- chia/_tests/rpc/test_rpc_client.py +138 -0
- chia/_tests/rpc/test_rpc_server.py +183 -0
- chia/_tests/simulation/__init__.py +0 -0
- chia/_tests/simulation/config.py +6 -0
- chia/_tests/simulation/test_simulation.py +501 -0
- chia/_tests/simulation/test_simulator.py +232 -0
- chia/_tests/simulation/test_start_simulator.py +107 -0
- chia/_tests/testconfig.py +13 -0
- chia/_tests/timelord/__init__.py +0 -0
- chia/_tests/timelord/config.py +3 -0
- chia/_tests/timelord/test_new_peak.py +437 -0
- chia/_tests/timelord/test_timelord.py +11 -0
- chia/_tests/tools/1315537.json +170 -0
- chia/_tests/tools/1315544.json +160 -0
- chia/_tests/tools/1315630.json +150 -0
- chia/_tests/tools/300000.json +105 -0
- chia/_tests/tools/442734.json +140 -0
- chia/_tests/tools/466212.json +130 -0
- chia/_tests/tools/__init__.py +0 -0
- chia/_tests/tools/config.py +5 -0
- chia/_tests/tools/test-blockchain-db.sqlite +0 -0
- chia/_tests/tools/test_full_sync.py +30 -0
- chia/_tests/tools/test_legacy_keyring.py +82 -0
- chia/_tests/tools/test_run_block.py +128 -0
- chia/_tests/tools/test_virtual_project.py +591 -0
- chia/_tests/util/__init__.py +0 -0
- chia/_tests/util/benchmark_cost.py +170 -0
- chia/_tests/util/benchmarks.py +153 -0
- chia/_tests/util/bip39_test_vectors.json +148 -0
- chia/_tests/util/blockchain.py +134 -0
- chia/_tests/util/blockchain_mock.py +132 -0
- chia/_tests/util/build_network_protocol_files.py +302 -0
- chia/_tests/util/clvm_generator.bin +0 -0
- chia/_tests/util/config.py +3 -0
- chia/_tests/util/constants.py +20 -0
- chia/_tests/util/db_connection.py +37 -0
- chia/_tests/util/full_sync.py +253 -0
- chia/_tests/util/gen_ssl_certs.py +114 -0
- chia/_tests/util/generator_tools_testing.py +45 -0
- chia/_tests/util/get_name_puzzle_conditions.py +52 -0
- chia/_tests/util/key_tool.py +36 -0
- chia/_tests/util/misc.py +675 -0
- chia/_tests/util/network_protocol_data.py +1072 -0
- chia/_tests/util/protocol_messages_bytes-v1.0 +0 -0
- chia/_tests/util/protocol_messages_json.py +2701 -0
- chia/_tests/util/rpc.py +26 -0
- chia/_tests/util/run_block.py +163 -0
- chia/_tests/util/setup_nodes.py +481 -0
- chia/_tests/util/spend_sim.py +492 -0
- chia/_tests/util/split_managers.py +102 -0
- chia/_tests/util/temp_file.py +14 -0
- chia/_tests/util/test_action_scope.py +144 -0
- chia/_tests/util/test_async_pool.py +366 -0
- chia/_tests/util/test_build_job_matrix.py +42 -0
- chia/_tests/util/test_build_network_protocol_files.py +7 -0
- chia/_tests/util/test_chia_version.py +50 -0
- chia/_tests/util/test_collection.py +11 -0
- chia/_tests/util/test_condition_tools.py +229 -0
- chia/_tests/util/test_config.py +426 -0
- chia/_tests/util/test_dump_keyring.py +60 -0
- chia/_tests/util/test_errors.py +10 -0
- chia/_tests/util/test_full_block_utils.py +279 -0
- chia/_tests/util/test_installed.py +20 -0
- chia/_tests/util/test_limited_semaphore.py +53 -0
- chia/_tests/util/test_logging_filter.py +42 -0
- chia/_tests/util/test_misc.py +445 -0
- chia/_tests/util/test_network.py +73 -0
- chia/_tests/util/test_network_protocol_files.py +578 -0
- chia/_tests/util/test_network_protocol_json.py +267 -0
- chia/_tests/util/test_network_protocol_test.py +256 -0
- chia/_tests/util/test_paginator.py +71 -0
- chia/_tests/util/test_pprint.py +17 -0
- chia/_tests/util/test_priority_mutex.py +488 -0
- chia/_tests/util/test_recursive_replace.py +116 -0
- chia/_tests/util/test_replace_str_to_bytes.py +137 -0
- chia/_tests/util/test_service_groups.py +15 -0
- chia/_tests/util/test_ssl_check.py +31 -0
- chia/_tests/util/test_testnet_overrides.py +19 -0
- chia/_tests/util/test_tests_misc.py +38 -0
- chia/_tests/util/test_timing.py +37 -0
- chia/_tests/util/test_trusted_peer.py +51 -0
- chia/_tests/util/time_out_assert.py +191 -0
- chia/_tests/wallet/__init__.py +0 -0
- chia/_tests/wallet/cat_wallet/__init__.py +0 -0
- chia/_tests/wallet/cat_wallet/config.py +4 -0
- chia/_tests/wallet/cat_wallet/test_cat_lifecycle.py +468 -0
- chia/_tests/wallet/cat_wallet/test_cat_outer_puzzle.py +69 -0
- chia/_tests/wallet/cat_wallet/test_cat_wallet.py +1826 -0
- chia/_tests/wallet/cat_wallet/test_offer_lifecycle.py +291 -0
- chia/_tests/wallet/cat_wallet/test_trades.py +2600 -0
- chia/_tests/wallet/clawback/__init__.py +0 -0
- chia/_tests/wallet/clawback/config.py +3 -0
- chia/_tests/wallet/clawback/test_clawback_decorator.py +78 -0
- chia/_tests/wallet/clawback/test_clawback_lifecycle.py +292 -0
- chia/_tests/wallet/clawback/test_clawback_metadata.py +50 -0
- chia/_tests/wallet/config.py +4 -0
- chia/_tests/wallet/conftest.py +278 -0
- chia/_tests/wallet/dao_wallet/__init__.py +0 -0
- chia/_tests/wallet/dao_wallet/config.py +3 -0
- chia/_tests/wallet/dao_wallet/test_dao_clvm.py +1330 -0
- chia/_tests/wallet/dao_wallet/test_dao_wallets.py +3488 -0
- chia/_tests/wallet/db_wallet/__init__.py +0 -0
- chia/_tests/wallet/db_wallet/config.py +3 -0
- chia/_tests/wallet/db_wallet/test_db_graftroot.py +141 -0
- chia/_tests/wallet/db_wallet/test_dl_offers.py +491 -0
- chia/_tests/wallet/db_wallet/test_dl_wallet.py +823 -0
- chia/_tests/wallet/did_wallet/__init__.py +0 -0
- chia/_tests/wallet/did_wallet/config.py +4 -0
- chia/_tests/wallet/did_wallet/test_did.py +2284 -0
- chia/_tests/wallet/nft_wallet/__init__.py +0 -0
- chia/_tests/wallet/nft_wallet/config.py +4 -0
- chia/_tests/wallet/nft_wallet/test_nft_1_offers.py +1493 -0
- chia/_tests/wallet/nft_wallet/test_nft_bulk_mint.py +1024 -0
- chia/_tests/wallet/nft_wallet/test_nft_lifecycle.py +375 -0
- chia/_tests/wallet/nft_wallet/test_nft_offers.py +1209 -0
- chia/_tests/wallet/nft_wallet/test_nft_puzzles.py +172 -0
- chia/_tests/wallet/nft_wallet/test_nft_wallet.py +2584 -0
- chia/_tests/wallet/nft_wallet/test_ownership_outer_puzzle.py +70 -0
- chia/_tests/wallet/rpc/__init__.py +0 -0
- chia/_tests/wallet/rpc/config.py +4 -0
- chia/_tests/wallet/rpc/test_dl_wallet_rpc.py +285 -0
- chia/_tests/wallet/rpc/test_wallet_rpc.py +3153 -0
- chia/_tests/wallet/simple_sync/__init__.py +0 -0
- chia/_tests/wallet/simple_sync/config.py +3 -0
- chia/_tests/wallet/simple_sync/test_simple_sync_protocol.py +718 -0
- chia/_tests/wallet/sync/__init__.py +0 -0
- chia/_tests/wallet/sync/config.py +4 -0
- chia/_tests/wallet/sync/test_wallet_sync.py +1692 -0
- chia/_tests/wallet/test_address_type.py +189 -0
- chia/_tests/wallet/test_bech32m.py +45 -0
- chia/_tests/wallet/test_clvm_streamable.py +244 -0
- chia/_tests/wallet/test_coin_management.py +354 -0
- chia/_tests/wallet/test_coin_selection.py +588 -0
- chia/_tests/wallet/test_conditions.py +400 -0
- chia/_tests/wallet/test_debug_spend_bundle.py +218 -0
- chia/_tests/wallet/test_new_wallet_protocol.py +1174 -0
- chia/_tests/wallet/test_nft_store.py +192 -0
- chia/_tests/wallet/test_notifications.py +196 -0
- chia/_tests/wallet/test_offer_parsing_performance.py +48 -0
- chia/_tests/wallet/test_puzzle_store.py +132 -0
- chia/_tests/wallet/test_sign_coin_spends.py +159 -0
- chia/_tests/wallet/test_signer_protocol.py +947 -0
- chia/_tests/wallet/test_singleton.py +122 -0
- chia/_tests/wallet/test_singleton_lifecycle_fast.py +772 -0
- chia/_tests/wallet/test_singleton_store.py +152 -0
- chia/_tests/wallet/test_taproot.py +19 -0
- chia/_tests/wallet/test_transaction_store.py +945 -0
- chia/_tests/wallet/test_util.py +185 -0
- chia/_tests/wallet/test_wallet.py +2139 -0
- chia/_tests/wallet/test_wallet_action_scope.py +85 -0
- chia/_tests/wallet/test_wallet_blockchain.py +111 -0
- chia/_tests/wallet/test_wallet_coin_store.py +1002 -0
- chia/_tests/wallet/test_wallet_interested_store.py +43 -0
- chia/_tests/wallet/test_wallet_key_val_store.py +40 -0
- chia/_tests/wallet/test_wallet_node.py +780 -0
- chia/_tests/wallet/test_wallet_retry.py +95 -0
- chia/_tests/wallet/test_wallet_state_manager.py +259 -0
- chia/_tests/wallet/test_wallet_test_framework.py +275 -0
- chia/_tests/wallet/test_wallet_trade_store.py +218 -0
- chia/_tests/wallet/test_wallet_user_store.py +34 -0
- chia/_tests/wallet/test_wallet_utils.py +156 -0
- chia/_tests/wallet/vc_wallet/__init__.py +0 -0
- chia/_tests/wallet/vc_wallet/config.py +3 -0
- chia/_tests/wallet/vc_wallet/test_cr_outer_puzzle.py +70 -0
- chia/_tests/wallet/vc_wallet/test_vc_lifecycle.py +883 -0
- chia/_tests/wallet/vc_wallet/test_vc_wallet.py +830 -0
- chia/_tests/wallet/wallet_block_tools.py +327 -0
- chia/_tests/weight_proof/__init__.py +0 -0
- chia/_tests/weight_proof/config.py +3 -0
- chia/_tests/weight_proof/test_weight_proof.py +528 -0
- chia/apis.py +19 -0
- chia/clvm/__init__.py +0 -0
- chia/cmds/__init__.py +0 -0
- chia/cmds/beta.py +184 -0
- chia/cmds/beta_funcs.py +137 -0
- chia/cmds/check_wallet_db.py +420 -0
- chia/cmds/chia.py +151 -0
- chia/cmds/cmd_classes.py +323 -0
- chia/cmds/cmd_helpers.py +242 -0
- chia/cmds/cmds_util.py +488 -0
- chia/cmds/coin_funcs.py +275 -0
- chia/cmds/coins.py +182 -0
- chia/cmds/completion.py +49 -0
- chia/cmds/configure.py +332 -0
- chia/cmds/dao.py +1064 -0
- chia/cmds/dao_funcs.py +598 -0
- chia/cmds/data.py +708 -0
- chia/cmds/data_funcs.py +385 -0
- chia/cmds/db.py +87 -0
- chia/cmds/db_backup_func.py +77 -0
- chia/cmds/db_upgrade_func.py +452 -0
- chia/cmds/db_validate_func.py +184 -0
- chia/cmds/dev.py +18 -0
- chia/cmds/farm.py +100 -0
- chia/cmds/farm_funcs.py +200 -0
- chia/cmds/gh.py +275 -0
- chia/cmds/init.py +63 -0
- chia/cmds/init_funcs.py +367 -0
- chia/cmds/installers.py +131 -0
- chia/cmds/keys.py +527 -0
- chia/cmds/keys_funcs.py +863 -0
- chia/cmds/netspace.py +50 -0
- chia/cmds/netspace_funcs.py +54 -0
- chia/cmds/options.py +32 -0
- chia/cmds/param_types.py +238 -0
- chia/cmds/passphrase.py +131 -0
- chia/cmds/passphrase_funcs.py +292 -0
- chia/cmds/peer.py +51 -0
- chia/cmds/peer_funcs.py +129 -0
- chia/cmds/plotnft.py +260 -0
- chia/cmds/plotnft_funcs.py +405 -0
- chia/cmds/plots.py +230 -0
- chia/cmds/plotters.py +18 -0
- chia/cmds/rpc.py +208 -0
- chia/cmds/show.py +72 -0
- chia/cmds/show_funcs.py +215 -0
- chia/cmds/signer.py +296 -0
- chia/cmds/sim.py +225 -0
- chia/cmds/sim_funcs.py +509 -0
- chia/cmds/start.py +24 -0
- chia/cmds/start_funcs.py +109 -0
- chia/cmds/stop.py +62 -0
- chia/cmds/units.py +9 -0
- chia/cmds/wallet.py +1901 -0
- chia/cmds/wallet_funcs.py +1874 -0
- chia/consensus/__init__.py +0 -0
- chia/consensus/block_body_validation.py +562 -0
- chia/consensus/block_creation.py +546 -0
- chia/consensus/block_header_validation.py +1059 -0
- chia/consensus/block_record.py +31 -0
- chia/consensus/block_rewards.py +53 -0
- chia/consensus/blockchain.py +1087 -0
- chia/consensus/blockchain_interface.py +56 -0
- chia/consensus/coinbase.py +30 -0
- chia/consensus/condition_costs.py +9 -0
- chia/consensus/constants.py +49 -0
- chia/consensus/cost_calculator.py +15 -0
- chia/consensus/default_constants.py +89 -0
- chia/consensus/deficit.py +55 -0
- chia/consensus/difficulty_adjustment.py +412 -0
- chia/consensus/find_fork_point.py +111 -0
- chia/consensus/full_block_to_block_record.py +167 -0
- chia/consensus/get_block_challenge.py +106 -0
- chia/consensus/get_block_generator.py +27 -0
- chia/consensus/make_sub_epoch_summary.py +210 -0
- chia/consensus/multiprocess_validation.py +268 -0
- chia/consensus/pos_quality.py +19 -0
- chia/consensus/pot_iterations.py +67 -0
- chia/consensus/puzzles/__init__.py +0 -0
- chia/consensus/puzzles/chialisp_deserialisation.clsp +69 -0
- chia/consensus/puzzles/chialisp_deserialisation.clsp.hex +1 -0
- chia/consensus/puzzles/rom_bootstrap_generator.clsp +37 -0
- chia/consensus/puzzles/rom_bootstrap_generator.clsp.hex +1 -0
- chia/consensus/vdf_info_computation.py +156 -0
- chia/daemon/__init__.py +0 -0
- chia/daemon/client.py +252 -0
- chia/daemon/keychain_proxy.py +502 -0
- chia/daemon/keychain_server.py +365 -0
- chia/daemon/server.py +1606 -0
- chia/daemon/windows_signal.py +56 -0
- chia/data_layer/__init__.py +0 -0
- chia/data_layer/data_layer.py +1291 -0
- chia/data_layer/data_layer_api.py +33 -0
- chia/data_layer/data_layer_errors.py +50 -0
- chia/data_layer/data_layer_server.py +170 -0
- chia/data_layer/data_layer_util.py +985 -0
- chia/data_layer/data_layer_wallet.py +1311 -0
- chia/data_layer/data_store.py +2267 -0
- chia/data_layer/dl_wallet_store.py +407 -0
- chia/data_layer/download_data.py +389 -0
- chia/data_layer/puzzles/__init__.py +0 -0
- chia/data_layer/puzzles/graftroot_dl_offers.clsp +100 -0
- chia/data_layer/puzzles/graftroot_dl_offers.clsp.hex +1 -0
- chia/data_layer/s3_plugin_config.yml +33 -0
- chia/data_layer/s3_plugin_service.py +468 -0
- chia/data_layer/util/__init__.py +0 -0
- chia/data_layer/util/benchmark.py +107 -0
- chia/data_layer/util/plugin.py +40 -0
- chia/farmer/__init__.py +0 -0
- chia/farmer/farmer.py +923 -0
- chia/farmer/farmer_api.py +820 -0
- chia/full_node/__init__.py +0 -0
- chia/full_node/bitcoin_fee_estimator.py +85 -0
- chia/full_node/block_height_map.py +271 -0
- chia/full_node/block_store.py +576 -0
- chia/full_node/bundle_tools.py +19 -0
- chia/full_node/coin_store.py +647 -0
- chia/full_node/fee_estimate.py +54 -0
- chia/full_node/fee_estimate_store.py +24 -0
- chia/full_node/fee_estimation.py +92 -0
- chia/full_node/fee_estimator.py +90 -0
- chia/full_node/fee_estimator_constants.py +38 -0
- chia/full_node/fee_estimator_interface.py +42 -0
- chia/full_node/fee_history.py +25 -0
- chia/full_node/fee_tracker.py +564 -0
- chia/full_node/full_node.py +3327 -0
- chia/full_node/full_node_api.py +2025 -0
- chia/full_node/full_node_store.py +1033 -0
- chia/full_node/hint_management.py +56 -0
- chia/full_node/hint_store.py +93 -0
- chia/full_node/mempool.py +589 -0
- chia/full_node/mempool_check_conditions.py +146 -0
- chia/full_node/mempool_manager.py +853 -0
- chia/full_node/pending_tx_cache.py +112 -0
- chia/full_node/puzzles/__init__.py +0 -0
- chia/full_node/puzzles/block_program_zero.clsp +14 -0
- chia/full_node/puzzles/block_program_zero.clsp.hex +1 -0
- chia/full_node/puzzles/decompress_coin_spend_entry.clsp +5 -0
- chia/full_node/puzzles/decompress_coin_spend_entry.clsp.hex +1 -0
- chia/full_node/puzzles/decompress_coin_spend_entry_with_prefix.clsp +7 -0
- chia/full_node/puzzles/decompress_coin_spend_entry_with_prefix.clsp.hex +1 -0
- chia/full_node/puzzles/decompress_puzzle.clsp +6 -0
- chia/full_node/puzzles/decompress_puzzle.clsp.hex +1 -0
- chia/full_node/signage_point.py +16 -0
- chia/full_node/subscriptions.py +247 -0
- chia/full_node/sync_store.py +146 -0
- chia/full_node/tx_processing_queue.py +78 -0
- chia/full_node/util/__init__.py +0 -0
- chia/full_node/weight_proof.py +1720 -0
- chia/harvester/__init__.py +0 -0
- chia/harvester/harvester.py +272 -0
- chia/harvester/harvester_api.py +380 -0
- chia/introducer/__init__.py +0 -0
- chia/introducer/introducer.py +122 -0
- chia/introducer/introducer_api.py +70 -0
- chia/legacy/__init__.py +0 -0
- chia/legacy/keyring.py +155 -0
- chia/plot_sync/__init__.py +0 -0
- chia/plot_sync/delta.py +61 -0
- chia/plot_sync/exceptions.py +56 -0
- chia/plot_sync/receiver.py +386 -0
- chia/plot_sync/sender.py +340 -0
- chia/plot_sync/util.py +43 -0
- chia/plotters/__init__.py +0 -0
- chia/plotters/bladebit.py +388 -0
- chia/plotters/chiapos.py +63 -0
- chia/plotters/madmax.py +224 -0
- chia/plotters/plotters.py +577 -0
- chia/plotters/plotters_util.py +133 -0
- chia/plotting/__init__.py +0 -0
- chia/plotting/cache.py +213 -0
- chia/plotting/check_plots.py +283 -0
- chia/plotting/create_plots.py +278 -0
- chia/plotting/manager.py +436 -0
- chia/plotting/util.py +336 -0
- chia/pools/__init__.py +0 -0
- chia/pools/pool_config.py +110 -0
- chia/pools/pool_puzzles.py +459 -0
- chia/pools/pool_wallet.py +933 -0
- chia/pools/pool_wallet_info.py +118 -0
- chia/pools/puzzles/__init__.py +0 -0
- chia/pools/puzzles/pool_member_innerpuz.clsp +70 -0
- chia/pools/puzzles/pool_member_innerpuz.clsp.hex +1 -0
- chia/pools/puzzles/pool_waitingroom_innerpuz.clsp +69 -0
- chia/pools/puzzles/pool_waitingroom_innerpuz.clsp.hex +1 -0
- chia/protocols/__init__.py +0 -0
- chia/protocols/farmer_protocol.py +102 -0
- chia/protocols/full_node_protocol.py +219 -0
- chia/protocols/harvester_protocol.py +216 -0
- chia/protocols/introducer_protocol.py +25 -0
- chia/protocols/pool_protocol.py +177 -0
- chia/protocols/protocol_message_types.py +139 -0
- chia/protocols/protocol_state_machine.py +87 -0
- chia/protocols/protocol_timing.py +8 -0
- chia/protocols/shared_protocol.py +86 -0
- chia/protocols/timelord_protocol.py +93 -0
- chia/protocols/wallet_protocol.py +401 -0
- chia/py.typed +0 -0
- chia/rpc/__init__.py +0 -0
- chia/rpc/crawler_rpc_api.py +80 -0
- chia/rpc/data_layer_rpc_api.py +644 -0
- chia/rpc/data_layer_rpc_client.py +188 -0
- chia/rpc/data_layer_rpc_util.py +58 -0
- chia/rpc/farmer_rpc_api.py +365 -0
- chia/rpc/farmer_rpc_client.py +86 -0
- chia/rpc/full_node_rpc_api.py +959 -0
- chia/rpc/full_node_rpc_client.py +292 -0
- chia/rpc/harvester_rpc_api.py +141 -0
- chia/rpc/harvester_rpc_client.py +54 -0
- chia/rpc/rpc_client.py +164 -0
- chia/rpc/rpc_server.py +521 -0
- chia/rpc/timelord_rpc_api.py +32 -0
- chia/rpc/util.py +93 -0
- chia/rpc/wallet_request_types.py +904 -0
- chia/rpc/wallet_rpc_api.py +4943 -0
- chia/rpc/wallet_rpc_client.py +1814 -0
- chia/seeder/__init__.py +0 -0
- chia/seeder/crawl_store.py +425 -0
- chia/seeder/crawler.py +410 -0
- chia/seeder/crawler_api.py +135 -0
- chia/seeder/dns_server.py +593 -0
- chia/seeder/peer_record.py +146 -0
- chia/seeder/start_crawler.py +92 -0
- chia/server/__init__.py +0 -0
- chia/server/address_manager.py +658 -0
- chia/server/address_manager_store.py +237 -0
- chia/server/api_protocol.py +116 -0
- chia/server/capabilities.py +24 -0
- chia/server/chia_policy.py +346 -0
- chia/server/introducer_peers.py +76 -0
- chia/server/node_discovery.py +714 -0
- chia/server/outbound_message.py +33 -0
- chia/server/rate_limit_numbers.py +214 -0
- chia/server/rate_limits.py +153 -0
- chia/server/server.py +741 -0
- chia/server/signal_handlers.py +120 -0
- chia/server/ssl_context.py +32 -0
- chia/server/start_data_layer.py +151 -0
- chia/server/start_farmer.py +98 -0
- chia/server/start_full_node.py +112 -0
- chia/server/start_harvester.py +93 -0
- chia/server/start_introducer.py +81 -0
- chia/server/start_service.py +316 -0
- chia/server/start_timelord.py +89 -0
- chia/server/start_wallet.py +113 -0
- chia/server/upnp.py +118 -0
- chia/server/ws_connection.py +766 -0
- chia/simulator/__init__.py +0 -0
- chia/simulator/add_blocks_in_batches.py +54 -0
- chia/simulator/block_tools.py +2054 -0
- chia/simulator/full_node_simulator.py +794 -0
- chia/simulator/keyring.py +128 -0
- chia/simulator/setup_services.py +506 -0
- chia/simulator/simulator_constants.py +13 -0
- chia/simulator/simulator_full_node_rpc_api.py +99 -0
- chia/simulator/simulator_full_node_rpc_client.py +60 -0
- chia/simulator/simulator_protocol.py +29 -0
- chia/simulator/simulator_test_tools.py +164 -0
- chia/simulator/socket.py +24 -0
- chia/simulator/ssl_certs.py +114 -0
- chia/simulator/ssl_certs_1.py +697 -0
- chia/simulator/ssl_certs_10.py +697 -0
- chia/simulator/ssl_certs_2.py +697 -0
- chia/simulator/ssl_certs_3.py +697 -0
- chia/simulator/ssl_certs_4.py +697 -0
- chia/simulator/ssl_certs_5.py +697 -0
- chia/simulator/ssl_certs_6.py +697 -0
- chia/simulator/ssl_certs_7.py +697 -0
- chia/simulator/ssl_certs_8.py +697 -0
- chia/simulator/ssl_certs_9.py +697 -0
- chia/simulator/start_simulator.py +143 -0
- chia/simulator/wallet_tools.py +246 -0
- chia/ssl/__init__.py +0 -0
- chia/ssl/chia_ca.crt +19 -0
- chia/ssl/chia_ca.key +28 -0
- chia/ssl/create_ssl.py +249 -0
- chia/ssl/dst_root_ca.pem +20 -0
- chia/timelord/__init__.py +0 -0
- chia/timelord/iters_from_block.py +50 -0
- chia/timelord/timelord.py +1226 -0
- chia/timelord/timelord_api.py +138 -0
- chia/timelord/timelord_launcher.py +190 -0
- chia/timelord/timelord_state.py +244 -0
- chia/timelord/types.py +22 -0
- chia/types/__init__.py +0 -0
- chia/types/aliases.py +35 -0
- chia/types/block_protocol.py +20 -0
- chia/types/blockchain_format/__init__.py +0 -0
- chia/types/blockchain_format/classgroup.py +5 -0
- chia/types/blockchain_format/coin.py +28 -0
- chia/types/blockchain_format/foliage.py +8 -0
- chia/types/blockchain_format/pool_target.py +5 -0
- chia/types/blockchain_format/program.py +269 -0
- chia/types/blockchain_format/proof_of_space.py +135 -0
- chia/types/blockchain_format/reward_chain_block.py +6 -0
- chia/types/blockchain_format/serialized_program.py +5 -0
- chia/types/blockchain_format/sized_bytes.py +11 -0
- chia/types/blockchain_format/slots.py +9 -0
- chia/types/blockchain_format/sub_epoch_summary.py +5 -0
- chia/types/blockchain_format/tree_hash.py +72 -0
- chia/types/blockchain_format/vdf.py +86 -0
- chia/types/clvm_cost.py +13 -0
- chia/types/coin_record.py +43 -0
- chia/types/coin_spend.py +115 -0
- chia/types/condition_opcodes.py +73 -0
- chia/types/condition_with_args.py +16 -0
- chia/types/eligible_coin_spends.py +365 -0
- chia/types/end_of_slot_bundle.py +5 -0
- chia/types/fee_rate.py +38 -0
- chia/types/full_block.py +5 -0
- chia/types/generator_types.py +13 -0
- chia/types/header_block.py +5 -0
- chia/types/internal_mempool_item.py +18 -0
- chia/types/mempool_inclusion_status.py +9 -0
- chia/types/mempool_item.py +85 -0
- chia/types/mempool_submission_status.py +30 -0
- chia/types/mojos.py +7 -0
- chia/types/peer_info.py +64 -0
- chia/types/signing_mode.py +29 -0
- chia/types/spend_bundle.py +30 -0
- chia/types/spend_bundle_conditions.py +7 -0
- chia/types/transaction_queue_entry.py +55 -0
- chia/types/unfinished_block.py +5 -0
- chia/types/unfinished_header_block.py +37 -0
- chia/types/validation_state.py +14 -0
- chia/types/weight_proof.py +49 -0
- chia/util/__init__.py +0 -0
- chia/util/action_scope.py +168 -0
- chia/util/async_pool.py +226 -0
- chia/util/augmented_chain.py +134 -0
- chia/util/batches.py +42 -0
- chia/util/bech32m.py +126 -0
- chia/util/beta_metrics.py +119 -0
- chia/util/block_cache.py +56 -0
- chia/util/byte_types.py +12 -0
- chia/util/check_fork_next_block.py +33 -0
- chia/util/chia_logging.py +144 -0
- chia/util/chia_version.py +33 -0
- chia/util/collection.py +17 -0
- chia/util/condition_tools.py +201 -0
- chia/util/config.py +367 -0
- chia/util/cpu.py +22 -0
- chia/util/db_synchronous.py +23 -0
- chia/util/db_version.py +32 -0
- chia/util/db_wrapper.py +430 -0
- chia/util/default_root.py +27 -0
- chia/util/dump_keyring.py +93 -0
- chia/util/english.txt +2048 -0
- chia/util/errors.py +353 -0
- chia/util/file_keyring.py +469 -0
- chia/util/files.py +97 -0
- chia/util/full_block_utils.py +345 -0
- chia/util/generator_tools.py +72 -0
- chia/util/hash.py +31 -0
- chia/util/initial-config.yaml +694 -0
- chia/util/inline_executor.py +26 -0
- chia/util/ints.py +19 -0
- chia/util/ip_address.py +39 -0
- chia/util/json_util.py +37 -0
- chia/util/keychain.py +676 -0
- chia/util/keyring_wrapper.py +327 -0
- chia/util/limited_semaphore.py +41 -0
- chia/util/lock.py +49 -0
- chia/util/log_exceptions.py +32 -0
- chia/util/logging.py +36 -0
- chia/util/lru_cache.py +31 -0
- chia/util/math.py +20 -0
- chia/util/network.py +182 -0
- chia/util/paginator.py +48 -0
- chia/util/path.py +31 -0
- chia/util/permissions.py +20 -0
- chia/util/prev_transaction_block.py +21 -0
- chia/util/priority_mutex.py +95 -0
- chia/util/profiler.py +197 -0
- chia/util/recursive_replace.py +24 -0
- chia/util/safe_cancel_task.py +16 -0
- chia/util/service_groups.py +47 -0
- chia/util/setproctitle.py +22 -0
- chia/util/significant_bits.py +32 -0
- chia/util/ssl_check.py +213 -0
- chia/util/streamable.py +642 -0
- chia/util/task_referencer.py +59 -0
- chia/util/task_timing.py +382 -0
- chia/util/timing.py +67 -0
- chia/util/vdf_prover.py +30 -0
- chia/util/virtual_project_analysis.py +540 -0
- chia/util/ws_message.py +66 -0
- chia/wallet/__init__.py +0 -0
- chia/wallet/cat_wallet/__init__.py +0 -0
- chia/wallet/cat_wallet/cat_constants.py +75 -0
- chia/wallet/cat_wallet/cat_info.py +47 -0
- chia/wallet/cat_wallet/cat_outer_puzzle.py +120 -0
- chia/wallet/cat_wallet/cat_utils.py +164 -0
- chia/wallet/cat_wallet/cat_wallet.py +855 -0
- chia/wallet/cat_wallet/dao_cat_info.py +28 -0
- chia/wallet/cat_wallet/dao_cat_wallet.py +669 -0
- chia/wallet/cat_wallet/lineage_store.py +74 -0
- chia/wallet/cat_wallet/puzzles/__init__.py +0 -0
- chia/wallet/cat_wallet/puzzles/cat_truths.clib +31 -0
- chia/wallet/cat_wallet/puzzles/cat_v2.clsp +397 -0
- chia/wallet/cat_wallet/puzzles/cat_v2.clsp.hex +1 -0
- chia/wallet/cat_wallet/puzzles/delegated_tail.clsp +25 -0
- chia/wallet/cat_wallet/puzzles/delegated_tail.clsp.hex +1 -0
- chia/wallet/cat_wallet/puzzles/everything_with_signature.clsp +15 -0
- chia/wallet/cat_wallet/puzzles/everything_with_signature.clsp.hex +1 -0
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id.clsp +26 -0
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id.clsp.hex +1 -0
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id_or_singleton.clsp +42 -0
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id_or_singleton.clsp.hex +1 -0
- chia/wallet/cat_wallet/puzzles/genesis_by_puzzle_hash.clsp +24 -0
- chia/wallet/cat_wallet/puzzles/genesis_by_puzzle_hash.clsp.hex +1 -0
- chia/wallet/coin_selection.py +188 -0
- chia/wallet/conditions.py +1512 -0
- chia/wallet/dao_wallet/__init__.py +0 -0
- chia/wallet/dao_wallet/dao_info.py +61 -0
- chia/wallet/dao_wallet/dao_utils.py +811 -0
- chia/wallet/dao_wallet/dao_wallet.py +2119 -0
- chia/wallet/db_wallet/__init__.py +0 -0
- chia/wallet/db_wallet/db_wallet_puzzles.py +111 -0
- chia/wallet/derivation_record.py +30 -0
- chia/wallet/derive_keys.py +146 -0
- chia/wallet/did_wallet/__init__.py +0 -0
- chia/wallet/did_wallet/did_info.py +39 -0
- chia/wallet/did_wallet/did_wallet.py +1494 -0
- chia/wallet/did_wallet/did_wallet_puzzles.py +221 -0
- chia/wallet/did_wallet/puzzles/__init__.py +0 -0
- chia/wallet/did_wallet/puzzles/did_innerpuz.clsp +135 -0
- chia/wallet/did_wallet/puzzles/did_innerpuz.clsp.hex +1 -0
- chia/wallet/driver_protocol.py +26 -0
- chia/wallet/key_val_store.py +55 -0
- chia/wallet/lineage_proof.py +58 -0
- chia/wallet/nft_wallet/__init__.py +0 -0
- chia/wallet/nft_wallet/metadata_outer_puzzle.py +92 -0
- chia/wallet/nft_wallet/nft_info.py +120 -0
- chia/wallet/nft_wallet/nft_puzzles.py +305 -0
- chia/wallet/nft_wallet/nft_wallet.py +1687 -0
- chia/wallet/nft_wallet/ownership_outer_puzzle.py +101 -0
- chia/wallet/nft_wallet/puzzles/__init__.py +0 -0
- chia/wallet/nft_wallet/puzzles/create_nft_launcher_from_did.clsp +6 -0
- chia/wallet/nft_wallet/puzzles/create_nft_launcher_from_did.clsp.hex +1 -0
- chia/wallet/nft_wallet/puzzles/nft_intermediate_launcher.clsp +6 -0
- chia/wallet/nft_wallet/puzzles/nft_intermediate_launcher.clsp.hex +1 -0
- chia/wallet/nft_wallet/puzzles/nft_metadata_updater_default.clsp +30 -0
- chia/wallet/nft_wallet/puzzles/nft_metadata_updater_default.clsp.hex +1 -0
- chia/wallet/nft_wallet/puzzles/nft_metadata_updater_updateable.clsp +28 -0
- chia/wallet/nft_wallet/puzzles/nft_metadata_updater_updateable.clsp.hex +1 -0
- chia/wallet/nft_wallet/puzzles/nft_ownership_layer.clsp +100 -0
- chia/wallet/nft_wallet/puzzles/nft_ownership_layer.clsp.hex +1 -0
- chia/wallet/nft_wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clsp +78 -0
- chia/wallet/nft_wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clsp.hex +1 -0
- chia/wallet/nft_wallet/puzzles/nft_state_layer.clsp +74 -0
- chia/wallet/nft_wallet/puzzles/nft_state_layer.clsp.hex +1 -0
- chia/wallet/nft_wallet/singleton_outer_puzzle.py +101 -0
- chia/wallet/nft_wallet/transfer_program_puzzle.py +82 -0
- chia/wallet/nft_wallet/uncurry_nft.py +217 -0
- chia/wallet/notification_manager.py +117 -0
- chia/wallet/notification_store.py +178 -0
- chia/wallet/outer_puzzles.py +84 -0
- chia/wallet/payment.py +33 -0
- chia/wallet/puzzle_drivers.py +118 -0
- chia/wallet/puzzles/__init__.py +0 -0
- chia/wallet/puzzles/augmented_condition.clsp +13 -0
- chia/wallet/puzzles/augmented_condition.clsp.hex +1 -0
- chia/wallet/puzzles/clawback/__init__.py +0 -0
- chia/wallet/puzzles/clawback/drivers.py +188 -0
- chia/wallet/puzzles/clawback/metadata.py +38 -0
- chia/wallet/puzzles/clawback/puzzle_decorator.py +67 -0
- chia/wallet/puzzles/condition_codes.clib +77 -0
- chia/wallet/puzzles/curry-and-treehash.clib +102 -0
- chia/wallet/puzzles/curry.clib +135 -0
- chia/wallet/puzzles/curry_by_index.clib +16 -0
- chia/wallet/puzzles/dao_cat_eve.clsp +17 -0
- chia/wallet/puzzles/dao_cat_eve.clsp.hex +1 -0
- chia/wallet/puzzles/dao_cat_launcher.clsp +36 -0
- chia/wallet/puzzles/dao_cat_launcher.clsp.hex +1 -0
- chia/wallet/puzzles/dao_finished_state.clsp +35 -0
- chia/wallet/puzzles/dao_finished_state.clsp.hex +1 -0
- chia/wallet/puzzles/dao_finished_state.clsp.hex.sha256tree +1 -0
- chia/wallet/puzzles/dao_lockup.clsp +288 -0
- chia/wallet/puzzles/dao_lockup.clsp.hex +1 -0
- chia/wallet/puzzles/dao_lockup.clsp.hex.sha256tree +1 -0
- chia/wallet/puzzles/dao_proposal.clsp +377 -0
- chia/wallet/puzzles/dao_proposal.clsp.hex +1 -0
- chia/wallet/puzzles/dao_proposal.clsp.hex.sha256tree +1 -0
- chia/wallet/puzzles/dao_proposal_timer.clsp +78 -0
- chia/wallet/puzzles/dao_proposal_timer.clsp.hex +1 -0
- chia/wallet/puzzles/dao_proposal_timer.clsp.hex.sha256tree +1 -0
- chia/wallet/puzzles/dao_proposal_validator.clsp +87 -0
- chia/wallet/puzzles/dao_proposal_validator.clsp.hex +1 -0
- chia/wallet/puzzles/dao_proposal_validator.clsp.hex.sha256tree +1 -0
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp +240 -0
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp.hex +1 -0
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp.hex.sha256tree +1 -0
- chia/wallet/puzzles/dao_treasury.clsp +115 -0
- chia/wallet/puzzles/dao_treasury.clsp.hex +1 -0
- chia/wallet/puzzles/dao_update_proposal.clsp +44 -0
- chia/wallet/puzzles/dao_update_proposal.clsp.hex +1 -0
- chia/wallet/puzzles/deployed_puzzle_hashes.json +67 -0
- chia/wallet/puzzles/json.clib +25 -0
- chia/wallet/puzzles/load_clvm.py +161 -0
- chia/wallet/puzzles/merkle_utils.clib +18 -0
- chia/wallet/puzzles/notification.clsp +7 -0
- chia/wallet/puzzles/notification.clsp.hex +1 -0
- chia/wallet/puzzles/p2_1_of_n.clsp +22 -0
- chia/wallet/puzzles/p2_1_of_n.clsp.hex +1 -0
- chia/wallet/puzzles/p2_conditions.clsp +3 -0
- chia/wallet/puzzles/p2_conditions.clsp.hex +1 -0
- chia/wallet/puzzles/p2_conditions.py +26 -0
- chia/wallet/puzzles/p2_delegated_conditions.clsp +18 -0
- chia/wallet/puzzles/p2_delegated_conditions.clsp.hex +1 -0
- chia/wallet/puzzles/p2_delegated_conditions.py +21 -0
- chia/wallet/puzzles/p2_delegated_puzzle.clsp +19 -0
- chia/wallet/puzzles/p2_delegated_puzzle.clsp.hex +1 -0
- chia/wallet/puzzles/p2_delegated_puzzle.py +34 -0
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clsp +91 -0
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clsp.hex +1 -0
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py +160 -0
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.clsp +108 -0
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.clsp.hex +1 -0
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.py +21 -0
- chia/wallet/puzzles/p2_parent.clsp +19 -0
- chia/wallet/puzzles/p2_parent.clsp.hex +1 -0
- chia/wallet/puzzles/p2_puzzle_hash.clsp +18 -0
- chia/wallet/puzzles/p2_puzzle_hash.clsp.hex +1 -0
- chia/wallet/puzzles/p2_puzzle_hash.py +27 -0
- chia/wallet/puzzles/p2_singleton.clsp +30 -0
- chia/wallet/puzzles/p2_singleton.clsp.hex +1 -0
- chia/wallet/puzzles/p2_singleton_aggregator.clsp +81 -0
- chia/wallet/puzzles/p2_singleton_aggregator.clsp.hex +1 -0
- chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clsp +50 -0
- chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clsp.hex +1 -0
- chia/wallet/puzzles/p2_singleton_via_delegated_puzzle.clsp +47 -0
- chia/wallet/puzzles/p2_singleton_via_delegated_puzzle.clsp.hex +1 -0
- chia/wallet/puzzles/puzzle_utils.py +34 -0
- chia/wallet/puzzles/settlement_payments.clsp +49 -0
- chia/wallet/puzzles/settlement_payments.clsp.hex +1 -0
- chia/wallet/puzzles/sha256tree.clib +11 -0
- chia/wallet/puzzles/singleton_launcher.clsp +16 -0
- chia/wallet/puzzles/singleton_launcher.clsp.hex +1 -0
- chia/wallet/puzzles/singleton_top_layer.clsp +177 -0
- chia/wallet/puzzles/singleton_top_layer.clsp.hex +1 -0
- chia/wallet/puzzles/singleton_top_layer.py +296 -0
- chia/wallet/puzzles/singleton_top_layer_v1_1.clsp +107 -0
- chia/wallet/puzzles/singleton_top_layer_v1_1.clsp.hex +1 -0
- chia/wallet/puzzles/singleton_top_layer_v1_1.py +345 -0
- chia/wallet/puzzles/singleton_truths.clib +21 -0
- chia/wallet/puzzles/tails.py +348 -0
- chia/wallet/puzzles/utility_macros.clib +48 -0
- chia/wallet/signer_protocol.py +125 -0
- chia/wallet/singleton.py +106 -0
- chia/wallet/singleton_record.py +30 -0
- chia/wallet/trade_manager.py +1102 -0
- chia/wallet/trade_record.py +67 -0
- chia/wallet/trading/__init__.py +0 -0
- chia/wallet/trading/offer.py +702 -0
- chia/wallet/trading/trade_status.py +13 -0
- chia/wallet/trading/trade_store.py +526 -0
- chia/wallet/transaction_record.py +158 -0
- chia/wallet/transaction_sorting.py +14 -0
- chia/wallet/uncurried_puzzle.py +17 -0
- chia/wallet/util/__init__.py +0 -0
- chia/wallet/util/address_type.py +55 -0
- chia/wallet/util/blind_signer_tl.py +164 -0
- chia/wallet/util/clvm_streamable.py +203 -0
- chia/wallet/util/compute_hints.py +66 -0
- chia/wallet/util/compute_memos.py +43 -0
- chia/wallet/util/curry_and_treehash.py +91 -0
- chia/wallet/util/debug_spend_bundle.py +232 -0
- chia/wallet/util/merkle_tree.py +100 -0
- chia/wallet/util/merkle_utils.py +102 -0
- chia/wallet/util/new_peak_queue.py +82 -0
- chia/wallet/util/notifications.py +12 -0
- chia/wallet/util/peer_request_cache.py +174 -0
- chia/wallet/util/pprint.py +39 -0
- chia/wallet/util/puzzle_compression.py +95 -0
- chia/wallet/util/puzzle_decorator.py +100 -0
- chia/wallet/util/puzzle_decorator_type.py +7 -0
- chia/wallet/util/query_filter.py +59 -0
- chia/wallet/util/transaction_type.py +23 -0
- chia/wallet/util/tx_config.py +158 -0
- chia/wallet/util/wallet_sync_utils.py +351 -0
- chia/wallet/util/wallet_types.py +72 -0
- chia/wallet/vc_wallet/__init__.py +0 -0
- chia/wallet/vc_wallet/cr_cat_drivers.py +664 -0
- chia/wallet/vc_wallet/cr_cat_wallet.py +877 -0
- chia/wallet/vc_wallet/cr_outer_puzzle.py +102 -0
- chia/wallet/vc_wallet/cr_puzzles/__init__.py +0 -0
- chia/wallet/vc_wallet/cr_puzzles/conditions_w_fee_announce.clsp +3 -0
- chia/wallet/vc_wallet/cr_puzzles/conditions_w_fee_announce.clsp.hex +1 -0
- chia/wallet/vc_wallet/cr_puzzles/credential_restriction.clsp +304 -0
- chia/wallet/vc_wallet/cr_puzzles/credential_restriction.clsp.hex +1 -0
- chia/wallet/vc_wallet/cr_puzzles/flag_proofs_checker.clsp +45 -0
- chia/wallet/vc_wallet/cr_puzzles/flag_proofs_checker.clsp.hex +1 -0
- chia/wallet/vc_wallet/vc_drivers.py +838 -0
- chia/wallet/vc_wallet/vc_puzzles/__init__.py +0 -0
- chia/wallet/vc_wallet/vc_puzzles/covenant_layer.clsp +30 -0
- chia/wallet/vc_wallet/vc_puzzles/covenant_layer.clsp.hex +1 -0
- chia/wallet/vc_wallet/vc_puzzles/eml_covenant_morpher.clsp +75 -0
- chia/wallet/vc_wallet/vc_puzzles/eml_covenant_morpher.clsp.hex +1 -0
- chia/wallet/vc_wallet/vc_puzzles/eml_transfer_program_covenant_adapter.clsp +32 -0
- chia/wallet/vc_wallet/vc_puzzles/eml_transfer_program_covenant_adapter.clsp.hex +1 -0
- chia/wallet/vc_wallet/vc_puzzles/eml_update_metadata_with_DID.clsp +80 -0
- chia/wallet/vc_wallet/vc_puzzles/eml_update_metadata_with_DID.clsp.hex +1 -0
- chia/wallet/vc_wallet/vc_puzzles/exigent_metadata_layer.clsp +163 -0
- chia/wallet/vc_wallet/vc_puzzles/exigent_metadata_layer.clsp.hex +1 -0
- chia/wallet/vc_wallet/vc_puzzles/p2_announced_delegated_puzzle.clsp +16 -0
- chia/wallet/vc_wallet/vc_puzzles/p2_announced_delegated_puzzle.clsp.hex +1 -0
- chia/wallet/vc_wallet/vc_puzzles/standard_vc_backdoor_puzzle.clsp +74 -0
- chia/wallet/vc_wallet/vc_puzzles/standard_vc_backdoor_puzzle.clsp.hex +1 -0
- chia/wallet/vc_wallet/vc_puzzles/std_parent_morpher.clsp +23 -0
- chia/wallet/vc_wallet/vc_puzzles/std_parent_morpher.clsp.hex +1 -0
- chia/wallet/vc_wallet/vc_puzzles/viral_backdoor.clsp +64 -0
- chia/wallet/vc_wallet/vc_puzzles/viral_backdoor.clsp.hex +1 -0
- chia/wallet/vc_wallet/vc_store.py +263 -0
- chia/wallet/vc_wallet/vc_wallet.py +638 -0
- chia/wallet/wallet.py +698 -0
- chia/wallet/wallet_action_scope.py +96 -0
- chia/wallet/wallet_blockchain.py +244 -0
- chia/wallet/wallet_coin_record.py +72 -0
- chia/wallet/wallet_coin_store.py +351 -0
- chia/wallet/wallet_info.py +35 -0
- chia/wallet/wallet_interested_store.py +188 -0
- chia/wallet/wallet_nft_store.py +279 -0
- chia/wallet/wallet_node.py +1765 -0
- chia/wallet/wallet_node_api.py +207 -0
- chia/wallet/wallet_pool_store.py +119 -0
- chia/wallet/wallet_protocol.py +90 -0
- chia/wallet/wallet_puzzle_store.py +396 -0
- chia/wallet/wallet_retry_store.py +70 -0
- chia/wallet/wallet_singleton_store.py +259 -0
- chia/wallet/wallet_spend_bundle.py +25 -0
- chia/wallet/wallet_state_manager.py +2819 -0
- chia/wallet/wallet_transaction_store.py +496 -0
- chia/wallet/wallet_user_store.py +110 -0
- chia/wallet/wallet_weight_proof_handler.py +126 -0
- chia_blockchain-2.5.1rc1.dist-info/LICENSE +201 -0
- chia_blockchain-2.5.1rc1.dist-info/METADATA +156 -0
- chia_blockchain-2.5.1rc1.dist-info/RECORD +1042 -0
- chia_blockchain-2.5.1rc1.dist-info/WHEEL +4 -0
- chia_blockchain-2.5.1rc1.dist-info/entry_points.txt +17 -0
- mozilla-ca/cacert.pem +3611 -0
chia/cmds/wallet.py
ADDED
|
@@ -0,0 +1,1901 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import asyncio
|
|
4
|
+
import pathlib
|
|
5
|
+
from collections.abc import Sequence
|
|
6
|
+
from typing import Optional
|
|
7
|
+
|
|
8
|
+
import click
|
|
9
|
+
|
|
10
|
+
from chia.cmds import options
|
|
11
|
+
from chia.cmds.check_wallet_db import help_text as check_help_text
|
|
12
|
+
from chia.cmds.cmd_classes import ChiaCliContext, get_chia_command_metadata
|
|
13
|
+
from chia.cmds.cmds_util import timelock_args, tx_out_cmd
|
|
14
|
+
from chia.cmds.coins import coins_cmd
|
|
15
|
+
from chia.cmds.param_types import (
|
|
16
|
+
AddressParamType,
|
|
17
|
+
AmountParamType,
|
|
18
|
+
Bytes32ParamType,
|
|
19
|
+
CliAddress,
|
|
20
|
+
CliAmount,
|
|
21
|
+
cli_amount_none,
|
|
22
|
+
)
|
|
23
|
+
from chia.cmds.signer import PushTransactionsCMD, signer_cmd
|
|
24
|
+
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
25
|
+
from chia.util.ints import uint32, uint64
|
|
26
|
+
from chia.wallet.conditions import ConditionValidTimes
|
|
27
|
+
from chia.wallet.transaction_record import TransactionRecord
|
|
28
|
+
from chia.wallet.transaction_sorting import SortKey
|
|
29
|
+
from chia.wallet.util.address_type import AddressType
|
|
30
|
+
from chia.wallet.util.wallet_types import WalletType
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@click.group("wallet", help="Manage your wallet")
|
|
34
|
+
@click.pass_context
|
|
35
|
+
def wallet_cmd(ctx: click.Context) -> None:
|
|
36
|
+
pass
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
wallet_cmd.add_command(signer_cmd)
|
|
40
|
+
wallet_cmd.add_command(get_chia_command_metadata(PushTransactionsCMD).command)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@wallet_cmd.command("get_transaction", help="Get a transaction")
|
|
44
|
+
@click.option(
|
|
45
|
+
"-wp",
|
|
46
|
+
"--wallet-rpc-port",
|
|
47
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
48
|
+
type=int,
|
|
49
|
+
default=None,
|
|
50
|
+
)
|
|
51
|
+
@options.create_fingerprint()
|
|
52
|
+
# TODO: Remove unused wallet id option
|
|
53
|
+
@click.option("-i", "--id", help="Id of the wallet to use", type=int, default=1, show_default=True, required=True)
|
|
54
|
+
@click.option("-tx", "--tx_id", help="transaction id to search for", type=str, required=True)
|
|
55
|
+
@click.option("--verbose", "-v", count=True, type=int)
|
|
56
|
+
@click.pass_context
|
|
57
|
+
def get_transaction_cmd(
|
|
58
|
+
ctx: click.Context, wallet_rpc_port: Optional[int], fingerprint: int, id: int, tx_id: str, verbose: int
|
|
59
|
+
) -> None:
|
|
60
|
+
from chia.cmds.wallet_funcs import get_transaction
|
|
61
|
+
|
|
62
|
+
asyncio.run(
|
|
63
|
+
get_transaction(
|
|
64
|
+
root_path=ChiaCliContext.set_default(ctx).root_path,
|
|
65
|
+
wallet_rpc_port=wallet_rpc_port,
|
|
66
|
+
fingerprint=fingerprint,
|
|
67
|
+
tx_id=tx_id,
|
|
68
|
+
verbose=verbose,
|
|
69
|
+
)
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@wallet_cmd.command("get_transactions", help="Get all transactions")
|
|
74
|
+
@click.option(
|
|
75
|
+
"-wp",
|
|
76
|
+
"--wallet-rpc-port",
|
|
77
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
78
|
+
type=int,
|
|
79
|
+
default=None,
|
|
80
|
+
)
|
|
81
|
+
@options.create_fingerprint()
|
|
82
|
+
@click.option("-i", "--id", help="Id of the wallet to use", type=int, default=1, show_default=True, required=True)
|
|
83
|
+
@click.option(
|
|
84
|
+
"-o",
|
|
85
|
+
"--offset",
|
|
86
|
+
help="Skip transactions from the beginning of the list",
|
|
87
|
+
type=int,
|
|
88
|
+
default=0,
|
|
89
|
+
show_default=True,
|
|
90
|
+
required=True,
|
|
91
|
+
)
|
|
92
|
+
@click.option(
|
|
93
|
+
"-l",
|
|
94
|
+
"--limit",
|
|
95
|
+
help="Max number of transactions to return",
|
|
96
|
+
type=int,
|
|
97
|
+
default=(2**32 - 1),
|
|
98
|
+
show_default=True,
|
|
99
|
+
required=False,
|
|
100
|
+
)
|
|
101
|
+
@click.option("--verbose", "-v", count=True, type=int)
|
|
102
|
+
@click.option(
|
|
103
|
+
"--paginate/--no-paginate",
|
|
104
|
+
default=None,
|
|
105
|
+
help="Prompt for each page of data. Defaults to true for interactive consoles, otherwise false.",
|
|
106
|
+
)
|
|
107
|
+
@click.option(
|
|
108
|
+
"--sort-by-height",
|
|
109
|
+
"sort_key",
|
|
110
|
+
flag_value=SortKey.CONFIRMED_AT_HEIGHT,
|
|
111
|
+
type=SortKey,
|
|
112
|
+
help="Sort transactions by height",
|
|
113
|
+
)
|
|
114
|
+
@click.option(
|
|
115
|
+
"--sort-by-relevance",
|
|
116
|
+
"sort_key",
|
|
117
|
+
flag_value=SortKey.RELEVANCE,
|
|
118
|
+
type=SortKey,
|
|
119
|
+
default=True,
|
|
120
|
+
help="Sort transactions by {confirmed, height, time}",
|
|
121
|
+
)
|
|
122
|
+
@click.option(
|
|
123
|
+
"--reverse",
|
|
124
|
+
is_flag=True,
|
|
125
|
+
default=False,
|
|
126
|
+
help="Reverse the transaction ordering",
|
|
127
|
+
)
|
|
128
|
+
@click.option(
|
|
129
|
+
"--clawback",
|
|
130
|
+
is_flag=True,
|
|
131
|
+
default=False,
|
|
132
|
+
help="Only show clawback transactions",
|
|
133
|
+
)
|
|
134
|
+
@click.pass_context
|
|
135
|
+
def get_transactions_cmd(
|
|
136
|
+
ctx: click.Context,
|
|
137
|
+
wallet_rpc_port: Optional[int],
|
|
138
|
+
fingerprint: int,
|
|
139
|
+
id: int,
|
|
140
|
+
offset: int,
|
|
141
|
+
limit: int,
|
|
142
|
+
verbose: bool,
|
|
143
|
+
paginate: Optional[bool],
|
|
144
|
+
sort_key: SortKey,
|
|
145
|
+
reverse: bool,
|
|
146
|
+
clawback: bool,
|
|
147
|
+
) -> None: # pragma: no cover
|
|
148
|
+
from chia.cmds.wallet_funcs import get_transactions
|
|
149
|
+
|
|
150
|
+
asyncio.run(
|
|
151
|
+
get_transactions(
|
|
152
|
+
root_path=ChiaCliContext.set_default(ctx).root_path,
|
|
153
|
+
wallet_rpc_port=wallet_rpc_port,
|
|
154
|
+
fp=fingerprint,
|
|
155
|
+
wallet_id=id,
|
|
156
|
+
verbose=verbose,
|
|
157
|
+
paginate=paginate,
|
|
158
|
+
offset=offset,
|
|
159
|
+
limit=limit,
|
|
160
|
+
sort_key=sort_key,
|
|
161
|
+
reverse=reverse,
|
|
162
|
+
clawback=clawback,
|
|
163
|
+
)
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
@wallet_cmd.command("send", help="Send chia or other assets to another wallet")
|
|
168
|
+
@click.option(
|
|
169
|
+
"-wp",
|
|
170
|
+
"--wallet-rpc-port",
|
|
171
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
172
|
+
type=int,
|
|
173
|
+
default=None,
|
|
174
|
+
)
|
|
175
|
+
@options.create_fingerprint()
|
|
176
|
+
@click.option("-i", "--id", help="Id of the wallet to use", type=int, default=1, show_default=True, required=True)
|
|
177
|
+
@click.option(
|
|
178
|
+
"-a", "--amount", help="How much chia to send, in XCH or CAT units", type=AmountParamType(), required=True
|
|
179
|
+
)
|
|
180
|
+
@click.option("-e", "--memo", help="Additional memo for the transaction", type=str, default=None)
|
|
181
|
+
@options.create_fee()
|
|
182
|
+
# TODO: Fix RPC as this should take a puzzle_hash not an address.
|
|
183
|
+
@click.option("-t", "--address", help="Address to send the XCH", type=AddressParamType(), required=True)
|
|
184
|
+
@click.option(
|
|
185
|
+
"-o", "--override", help="Submits transaction without checking for unusual values", is_flag=True, default=False
|
|
186
|
+
)
|
|
187
|
+
@click.option(
|
|
188
|
+
"-ma",
|
|
189
|
+
"--min-coin-amount",
|
|
190
|
+
help="Ignore coins worth less then this much XCH or CAT units",
|
|
191
|
+
type=AmountParamType(),
|
|
192
|
+
required=False,
|
|
193
|
+
default=cli_amount_none,
|
|
194
|
+
)
|
|
195
|
+
@click.option(
|
|
196
|
+
"-l",
|
|
197
|
+
"--max-coin-amount",
|
|
198
|
+
help="Ignore coins worth more then this much XCH or CAT units",
|
|
199
|
+
type=AmountParamType(),
|
|
200
|
+
required=False,
|
|
201
|
+
default=cli_amount_none,
|
|
202
|
+
)
|
|
203
|
+
@click.option(
|
|
204
|
+
"--exclude-coin",
|
|
205
|
+
"coins_to_exclude",
|
|
206
|
+
multiple=True,
|
|
207
|
+
type=Bytes32ParamType(),
|
|
208
|
+
help="Exclude this coin from being spent.",
|
|
209
|
+
)
|
|
210
|
+
@click.option(
|
|
211
|
+
"--reuse",
|
|
212
|
+
help="Reuse existing address for the change.",
|
|
213
|
+
is_flag=True,
|
|
214
|
+
default=False,
|
|
215
|
+
)
|
|
216
|
+
@click.option(
|
|
217
|
+
"--clawback_time",
|
|
218
|
+
help="The seconds that the recipient needs to wait to claim the fund."
|
|
219
|
+
" A positive number will enable the Clawback features.",
|
|
220
|
+
type=int,
|
|
221
|
+
default=0,
|
|
222
|
+
)
|
|
223
|
+
@tx_out_cmd()
|
|
224
|
+
@click.pass_context
|
|
225
|
+
def send_cmd(
|
|
226
|
+
ctx: click.Context,
|
|
227
|
+
wallet_rpc_port: Optional[int],
|
|
228
|
+
fingerprint: int,
|
|
229
|
+
id: int,
|
|
230
|
+
amount: CliAmount,
|
|
231
|
+
memo: Optional[str],
|
|
232
|
+
fee: uint64,
|
|
233
|
+
address: CliAddress,
|
|
234
|
+
override: bool,
|
|
235
|
+
min_coin_amount: CliAmount,
|
|
236
|
+
max_coin_amount: CliAmount,
|
|
237
|
+
coins_to_exclude: Sequence[bytes32],
|
|
238
|
+
reuse: bool,
|
|
239
|
+
clawback_time: int,
|
|
240
|
+
push: bool,
|
|
241
|
+
condition_valid_times: ConditionValidTimes,
|
|
242
|
+
) -> list[TransactionRecord]:
|
|
243
|
+
from chia.cmds.wallet_funcs import send
|
|
244
|
+
|
|
245
|
+
return asyncio.run(
|
|
246
|
+
send(
|
|
247
|
+
root_path=ChiaCliContext.set_default(ctx).root_path,
|
|
248
|
+
wallet_rpc_port=wallet_rpc_port,
|
|
249
|
+
fp=fingerprint,
|
|
250
|
+
wallet_id=id,
|
|
251
|
+
amount=amount,
|
|
252
|
+
memo=memo,
|
|
253
|
+
fee=fee,
|
|
254
|
+
address=address,
|
|
255
|
+
override=override,
|
|
256
|
+
min_coin_amount=min_coin_amount,
|
|
257
|
+
max_coin_amount=max_coin_amount,
|
|
258
|
+
excluded_coin_ids=coins_to_exclude,
|
|
259
|
+
reuse_puzhash=True if reuse else None,
|
|
260
|
+
clawback_time_lock=clawback_time,
|
|
261
|
+
push=push,
|
|
262
|
+
condition_valid_times=condition_valid_times,
|
|
263
|
+
)
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
@wallet_cmd.command("show", help="Show wallet information")
|
|
268
|
+
@click.option(
|
|
269
|
+
"-wp",
|
|
270
|
+
"--wallet-rpc-port",
|
|
271
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
272
|
+
type=int,
|
|
273
|
+
default=None,
|
|
274
|
+
)
|
|
275
|
+
@options.create_fingerprint()
|
|
276
|
+
@click.option(
|
|
277
|
+
"-w",
|
|
278
|
+
"--wallet_type",
|
|
279
|
+
help="Choose a specific wallet type to return",
|
|
280
|
+
type=click.Choice([x.name.lower() for x in WalletType]),
|
|
281
|
+
default=None,
|
|
282
|
+
)
|
|
283
|
+
@click.pass_context
|
|
284
|
+
def show_cmd(ctx: click.Context, wallet_rpc_port: Optional[int], fingerprint: int, wallet_type: Optional[str]) -> None:
|
|
285
|
+
from chia.cmds.wallet_funcs import print_balances
|
|
286
|
+
|
|
287
|
+
asyncio.run(
|
|
288
|
+
print_balances(
|
|
289
|
+
ChiaCliContext.set_default(ctx).root_path,
|
|
290
|
+
wallet_rpc_port,
|
|
291
|
+
fingerprint,
|
|
292
|
+
WalletType[wallet_type.upper()] if wallet_type else None,
|
|
293
|
+
)
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
@wallet_cmd.command("get_address", help="Get a wallet receive address")
|
|
298
|
+
@click.option(
|
|
299
|
+
"-wp",
|
|
300
|
+
"--wallet-rpc-port",
|
|
301
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
302
|
+
type=int,
|
|
303
|
+
default=None,
|
|
304
|
+
)
|
|
305
|
+
@click.option("-i", "--id", help="Id of the wallet to use", type=int, default=1, show_default=True, required=True)
|
|
306
|
+
@options.create_fingerprint()
|
|
307
|
+
@click.option(
|
|
308
|
+
"-n/-l",
|
|
309
|
+
"--new-address/--latest-address",
|
|
310
|
+
help=(
|
|
311
|
+
"Create a new wallet receive address, or show the most recently created wallet receive address"
|
|
312
|
+
" [default: show most recent address]"
|
|
313
|
+
),
|
|
314
|
+
is_flag=True,
|
|
315
|
+
default=False,
|
|
316
|
+
)
|
|
317
|
+
@click.pass_context
|
|
318
|
+
def get_address_cmd(
|
|
319
|
+
ctx: click.Context, wallet_rpc_port: Optional[int], id: int, fingerprint: int, new_address: bool
|
|
320
|
+
) -> None:
|
|
321
|
+
from chia.cmds.wallet_funcs import get_address
|
|
322
|
+
|
|
323
|
+
asyncio.run(get_address(ChiaCliContext.set_default(ctx).root_path, wallet_rpc_port, fingerprint, id, new_address))
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
@wallet_cmd.command(
|
|
327
|
+
"clawback",
|
|
328
|
+
help="Claim or revert a Clawback transaction."
|
|
329
|
+
" The wallet will automatically detect if you are able to revert or claim.",
|
|
330
|
+
)
|
|
331
|
+
@click.option(
|
|
332
|
+
"-wp",
|
|
333
|
+
"--wallet-rpc-port",
|
|
334
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
335
|
+
type=int,
|
|
336
|
+
default=None,
|
|
337
|
+
)
|
|
338
|
+
# TODO: Remove unused wallet id option
|
|
339
|
+
@click.option("-i", "--id", help="Id of the wallet to use", type=int, default=1, show_default=True, required=True)
|
|
340
|
+
@options.create_fingerprint()
|
|
341
|
+
@click.option(
|
|
342
|
+
"-ids",
|
|
343
|
+
"--tx_ids",
|
|
344
|
+
help="IDs of the Clawback transactions you want to revert or claim. Separate multiple IDs by comma (,).",
|
|
345
|
+
type=str,
|
|
346
|
+
default="",
|
|
347
|
+
required=True,
|
|
348
|
+
)
|
|
349
|
+
@options.create_fee("A fee to add to the offer when it gets taken, in XCH")
|
|
350
|
+
@click.option(
|
|
351
|
+
"--force",
|
|
352
|
+
help="Force to push the spend bundle even it may be a double spend",
|
|
353
|
+
is_flag=True,
|
|
354
|
+
default=False,
|
|
355
|
+
)
|
|
356
|
+
@tx_out_cmd()
|
|
357
|
+
@click.pass_context
|
|
358
|
+
def clawback(
|
|
359
|
+
ctx: click.Context,
|
|
360
|
+
wallet_rpc_port: Optional[int],
|
|
361
|
+
id: int,
|
|
362
|
+
fingerprint: int,
|
|
363
|
+
tx_ids: str,
|
|
364
|
+
fee: uint64,
|
|
365
|
+
force: bool,
|
|
366
|
+
push: bool,
|
|
367
|
+
condition_valid_times: ConditionValidTimes,
|
|
368
|
+
) -> list[TransactionRecord]:
|
|
369
|
+
from chia.cmds.wallet_funcs import spend_clawback
|
|
370
|
+
|
|
371
|
+
return asyncio.run(
|
|
372
|
+
spend_clawback(
|
|
373
|
+
root_path=ChiaCliContext.set_default(ctx).root_path,
|
|
374
|
+
wallet_rpc_port=wallet_rpc_port,
|
|
375
|
+
fp=fingerprint,
|
|
376
|
+
fee=fee,
|
|
377
|
+
tx_ids_str=tx_ids,
|
|
378
|
+
force=force,
|
|
379
|
+
push=push,
|
|
380
|
+
condition_valid_times=condition_valid_times,
|
|
381
|
+
)
|
|
382
|
+
)
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
@wallet_cmd.command("delete_unconfirmed_transactions", help="Deletes all unconfirmed transactions for this wallet ID")
|
|
386
|
+
@click.option(
|
|
387
|
+
"-wp",
|
|
388
|
+
"--wallet-rpc-port",
|
|
389
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
390
|
+
type=int,
|
|
391
|
+
default=None,
|
|
392
|
+
)
|
|
393
|
+
@click.option("-i", "--id", help="Id of the wallet to use", type=int, default=1, show_default=True, required=True)
|
|
394
|
+
@options.create_fingerprint()
|
|
395
|
+
@click.pass_context
|
|
396
|
+
def delete_unconfirmed_transactions_cmd(
|
|
397
|
+
ctx: click.Context, wallet_rpc_port: Optional[int], id: int, fingerprint: int
|
|
398
|
+
) -> None:
|
|
399
|
+
from chia.cmds.wallet_funcs import delete_unconfirmed_transactions
|
|
400
|
+
|
|
401
|
+
asyncio.run(
|
|
402
|
+
delete_unconfirmed_transactions(ChiaCliContext.set_default(ctx).root_path, wallet_rpc_port, fingerprint, id)
|
|
403
|
+
)
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
@wallet_cmd.command("get_derivation_index", help="Get the last puzzle hash derivation path index")
|
|
407
|
+
@click.option(
|
|
408
|
+
"-wp",
|
|
409
|
+
"--wallet-rpc-port",
|
|
410
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
411
|
+
type=int,
|
|
412
|
+
default=None,
|
|
413
|
+
)
|
|
414
|
+
@options.create_fingerprint()
|
|
415
|
+
@click.pass_context
|
|
416
|
+
def get_derivation_index_cmd(ctx: click.Context, wallet_rpc_port: Optional[int], fingerprint: int) -> None:
|
|
417
|
+
from chia.cmds.wallet_funcs import get_derivation_index
|
|
418
|
+
|
|
419
|
+
asyncio.run(get_derivation_index(ChiaCliContext.set_default(ctx).root_path, wallet_rpc_port, fingerprint))
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
@wallet_cmd.command("sign_message", help="Sign a message by a derivation address")
|
|
423
|
+
@click.option(
|
|
424
|
+
"-wp",
|
|
425
|
+
"--wallet-rpc-port",
|
|
426
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
427
|
+
type=int,
|
|
428
|
+
default=None,
|
|
429
|
+
)
|
|
430
|
+
@options.create_fingerprint()
|
|
431
|
+
# TODO: Change RPC's to use the puzzle hash instead of address
|
|
432
|
+
@click.option("-a", "--address", help="The address you want to use for signing", type=AddressParamType(), required=True)
|
|
433
|
+
@click.option("-m", "--hex_message", help="The hex message you want sign", type=str, required=True)
|
|
434
|
+
@click.pass_context
|
|
435
|
+
def address_sign_message(
|
|
436
|
+
ctx: click.Context, wallet_rpc_port: Optional[int], fingerprint: int, address: CliAddress, hex_message: str
|
|
437
|
+
) -> None:
|
|
438
|
+
from chia.cmds.wallet_funcs import sign_message
|
|
439
|
+
|
|
440
|
+
asyncio.run(
|
|
441
|
+
sign_message(
|
|
442
|
+
root_path=ChiaCliContext.set_default(ctx).root_path,
|
|
443
|
+
wallet_rpc_port=wallet_rpc_port,
|
|
444
|
+
fp=fingerprint,
|
|
445
|
+
addr_type=AddressType.XCH,
|
|
446
|
+
message=hex_message,
|
|
447
|
+
address=address,
|
|
448
|
+
)
|
|
449
|
+
)
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
@wallet_cmd.command(
|
|
453
|
+
"update_derivation_index", help="Generate additional derived puzzle hashes starting at the provided index"
|
|
454
|
+
)
|
|
455
|
+
@click.option(
|
|
456
|
+
"-wp",
|
|
457
|
+
"--wallet-rpc-port",
|
|
458
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
459
|
+
type=int,
|
|
460
|
+
default=None,
|
|
461
|
+
)
|
|
462
|
+
@options.create_fingerprint()
|
|
463
|
+
@click.option(
|
|
464
|
+
"-i", "--index", help="Index to set. Must be greater than the current derivation index", type=int, required=True
|
|
465
|
+
)
|
|
466
|
+
@click.pass_context
|
|
467
|
+
def update_derivation_index_cmd(
|
|
468
|
+
ctx: click.Context, wallet_rpc_port: Optional[int], fingerprint: int, index: int
|
|
469
|
+
) -> None:
|
|
470
|
+
from chia.cmds.wallet_funcs import update_derivation_index
|
|
471
|
+
|
|
472
|
+
asyncio.run(update_derivation_index(ChiaCliContext.set_default(ctx).root_path, wallet_rpc_port, fingerprint, index))
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
@wallet_cmd.command("add_token", help="Add/Rename a CAT to the wallet by its asset ID")
|
|
476
|
+
@click.option(
|
|
477
|
+
"-wp",
|
|
478
|
+
"--wallet-rpc-port",
|
|
479
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
480
|
+
type=int,
|
|
481
|
+
default=None,
|
|
482
|
+
)
|
|
483
|
+
@click.option(
|
|
484
|
+
"-id",
|
|
485
|
+
"--asset-id",
|
|
486
|
+
help="The Asset ID of the coin you wish to add/rename (the treehash of the TAIL program)",
|
|
487
|
+
type=Bytes32ParamType(),
|
|
488
|
+
required=True,
|
|
489
|
+
)
|
|
490
|
+
@click.option(
|
|
491
|
+
"-n",
|
|
492
|
+
"--token-name",
|
|
493
|
+
help="The name you wish to designate to the token",
|
|
494
|
+
)
|
|
495
|
+
@options.create_fingerprint()
|
|
496
|
+
@click.pass_context
|
|
497
|
+
def add_token_cmd(
|
|
498
|
+
ctx: click.Context, wallet_rpc_port: Optional[int], asset_id: bytes32, token_name: str, fingerprint: int
|
|
499
|
+
) -> None:
|
|
500
|
+
from chia.cmds.wallet_funcs import add_token
|
|
501
|
+
|
|
502
|
+
asyncio.run(
|
|
503
|
+
add_token(ChiaCliContext.set_default(ctx).root_path, wallet_rpc_port, fingerprint, asset_id, token_name)
|
|
504
|
+
)
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
@wallet_cmd.command("make_offer", help="Create an offer of XCH/CATs/NFTs for XCH/CATs/NFTs")
|
|
508
|
+
@click.option(
|
|
509
|
+
"-wp",
|
|
510
|
+
"--wallet-rpc-port",
|
|
511
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
512
|
+
type=int,
|
|
513
|
+
default=None,
|
|
514
|
+
)
|
|
515
|
+
@options.create_fingerprint()
|
|
516
|
+
@click.option(
|
|
517
|
+
"-o",
|
|
518
|
+
"--offer",
|
|
519
|
+
help="A wallet id to offer and the amount to offer (formatted like wallet_id:amount)",
|
|
520
|
+
required=True,
|
|
521
|
+
multiple=True,
|
|
522
|
+
)
|
|
523
|
+
@click.option(
|
|
524
|
+
"-r",
|
|
525
|
+
"--request",
|
|
526
|
+
help="A wallet id of an asset to receive and the amount you wish to receive (formatted like wallet_id:amount)",
|
|
527
|
+
multiple=True,
|
|
528
|
+
)
|
|
529
|
+
@click.option(
|
|
530
|
+
"-p",
|
|
531
|
+
"--filepath",
|
|
532
|
+
help="The path to write the generated offer file to",
|
|
533
|
+
required=True,
|
|
534
|
+
type=click.Path(dir_okay=False, writable=True, path_type=pathlib.Path),
|
|
535
|
+
)
|
|
536
|
+
@options.create_fee("A fee to add to the offer when it gets taken, in XCH")
|
|
537
|
+
@click.option(
|
|
538
|
+
"--reuse",
|
|
539
|
+
help="Reuse existing address for the offer.",
|
|
540
|
+
is_flag=True,
|
|
541
|
+
default=False,
|
|
542
|
+
)
|
|
543
|
+
@click.option("--override", help="Creates offer without checking for unusual values", is_flag=True, default=False)
|
|
544
|
+
@timelock_args(enable=True)
|
|
545
|
+
@click.pass_context
|
|
546
|
+
# This command looks like a good candidate for @tx_out_cmd however, pushing an incomplete tx is nonsensical and
|
|
547
|
+
# we already have a canonical offer file format which the idea of exporting a different transaction conflicts with
|
|
548
|
+
def make_offer_cmd(
|
|
549
|
+
ctx: click.Context,
|
|
550
|
+
wallet_rpc_port: Optional[int],
|
|
551
|
+
fingerprint: int,
|
|
552
|
+
offer: Sequence[str],
|
|
553
|
+
request: Sequence[str],
|
|
554
|
+
filepath: pathlib.Path,
|
|
555
|
+
fee: uint64,
|
|
556
|
+
reuse: bool,
|
|
557
|
+
override: bool,
|
|
558
|
+
condition_valid_times: ConditionValidTimes,
|
|
559
|
+
) -> None:
|
|
560
|
+
from chia.cmds.wallet_funcs import make_offer
|
|
561
|
+
|
|
562
|
+
if len(request) == 0 and not override:
|
|
563
|
+
print("Cannot make an offer without requesting something without --override")
|
|
564
|
+
return
|
|
565
|
+
|
|
566
|
+
asyncio.run(
|
|
567
|
+
make_offer(
|
|
568
|
+
root_path=ChiaCliContext.set_default(ctx).root_path,
|
|
569
|
+
wallet_rpc_port=wallet_rpc_port,
|
|
570
|
+
fp=fingerprint,
|
|
571
|
+
fee=fee,
|
|
572
|
+
offers=offer,
|
|
573
|
+
requests=request,
|
|
574
|
+
filepath=filepath,
|
|
575
|
+
reuse_puzhash=True if reuse else None,
|
|
576
|
+
condition_valid_times=condition_valid_times,
|
|
577
|
+
)
|
|
578
|
+
)
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
@wallet_cmd.command(
|
|
582
|
+
"get_offers", help="Get the status of existing offers. Displays only active/pending offers by default."
|
|
583
|
+
)
|
|
584
|
+
@click.option(
|
|
585
|
+
"-wp",
|
|
586
|
+
"--wallet-rpc-port",
|
|
587
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
588
|
+
type=int,
|
|
589
|
+
default=None,
|
|
590
|
+
)
|
|
591
|
+
@options.create_fingerprint()
|
|
592
|
+
@click.option("-id", "--id", help="The ID of the offer that you wish to examine", type=Bytes32ParamType())
|
|
593
|
+
@click.option("-p", "--filepath", help="The path to rewrite the offer file to (must be used in conjunction with --id)")
|
|
594
|
+
@click.option("-em", "--exclude-my-offers", help="Exclude your own offers from the output", is_flag=True)
|
|
595
|
+
@click.option("-et", "--exclude-taken-offers", help="Exclude offers that you've accepted from the output", is_flag=True)
|
|
596
|
+
@click.option(
|
|
597
|
+
"-ic", "--include-completed", help="Include offers that have been confirmed/cancelled or failed", is_flag=True
|
|
598
|
+
)
|
|
599
|
+
@click.option("-s", "--summaries", help="Show the assets being offered and requested for each offer", is_flag=True)
|
|
600
|
+
@click.option("--sort-by-relevance/--sort-by-confirmed-height", help="Sort the offers one of two ways", is_flag=True)
|
|
601
|
+
@click.option("-r", "--reverse", help="Reverse the order of the output", is_flag=True)
|
|
602
|
+
@click.pass_context
|
|
603
|
+
def get_offers_cmd(
|
|
604
|
+
ctx: click.Context,
|
|
605
|
+
wallet_rpc_port: Optional[int],
|
|
606
|
+
fingerprint: int,
|
|
607
|
+
id: Optional[bytes32],
|
|
608
|
+
filepath: Optional[str],
|
|
609
|
+
exclude_my_offers: bool,
|
|
610
|
+
exclude_taken_offers: bool,
|
|
611
|
+
include_completed: bool,
|
|
612
|
+
summaries: bool,
|
|
613
|
+
reverse: bool,
|
|
614
|
+
sort_by_relevance: bool,
|
|
615
|
+
) -> None:
|
|
616
|
+
from chia.cmds.wallet_funcs import get_offers
|
|
617
|
+
|
|
618
|
+
asyncio.run(
|
|
619
|
+
get_offers(
|
|
620
|
+
root_path=ChiaCliContext.set_default(ctx).root_path,
|
|
621
|
+
wallet_rpc_port=wallet_rpc_port,
|
|
622
|
+
fp=fingerprint,
|
|
623
|
+
offer_id=id,
|
|
624
|
+
filepath=filepath,
|
|
625
|
+
exclude_my_offers=exclude_my_offers,
|
|
626
|
+
exclude_taken_offers=exclude_taken_offers,
|
|
627
|
+
include_completed=include_completed,
|
|
628
|
+
summaries=summaries,
|
|
629
|
+
reverse=reverse,
|
|
630
|
+
sort_by_relevance=sort_by_relevance,
|
|
631
|
+
)
|
|
632
|
+
)
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
@wallet_cmd.command("take_offer", help="Examine or take an offer")
|
|
636
|
+
@click.argument("path_or_hex", type=str, nargs=1, required=True)
|
|
637
|
+
@click.option(
|
|
638
|
+
"-wp",
|
|
639
|
+
"--wallet-rpc-port",
|
|
640
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
641
|
+
type=int,
|
|
642
|
+
default=None,
|
|
643
|
+
)
|
|
644
|
+
@options.create_fingerprint()
|
|
645
|
+
@click.option("-e", "--examine-only", help="Print the summary of the offer file but do not take it", is_flag=True)
|
|
646
|
+
@options.create_fee("The fee to use when pushing the completed offer, in XCH")
|
|
647
|
+
# TODO: Reuse is not used
|
|
648
|
+
@click.option(
|
|
649
|
+
"--reuse",
|
|
650
|
+
help="Reuse existing address for the offer.",
|
|
651
|
+
is_flag=True,
|
|
652
|
+
default=False,
|
|
653
|
+
)
|
|
654
|
+
@tx_out_cmd()
|
|
655
|
+
@click.pass_context
|
|
656
|
+
def take_offer_cmd(
|
|
657
|
+
ctx: click.Context,
|
|
658
|
+
path_or_hex: str,
|
|
659
|
+
wallet_rpc_port: Optional[int],
|
|
660
|
+
fingerprint: int,
|
|
661
|
+
examine_only: bool,
|
|
662
|
+
fee: uint64,
|
|
663
|
+
reuse: bool,
|
|
664
|
+
push: bool,
|
|
665
|
+
condition_valid_times: ConditionValidTimes,
|
|
666
|
+
) -> list[TransactionRecord]:
|
|
667
|
+
from chia.cmds.wallet_funcs import take_offer
|
|
668
|
+
|
|
669
|
+
return asyncio.run(
|
|
670
|
+
take_offer(
|
|
671
|
+
ChiaCliContext.set_default(ctx).root_path,
|
|
672
|
+
wallet_rpc_port,
|
|
673
|
+
fingerprint,
|
|
674
|
+
fee,
|
|
675
|
+
path_or_hex,
|
|
676
|
+
examine_only,
|
|
677
|
+
push,
|
|
678
|
+
condition_valid_times=condition_valid_times,
|
|
679
|
+
)
|
|
680
|
+
)
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
@wallet_cmd.command("cancel_offer", help="Cancel an existing offer")
|
|
684
|
+
@click.option(
|
|
685
|
+
"-wp",
|
|
686
|
+
"--wallet-rpc-port",
|
|
687
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
688
|
+
type=int,
|
|
689
|
+
default=None,
|
|
690
|
+
)
|
|
691
|
+
@options.create_fingerprint()
|
|
692
|
+
@click.option("-id", "--id", help="The offer ID that you wish to cancel", required=True, type=Bytes32ParamType())
|
|
693
|
+
@click.option("--insecure", help="Don't make an on-chain transaction, simply mark the offer as cancelled", is_flag=True)
|
|
694
|
+
@options.create_fee("The fee to use when cancelling the offer securely, in XCH")
|
|
695
|
+
@tx_out_cmd()
|
|
696
|
+
@click.pass_context
|
|
697
|
+
def cancel_offer_cmd(
|
|
698
|
+
ctx: click.Context,
|
|
699
|
+
wallet_rpc_port: Optional[int],
|
|
700
|
+
fingerprint: int,
|
|
701
|
+
id: bytes32,
|
|
702
|
+
insecure: bool,
|
|
703
|
+
fee: uint64,
|
|
704
|
+
push: bool,
|
|
705
|
+
condition_valid_times: ConditionValidTimes,
|
|
706
|
+
) -> list[TransactionRecord]:
|
|
707
|
+
from chia.cmds.wallet_funcs import cancel_offer
|
|
708
|
+
|
|
709
|
+
return asyncio.run(
|
|
710
|
+
cancel_offer(
|
|
711
|
+
ChiaCliContext.set_default(ctx).root_path,
|
|
712
|
+
wallet_rpc_port,
|
|
713
|
+
fingerprint,
|
|
714
|
+
fee,
|
|
715
|
+
id,
|
|
716
|
+
not insecure,
|
|
717
|
+
push,
|
|
718
|
+
condition_valid_times=condition_valid_times,
|
|
719
|
+
)
|
|
720
|
+
)
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
@wallet_cmd.command("check", short_help="Check wallet DB integrity", help=check_help_text)
|
|
724
|
+
@click.option("-v", "--verbose", help="Print more information", is_flag=True)
|
|
725
|
+
@click.option("--db-path", help="The path to a wallet DB. Default is to scan all active wallet DBs.")
|
|
726
|
+
@click.pass_context
|
|
727
|
+
# TODO: accept multiple dbs on commandline
|
|
728
|
+
# TODO: Convert to Path earlier
|
|
729
|
+
def check_wallet_cmd(ctx: click.Context, db_path: str, verbose: bool) -> None:
|
|
730
|
+
"""check, scan, diagnose, fsck Chia Wallet DBs"""
|
|
731
|
+
|
|
732
|
+
from chia.cmds.check_wallet_db import scan
|
|
733
|
+
|
|
734
|
+
asyncio.run(scan(ChiaCliContext.set_default(ctx).root_path, db_path, verbose=verbose))
|
|
735
|
+
|
|
736
|
+
|
|
737
|
+
@wallet_cmd.group("did", help="DID related actions")
|
|
738
|
+
def did_cmd() -> None:
|
|
739
|
+
pass
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
@did_cmd.command("create", help="Create DID wallet")
|
|
743
|
+
@click.option(
|
|
744
|
+
"-wp",
|
|
745
|
+
"--wallet-rpc-port",
|
|
746
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
747
|
+
type=int,
|
|
748
|
+
default=None,
|
|
749
|
+
)
|
|
750
|
+
@options.create_fingerprint()
|
|
751
|
+
@click.option("-n", "--name", help="Set the DID wallet name", type=str)
|
|
752
|
+
@click.option(
|
|
753
|
+
"-a",
|
|
754
|
+
"--amount",
|
|
755
|
+
help="Set the DID amount in mojos. Value must be an odd number.",
|
|
756
|
+
type=int,
|
|
757
|
+
default=1,
|
|
758
|
+
show_default=True,
|
|
759
|
+
)
|
|
760
|
+
@options.create_fee()
|
|
761
|
+
@tx_out_cmd()
|
|
762
|
+
@click.pass_context
|
|
763
|
+
def did_create_wallet_cmd(
|
|
764
|
+
ctx: click.Context,
|
|
765
|
+
wallet_rpc_port: Optional[int],
|
|
766
|
+
fingerprint: int,
|
|
767
|
+
name: Optional[str],
|
|
768
|
+
amount: int,
|
|
769
|
+
fee: uint64,
|
|
770
|
+
push: bool,
|
|
771
|
+
condition_valid_times: ConditionValidTimes,
|
|
772
|
+
) -> list[TransactionRecord]:
|
|
773
|
+
from chia.cmds.wallet_funcs import create_did_wallet
|
|
774
|
+
|
|
775
|
+
return asyncio.run(
|
|
776
|
+
create_did_wallet(
|
|
777
|
+
ChiaCliContext.set_default(ctx).root_path,
|
|
778
|
+
wallet_rpc_port,
|
|
779
|
+
fingerprint,
|
|
780
|
+
fee,
|
|
781
|
+
name,
|
|
782
|
+
amount,
|
|
783
|
+
push,
|
|
784
|
+
condition_valid_times=condition_valid_times,
|
|
785
|
+
)
|
|
786
|
+
)
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
@did_cmd.command("sign_message", help="Sign a message by a DID")
|
|
790
|
+
@click.option(
|
|
791
|
+
"-wp",
|
|
792
|
+
"--wallet-rpc-port",
|
|
793
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
794
|
+
type=int,
|
|
795
|
+
default=None,
|
|
796
|
+
)
|
|
797
|
+
@options.create_fingerprint()
|
|
798
|
+
@click.option("-i", "--did_id", help="DID ID you want to use for signing", type=AddressParamType(), required=True)
|
|
799
|
+
@click.option("-m", "--hex_message", help="The hex message you want to sign", type=str, required=True)
|
|
800
|
+
@click.pass_context
|
|
801
|
+
def did_sign_message(
|
|
802
|
+
ctx: click.Context, wallet_rpc_port: Optional[int], fingerprint: int, did_id: CliAddress, hex_message: str
|
|
803
|
+
) -> None:
|
|
804
|
+
from chia.cmds.wallet_funcs import sign_message
|
|
805
|
+
|
|
806
|
+
asyncio.run(
|
|
807
|
+
sign_message(
|
|
808
|
+
root_path=ChiaCliContext.set_default(ctx).root_path,
|
|
809
|
+
wallet_rpc_port=wallet_rpc_port,
|
|
810
|
+
fp=fingerprint,
|
|
811
|
+
addr_type=AddressType.DID,
|
|
812
|
+
message=hex_message,
|
|
813
|
+
did_id=did_id,
|
|
814
|
+
)
|
|
815
|
+
)
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
@did_cmd.command("set_name", help="Set DID wallet name")
|
|
819
|
+
@click.option(
|
|
820
|
+
"-wp",
|
|
821
|
+
"--wallet-rpc-port",
|
|
822
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
823
|
+
type=int,
|
|
824
|
+
default=None,
|
|
825
|
+
)
|
|
826
|
+
@options.create_fingerprint()
|
|
827
|
+
@click.option("-i", "--id", help="Id of the wallet to use", type=int, required=True)
|
|
828
|
+
@click.option("-n", "--name", help="Set the DID wallet name", type=str, required=True)
|
|
829
|
+
@click.pass_context
|
|
830
|
+
def did_wallet_name_cmd(
|
|
831
|
+
ctx: click.Context, wallet_rpc_port: Optional[int], fingerprint: int, id: int, name: str
|
|
832
|
+
) -> None:
|
|
833
|
+
from chia.cmds.wallet_funcs import did_set_wallet_name
|
|
834
|
+
|
|
835
|
+
asyncio.run(did_set_wallet_name(ChiaCliContext.set_default(ctx).root_path, wallet_rpc_port, fingerprint, id, name))
|
|
836
|
+
|
|
837
|
+
|
|
838
|
+
@did_cmd.command("get_did", help="Get DID from wallet")
|
|
839
|
+
@click.option(
|
|
840
|
+
"-wp",
|
|
841
|
+
"--wallet-rpc-port",
|
|
842
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
843
|
+
type=int,
|
|
844
|
+
default=None,
|
|
845
|
+
)
|
|
846
|
+
@options.create_fingerprint()
|
|
847
|
+
@click.option("-i", "--id", help="Id of the wallet to use", type=int, required=True)
|
|
848
|
+
@click.pass_context
|
|
849
|
+
def did_get_did_cmd(ctx: click.Context, wallet_rpc_port: Optional[int], fingerprint: int, id: int) -> None:
|
|
850
|
+
from chia.cmds.wallet_funcs import get_did
|
|
851
|
+
|
|
852
|
+
asyncio.run(get_did(ChiaCliContext.set_default(ctx).root_path, wallet_rpc_port, fingerprint, id))
|
|
853
|
+
|
|
854
|
+
|
|
855
|
+
@did_cmd.command("get_details", help="Get more details of any DID")
|
|
856
|
+
@click.option(
|
|
857
|
+
"-wp",
|
|
858
|
+
"--wallet-rpc-port",
|
|
859
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
860
|
+
type=int,
|
|
861
|
+
default=None,
|
|
862
|
+
)
|
|
863
|
+
@options.create_fingerprint()
|
|
864
|
+
@click.option("-id", "--coin_id", help="Id of the DID or any coin ID of the DID", type=str, required=True)
|
|
865
|
+
@click.option("-l", "--latest", help="Return latest DID information", is_flag=True, default=True)
|
|
866
|
+
@click.pass_context
|
|
867
|
+
def did_get_details_cmd(
|
|
868
|
+
ctx: click.Context, wallet_rpc_port: Optional[int], fingerprint: int, coin_id: str, latest: bool
|
|
869
|
+
) -> None:
|
|
870
|
+
from chia.cmds.wallet_funcs import get_did_info
|
|
871
|
+
|
|
872
|
+
asyncio.run(get_did_info(ChiaCliContext.set_default(ctx).root_path, wallet_rpc_port, fingerprint, coin_id, latest))
|
|
873
|
+
|
|
874
|
+
|
|
875
|
+
@did_cmd.command("update_metadata", help="Update the metadata of a DID")
|
|
876
|
+
@click.option(
|
|
877
|
+
"-wp",
|
|
878
|
+
"--wallet-rpc-port",
|
|
879
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
880
|
+
type=int,
|
|
881
|
+
default=None,
|
|
882
|
+
)
|
|
883
|
+
@options.create_fingerprint()
|
|
884
|
+
@click.option("-i", "--id", help="Id of the DID wallet to use", type=int, required=True)
|
|
885
|
+
@click.option("-d", "--metadata", help="The new whole metadata in json format", type=str, required=True)
|
|
886
|
+
@click.option(
|
|
887
|
+
"--reuse",
|
|
888
|
+
help="Reuse existing address for the change.",
|
|
889
|
+
is_flag=True,
|
|
890
|
+
default=False,
|
|
891
|
+
)
|
|
892
|
+
@tx_out_cmd()
|
|
893
|
+
@click.pass_context
|
|
894
|
+
def did_update_metadata_cmd(
|
|
895
|
+
ctx: click.Context,
|
|
896
|
+
wallet_rpc_port: Optional[int],
|
|
897
|
+
fingerprint: int,
|
|
898
|
+
id: int,
|
|
899
|
+
metadata: str,
|
|
900
|
+
reuse: bool,
|
|
901
|
+
push: bool,
|
|
902
|
+
condition_valid_times: ConditionValidTimes,
|
|
903
|
+
) -> list[TransactionRecord]:
|
|
904
|
+
from chia.cmds.wallet_funcs import update_did_metadata
|
|
905
|
+
|
|
906
|
+
return asyncio.run(
|
|
907
|
+
update_did_metadata(
|
|
908
|
+
ChiaCliContext.set_default(ctx).root_path,
|
|
909
|
+
wallet_rpc_port,
|
|
910
|
+
fingerprint,
|
|
911
|
+
id,
|
|
912
|
+
metadata,
|
|
913
|
+
reuse,
|
|
914
|
+
push=push,
|
|
915
|
+
condition_valid_times=condition_valid_times,
|
|
916
|
+
)
|
|
917
|
+
)
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
@did_cmd.command("find_lost", help="Find the did you should own and recovery the DID wallet")
|
|
921
|
+
@click.option(
|
|
922
|
+
"-wp",
|
|
923
|
+
"--wallet-rpc-port",
|
|
924
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
925
|
+
type=int,
|
|
926
|
+
default=None,
|
|
927
|
+
)
|
|
928
|
+
@options.create_fingerprint()
|
|
929
|
+
@click.option("-id", "--coin_id", help="Id of the DID or any coin ID of the DID", type=str, required=True)
|
|
930
|
+
@click.option("-m", "--metadata", help="The new whole metadata in json format", type=str, required=False)
|
|
931
|
+
@click.option(
|
|
932
|
+
"-r",
|
|
933
|
+
"--recovery_list_hash",
|
|
934
|
+
help="Override the recovery list hash of the DID. Only set this if your last DID spend updated the recovery list",
|
|
935
|
+
type=str,
|
|
936
|
+
required=False,
|
|
937
|
+
)
|
|
938
|
+
@click.option(
|
|
939
|
+
"-n",
|
|
940
|
+
"--num_verification",
|
|
941
|
+
help="Override the required verification number of the DID."
|
|
942
|
+
" Only set this if your last DID spend updated the required verification number",
|
|
943
|
+
type=int,
|
|
944
|
+
required=False,
|
|
945
|
+
)
|
|
946
|
+
@click.pass_context
|
|
947
|
+
def did_find_lost_cmd(
|
|
948
|
+
ctx: click.Context,
|
|
949
|
+
wallet_rpc_port: Optional[int],
|
|
950
|
+
fingerprint: int,
|
|
951
|
+
coin_id: str,
|
|
952
|
+
metadata: Optional[str],
|
|
953
|
+
recovery_list_hash: Optional[str],
|
|
954
|
+
num_verification: Optional[int],
|
|
955
|
+
) -> None:
|
|
956
|
+
from chia.cmds.wallet_funcs import find_lost_did
|
|
957
|
+
|
|
958
|
+
asyncio.run(
|
|
959
|
+
find_lost_did(
|
|
960
|
+
root_path=ChiaCliContext.set_default(ctx).root_path,
|
|
961
|
+
wallet_rpc_port=wallet_rpc_port,
|
|
962
|
+
fp=fingerprint,
|
|
963
|
+
coin_id=coin_id,
|
|
964
|
+
metadata=metadata,
|
|
965
|
+
recovery_list_hash=recovery_list_hash,
|
|
966
|
+
num_verification=num_verification,
|
|
967
|
+
)
|
|
968
|
+
)
|
|
969
|
+
|
|
970
|
+
|
|
971
|
+
@did_cmd.command("message_spend", help="Generate a DID spend bundle for announcements")
|
|
972
|
+
@click.option(
|
|
973
|
+
"-wp",
|
|
974
|
+
"--wallet-rpc-port",
|
|
975
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
976
|
+
type=int,
|
|
977
|
+
default=None,
|
|
978
|
+
)
|
|
979
|
+
@options.create_fingerprint()
|
|
980
|
+
@click.option("-i", "--id", help="Id of the DID wallet to use", type=int, required=True)
|
|
981
|
+
@click.option(
|
|
982
|
+
"-pa",
|
|
983
|
+
"--puzzle_announcements",
|
|
984
|
+
help="The list of puzzle announcement hex strings, split by comma (,)",
|
|
985
|
+
type=str,
|
|
986
|
+
required=False,
|
|
987
|
+
)
|
|
988
|
+
@click.option(
|
|
989
|
+
"-ca",
|
|
990
|
+
"--coin_announcements",
|
|
991
|
+
help="The list of coin announcement hex strings, split by comma (,)",
|
|
992
|
+
type=str,
|
|
993
|
+
required=False,
|
|
994
|
+
)
|
|
995
|
+
@tx_out_cmd()
|
|
996
|
+
@click.pass_context
|
|
997
|
+
def did_message_spend_cmd(
|
|
998
|
+
ctx: click.Context,
|
|
999
|
+
wallet_rpc_port: Optional[int],
|
|
1000
|
+
fingerprint: int,
|
|
1001
|
+
id: int,
|
|
1002
|
+
puzzle_announcements: Optional[str],
|
|
1003
|
+
coin_announcements: Optional[str],
|
|
1004
|
+
push: bool,
|
|
1005
|
+
condition_valid_times: ConditionValidTimes,
|
|
1006
|
+
) -> list[TransactionRecord]:
|
|
1007
|
+
from chia.cmds.wallet_funcs import did_message_spend
|
|
1008
|
+
|
|
1009
|
+
puzzle_list: list[str] = []
|
|
1010
|
+
coin_list: list[str] = []
|
|
1011
|
+
if puzzle_announcements is not None:
|
|
1012
|
+
try:
|
|
1013
|
+
puzzle_list = puzzle_announcements.split(",")
|
|
1014
|
+
# validate puzzle announcements is list of hex strings
|
|
1015
|
+
for announcement in puzzle_list:
|
|
1016
|
+
bytes.fromhex(announcement)
|
|
1017
|
+
except ValueError:
|
|
1018
|
+
print("Invalid puzzle announcement format, should be a list of hex strings.")
|
|
1019
|
+
return []
|
|
1020
|
+
if coin_announcements is not None:
|
|
1021
|
+
try:
|
|
1022
|
+
coin_list = coin_announcements.split(",")
|
|
1023
|
+
# validate that coin announcements is a list of hex strings
|
|
1024
|
+
for announcement in coin_list:
|
|
1025
|
+
bytes.fromhex(announcement)
|
|
1026
|
+
except ValueError:
|
|
1027
|
+
print("Invalid coin announcement format, should be a list of hex strings.")
|
|
1028
|
+
return []
|
|
1029
|
+
|
|
1030
|
+
return asyncio.run(
|
|
1031
|
+
did_message_spend(
|
|
1032
|
+
ChiaCliContext.set_default(ctx).root_path,
|
|
1033
|
+
wallet_rpc_port,
|
|
1034
|
+
fingerprint,
|
|
1035
|
+
id,
|
|
1036
|
+
puzzle_list,
|
|
1037
|
+
coin_list,
|
|
1038
|
+
push=push,
|
|
1039
|
+
condition_valid_times=condition_valid_times,
|
|
1040
|
+
)
|
|
1041
|
+
)
|
|
1042
|
+
|
|
1043
|
+
|
|
1044
|
+
@did_cmd.command("transfer", help="Transfer a DID")
|
|
1045
|
+
@click.option(
|
|
1046
|
+
"-wp",
|
|
1047
|
+
"--wallet-rpc-port",
|
|
1048
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1049
|
+
type=int,
|
|
1050
|
+
default=None,
|
|
1051
|
+
)
|
|
1052
|
+
@options.create_fingerprint()
|
|
1053
|
+
@click.option("-i", "--id", help="Id of the DID wallet to use", type=int, required=True)
|
|
1054
|
+
# TODO: Change RPC to use puzzlehash instead of address
|
|
1055
|
+
@click.option("-ta", "--target-address", help="Target recipient wallet address", type=AddressParamType(), required=True)
|
|
1056
|
+
@click.option(
|
|
1057
|
+
"-rr", "--reset_recovery", help="If you want to reset the recovery DID settings.", is_flag=True, default=False
|
|
1058
|
+
)
|
|
1059
|
+
@options.create_fee()
|
|
1060
|
+
@click.option(
|
|
1061
|
+
"--reuse",
|
|
1062
|
+
help="Reuse existing address for the change.",
|
|
1063
|
+
is_flag=True,
|
|
1064
|
+
default=False,
|
|
1065
|
+
)
|
|
1066
|
+
@tx_out_cmd()
|
|
1067
|
+
@click.pass_context
|
|
1068
|
+
def did_transfer_did(
|
|
1069
|
+
ctx: click.Context,
|
|
1070
|
+
wallet_rpc_port: Optional[int],
|
|
1071
|
+
fingerprint: int,
|
|
1072
|
+
id: int,
|
|
1073
|
+
target_address: CliAddress,
|
|
1074
|
+
reset_recovery: bool,
|
|
1075
|
+
fee: uint64,
|
|
1076
|
+
reuse: bool,
|
|
1077
|
+
push: bool,
|
|
1078
|
+
condition_valid_times: ConditionValidTimes,
|
|
1079
|
+
) -> list[TransactionRecord]:
|
|
1080
|
+
from chia.cmds.wallet_funcs import transfer_did
|
|
1081
|
+
|
|
1082
|
+
return asyncio.run(
|
|
1083
|
+
transfer_did(
|
|
1084
|
+
ChiaCliContext.set_default(ctx).root_path,
|
|
1085
|
+
wallet_rpc_port,
|
|
1086
|
+
fingerprint,
|
|
1087
|
+
id,
|
|
1088
|
+
fee,
|
|
1089
|
+
target_address,
|
|
1090
|
+
reset_recovery is False,
|
|
1091
|
+
True if reuse else None,
|
|
1092
|
+
push=push,
|
|
1093
|
+
condition_valid_times=condition_valid_times,
|
|
1094
|
+
)
|
|
1095
|
+
)
|
|
1096
|
+
|
|
1097
|
+
|
|
1098
|
+
@wallet_cmd.group("nft", help="NFT related actions")
|
|
1099
|
+
def nft_cmd() -> None:
|
|
1100
|
+
pass
|
|
1101
|
+
|
|
1102
|
+
|
|
1103
|
+
@nft_cmd.command("create", help="Create an NFT wallet")
|
|
1104
|
+
@click.option(
|
|
1105
|
+
"-wp",
|
|
1106
|
+
"--wallet-rpc-port",
|
|
1107
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1108
|
+
type=int,
|
|
1109
|
+
default=None,
|
|
1110
|
+
)
|
|
1111
|
+
@options.create_fingerprint()
|
|
1112
|
+
# TODO: Change RPC to use puzzlehash instead of address
|
|
1113
|
+
@click.option("-di", "--did-id", help="DID Id to use", type=AddressParamType())
|
|
1114
|
+
@click.option("-n", "--name", help="Set the NFT wallet name", type=str)
|
|
1115
|
+
@click.pass_context
|
|
1116
|
+
def nft_wallet_create_cmd(
|
|
1117
|
+
ctx: click.Context,
|
|
1118
|
+
wallet_rpc_port: Optional[int],
|
|
1119
|
+
fingerprint: int,
|
|
1120
|
+
did_id: Optional[CliAddress],
|
|
1121
|
+
name: Optional[str],
|
|
1122
|
+
) -> None:
|
|
1123
|
+
from chia.cmds.wallet_funcs import create_nft_wallet
|
|
1124
|
+
|
|
1125
|
+
asyncio.run(
|
|
1126
|
+
create_nft_wallet(ChiaCliContext.set_default(ctx).root_path, wallet_rpc_port, fingerprint, did_id, name)
|
|
1127
|
+
)
|
|
1128
|
+
|
|
1129
|
+
|
|
1130
|
+
@nft_cmd.command("sign_message", help="Sign a message by a NFT")
|
|
1131
|
+
@click.option(
|
|
1132
|
+
"-wp",
|
|
1133
|
+
"--wallet-rpc-port",
|
|
1134
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1135
|
+
type=int,
|
|
1136
|
+
default=None,
|
|
1137
|
+
)
|
|
1138
|
+
@options.create_fingerprint()
|
|
1139
|
+
@click.option("-i", "--nft_id", help="NFT ID you want to use for signing", type=AddressParamType(), required=True)
|
|
1140
|
+
@click.option("-m", "--hex_message", help="The hex message you want to sign", type=str, required=True)
|
|
1141
|
+
@click.pass_context
|
|
1142
|
+
def nft_sign_message(
|
|
1143
|
+
ctx: click.Context, wallet_rpc_port: Optional[int], fingerprint: int, nft_id: CliAddress, hex_message: str
|
|
1144
|
+
) -> None:
|
|
1145
|
+
from chia.cmds.wallet_funcs import sign_message
|
|
1146
|
+
|
|
1147
|
+
asyncio.run(
|
|
1148
|
+
sign_message(
|
|
1149
|
+
root_path=ChiaCliContext.set_default(ctx).root_path,
|
|
1150
|
+
wallet_rpc_port=wallet_rpc_port,
|
|
1151
|
+
fp=fingerprint,
|
|
1152
|
+
addr_type=AddressType.NFT,
|
|
1153
|
+
message=hex_message,
|
|
1154
|
+
nft_id=nft_id,
|
|
1155
|
+
)
|
|
1156
|
+
)
|
|
1157
|
+
|
|
1158
|
+
|
|
1159
|
+
@nft_cmd.command("mint", help="Mint an NFT")
|
|
1160
|
+
@click.option(
|
|
1161
|
+
"-wp",
|
|
1162
|
+
"--wallet-rpc-port",
|
|
1163
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1164
|
+
type=int,
|
|
1165
|
+
default=None,
|
|
1166
|
+
)
|
|
1167
|
+
@options.create_fingerprint()
|
|
1168
|
+
@click.option("-i", "--id", help="Id of the NFT wallet to use", type=int, required=True)
|
|
1169
|
+
@click.option("-ra", "--royalty-address", help="Royalty address", type=AddressParamType())
|
|
1170
|
+
@click.option("-ta", "--target-address", help="Target address", type=AddressParamType())
|
|
1171
|
+
@click.option("--no-did-ownership", help="Disable DID ownership support", is_flag=True, default=False)
|
|
1172
|
+
@click.option("-nh", "--hash", help="NFT content hash", type=str, required=True)
|
|
1173
|
+
@click.option("-u", "--uris", help="Comma separated list of URIs", type=str, required=True)
|
|
1174
|
+
@click.option("-mh", "--metadata-hash", help="NFT metadata hash", type=str, default="")
|
|
1175
|
+
@click.option("-mu", "--metadata-uris", help="Comma separated list of metadata URIs", type=str)
|
|
1176
|
+
@click.option("-lh", "--license-hash", help="NFT license hash", type=str, default="")
|
|
1177
|
+
@click.option("-lu", "--license-uris", help="Comma separated list of license URIs", type=str)
|
|
1178
|
+
@click.option("-et", "--edition-total", help="NFT edition total", type=int, show_default=True, default=1)
|
|
1179
|
+
@click.option("-en", "--edition-number", help="NFT edition number", show_default=True, default=1, type=int)
|
|
1180
|
+
@options.create_fee()
|
|
1181
|
+
@click.option(
|
|
1182
|
+
"-rp",
|
|
1183
|
+
"--royalty-percentage-fraction",
|
|
1184
|
+
help="NFT royalty percentage fraction in basis points. Example: 175 would represent 1.75%",
|
|
1185
|
+
type=int,
|
|
1186
|
+
default=0,
|
|
1187
|
+
show_default=True,
|
|
1188
|
+
)
|
|
1189
|
+
@click.option(
|
|
1190
|
+
"--reuse",
|
|
1191
|
+
help="Reuse existing address for the change.",
|
|
1192
|
+
is_flag=True,
|
|
1193
|
+
default=False,
|
|
1194
|
+
)
|
|
1195
|
+
@tx_out_cmd()
|
|
1196
|
+
@click.pass_context
|
|
1197
|
+
def nft_mint_cmd(
|
|
1198
|
+
ctx: click.Context,
|
|
1199
|
+
wallet_rpc_port: Optional[int],
|
|
1200
|
+
fingerprint: int,
|
|
1201
|
+
id: int,
|
|
1202
|
+
royalty_address: Optional[CliAddress],
|
|
1203
|
+
target_address: Optional[CliAddress],
|
|
1204
|
+
no_did_ownership: bool,
|
|
1205
|
+
hash: str,
|
|
1206
|
+
uris: str,
|
|
1207
|
+
metadata_hash: Optional[str],
|
|
1208
|
+
metadata_uris: Optional[str],
|
|
1209
|
+
license_hash: Optional[str],
|
|
1210
|
+
license_uris: Optional[str],
|
|
1211
|
+
edition_total: Optional[int],
|
|
1212
|
+
edition_number: Optional[int],
|
|
1213
|
+
fee: uint64,
|
|
1214
|
+
royalty_percentage_fraction: int,
|
|
1215
|
+
reuse: bool,
|
|
1216
|
+
push: bool,
|
|
1217
|
+
condition_valid_times: ConditionValidTimes,
|
|
1218
|
+
) -> list[TransactionRecord]:
|
|
1219
|
+
from chia.cmds.wallet_funcs import mint_nft
|
|
1220
|
+
|
|
1221
|
+
if metadata_uris is None:
|
|
1222
|
+
metadata_uris_list = []
|
|
1223
|
+
else:
|
|
1224
|
+
metadata_uris_list = [mu.strip() for mu in metadata_uris.split(",")]
|
|
1225
|
+
|
|
1226
|
+
if license_uris is None:
|
|
1227
|
+
license_uris_list = []
|
|
1228
|
+
else:
|
|
1229
|
+
license_uris_list = [lu.strip() for lu in license_uris.split(",")]
|
|
1230
|
+
|
|
1231
|
+
return asyncio.run(
|
|
1232
|
+
mint_nft(
|
|
1233
|
+
root_path=ChiaCliContext.set_default(ctx).root_path,
|
|
1234
|
+
wallet_rpc_port=wallet_rpc_port,
|
|
1235
|
+
fp=fingerprint,
|
|
1236
|
+
wallet_id=id,
|
|
1237
|
+
royalty_cli_address=royalty_address,
|
|
1238
|
+
target_cli_address=target_address,
|
|
1239
|
+
no_did_ownership=no_did_ownership,
|
|
1240
|
+
hash=hash,
|
|
1241
|
+
uris=[u.strip() for u in uris.split(",")],
|
|
1242
|
+
metadata_hash=metadata_hash,
|
|
1243
|
+
metadata_uris=metadata_uris_list,
|
|
1244
|
+
license_hash=license_hash,
|
|
1245
|
+
license_uris=license_uris_list,
|
|
1246
|
+
edition_total=edition_total,
|
|
1247
|
+
edition_number=edition_number,
|
|
1248
|
+
fee=fee,
|
|
1249
|
+
royalty_percentage=royalty_percentage_fraction,
|
|
1250
|
+
reuse_puzhash=True if reuse else None,
|
|
1251
|
+
push=push,
|
|
1252
|
+
condition_valid_times=condition_valid_times,
|
|
1253
|
+
)
|
|
1254
|
+
)
|
|
1255
|
+
|
|
1256
|
+
|
|
1257
|
+
@nft_cmd.command("add_uri", help="Add an URI to an NFT")
|
|
1258
|
+
@click.option(
|
|
1259
|
+
"-wp",
|
|
1260
|
+
"--wallet-rpc-port",
|
|
1261
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1262
|
+
type=int,
|
|
1263
|
+
default=None,
|
|
1264
|
+
)
|
|
1265
|
+
@options.create_fingerprint()
|
|
1266
|
+
@click.option("-i", "--id", help="Id of the NFT wallet to use", type=int, required=True)
|
|
1267
|
+
# TODO: change rpc to take bytes instead of a hex string
|
|
1268
|
+
@click.option("-ni", "--nft-coin-id", help="Id of the NFT coin to add the URI to", type=str, required=True)
|
|
1269
|
+
@click.option("-u", "--uri", help="URI to add to the NFT", type=str)
|
|
1270
|
+
@click.option("-mu", "--metadata-uri", help="Metadata URI to add to the NFT", type=str)
|
|
1271
|
+
@click.option("-lu", "--license-uri", help="License URI to add to the NFT", type=str)
|
|
1272
|
+
@options.create_fee()
|
|
1273
|
+
@click.option(
|
|
1274
|
+
"--reuse",
|
|
1275
|
+
help="Reuse existing address for the change.",
|
|
1276
|
+
is_flag=True,
|
|
1277
|
+
default=False,
|
|
1278
|
+
)
|
|
1279
|
+
@tx_out_cmd()
|
|
1280
|
+
@click.pass_context
|
|
1281
|
+
def nft_add_uri_cmd(
|
|
1282
|
+
ctx: click.Context,
|
|
1283
|
+
wallet_rpc_port: Optional[int],
|
|
1284
|
+
fingerprint: int,
|
|
1285
|
+
id: int,
|
|
1286
|
+
nft_coin_id: str,
|
|
1287
|
+
uri: str,
|
|
1288
|
+
metadata_uri: str,
|
|
1289
|
+
license_uri: str,
|
|
1290
|
+
fee: uint64,
|
|
1291
|
+
reuse: bool,
|
|
1292
|
+
push: bool,
|
|
1293
|
+
condition_valid_times: ConditionValidTimes,
|
|
1294
|
+
) -> list[TransactionRecord]:
|
|
1295
|
+
from chia.cmds.wallet_funcs import add_uri_to_nft
|
|
1296
|
+
|
|
1297
|
+
return asyncio.run(
|
|
1298
|
+
add_uri_to_nft(
|
|
1299
|
+
root_path=ChiaCliContext.set_default(ctx).root_path,
|
|
1300
|
+
wallet_rpc_port=wallet_rpc_port,
|
|
1301
|
+
fp=fingerprint,
|
|
1302
|
+
wallet_id=id,
|
|
1303
|
+
fee=fee,
|
|
1304
|
+
nft_coin_id=nft_coin_id,
|
|
1305
|
+
uri=uri,
|
|
1306
|
+
metadata_uri=metadata_uri,
|
|
1307
|
+
license_uri=license_uri,
|
|
1308
|
+
reuse_puzhash=True if reuse else None,
|
|
1309
|
+
push=push,
|
|
1310
|
+
condition_valid_times=condition_valid_times,
|
|
1311
|
+
)
|
|
1312
|
+
)
|
|
1313
|
+
|
|
1314
|
+
|
|
1315
|
+
@nft_cmd.command("transfer", help="Transfer an NFT")
|
|
1316
|
+
@click.option(
|
|
1317
|
+
"-wp",
|
|
1318
|
+
"--wallet-rpc-port",
|
|
1319
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1320
|
+
type=int,
|
|
1321
|
+
default=None,
|
|
1322
|
+
)
|
|
1323
|
+
@options.create_fingerprint()
|
|
1324
|
+
@click.option("-i", "--id", help="Id of the NFT wallet to use", type=int, required=True)
|
|
1325
|
+
@click.option("-ni", "--nft-coin-id", help="Id of the NFT coin to transfer", type=str, required=True)
|
|
1326
|
+
# TODO: Change RPC to use puzzlehash instead of address
|
|
1327
|
+
@click.option("-ta", "--target-address", help="Target recipient wallet address", type=AddressParamType(), required=True)
|
|
1328
|
+
@options.create_fee()
|
|
1329
|
+
@click.option(
|
|
1330
|
+
"--reuse",
|
|
1331
|
+
help="Reuse existing address for the change.",
|
|
1332
|
+
is_flag=True,
|
|
1333
|
+
default=False,
|
|
1334
|
+
)
|
|
1335
|
+
@tx_out_cmd()
|
|
1336
|
+
@click.pass_context
|
|
1337
|
+
def nft_transfer_cmd(
|
|
1338
|
+
ctx: click.Context,
|
|
1339
|
+
wallet_rpc_port: Optional[int],
|
|
1340
|
+
fingerprint: int,
|
|
1341
|
+
id: int,
|
|
1342
|
+
nft_coin_id: str,
|
|
1343
|
+
target_address: CliAddress,
|
|
1344
|
+
fee: uint64,
|
|
1345
|
+
reuse: bool,
|
|
1346
|
+
push: bool,
|
|
1347
|
+
condition_valid_times: ConditionValidTimes,
|
|
1348
|
+
) -> list[TransactionRecord]:
|
|
1349
|
+
from chia.cmds.wallet_funcs import transfer_nft
|
|
1350
|
+
|
|
1351
|
+
return asyncio.run(
|
|
1352
|
+
transfer_nft(
|
|
1353
|
+
root_path=ChiaCliContext.set_default(ctx).root_path,
|
|
1354
|
+
wallet_rpc_port=wallet_rpc_port,
|
|
1355
|
+
fp=fingerprint,
|
|
1356
|
+
wallet_id=id,
|
|
1357
|
+
fee=fee,
|
|
1358
|
+
nft_coin_id=nft_coin_id,
|
|
1359
|
+
target_cli_address=target_address,
|
|
1360
|
+
reuse_puzhash=True if reuse else None,
|
|
1361
|
+
push=push,
|
|
1362
|
+
condition_valid_times=condition_valid_times,
|
|
1363
|
+
)
|
|
1364
|
+
)
|
|
1365
|
+
|
|
1366
|
+
|
|
1367
|
+
@nft_cmd.command("list", help="List the current NFTs")
|
|
1368
|
+
@click.option(
|
|
1369
|
+
"-wp",
|
|
1370
|
+
"--wallet-rpc-port",
|
|
1371
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1372
|
+
type=int,
|
|
1373
|
+
default=None,
|
|
1374
|
+
)
|
|
1375
|
+
@options.create_fingerprint()
|
|
1376
|
+
@click.option("-i", "--id", help="Id of the NFT wallet to use", type=int, required=True)
|
|
1377
|
+
@click.option("--num", help="Number of NFTs to return", type=int, default=50)
|
|
1378
|
+
@click.option("--start-index", help="Which starting index to start listing NFTs from", type=int, default=0)
|
|
1379
|
+
@click.pass_context
|
|
1380
|
+
def nft_list_cmd(
|
|
1381
|
+
ctx: click.Context, wallet_rpc_port: Optional[int], fingerprint: int, id: int, num: int, start_index: int
|
|
1382
|
+
) -> None:
|
|
1383
|
+
from chia.cmds.wallet_funcs import list_nfts
|
|
1384
|
+
|
|
1385
|
+
asyncio.run(
|
|
1386
|
+
list_nfts(ChiaCliContext.set_default(ctx).root_path, wallet_rpc_port, fingerprint, id, num, start_index)
|
|
1387
|
+
)
|
|
1388
|
+
|
|
1389
|
+
|
|
1390
|
+
@nft_cmd.command("set_did", help="Set a DID on an NFT")
|
|
1391
|
+
@click.option(
|
|
1392
|
+
"-wp",
|
|
1393
|
+
"--wallet-rpc-port",
|
|
1394
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1395
|
+
type=int,
|
|
1396
|
+
default=None,
|
|
1397
|
+
)
|
|
1398
|
+
@options.create_fingerprint()
|
|
1399
|
+
@click.option("-i", "--id", help="Id of the NFT wallet to use", type=int, required=True)
|
|
1400
|
+
# TODO: Change RPC to use bytes instead of hex string
|
|
1401
|
+
@click.option("-di", "--did-id", help="DID Id to set on the NFT", type=str, required=True)
|
|
1402
|
+
@click.option("-ni", "--nft-coin-id", help="Id of the NFT coin to set the DID on", type=str, required=True)
|
|
1403
|
+
@options.create_fee()
|
|
1404
|
+
@click.option(
|
|
1405
|
+
"--reuse",
|
|
1406
|
+
help="Reuse existing address for the change.",
|
|
1407
|
+
is_flag=True,
|
|
1408
|
+
default=False,
|
|
1409
|
+
)
|
|
1410
|
+
@tx_out_cmd()
|
|
1411
|
+
@click.pass_context
|
|
1412
|
+
def nft_set_did_cmd(
|
|
1413
|
+
ctx: click.Context,
|
|
1414
|
+
wallet_rpc_port: Optional[int],
|
|
1415
|
+
fingerprint: int,
|
|
1416
|
+
id: int,
|
|
1417
|
+
did_id: str,
|
|
1418
|
+
nft_coin_id: str,
|
|
1419
|
+
fee: uint64,
|
|
1420
|
+
reuse: bool,
|
|
1421
|
+
push: bool,
|
|
1422
|
+
condition_valid_times: ConditionValidTimes,
|
|
1423
|
+
) -> list[TransactionRecord]:
|
|
1424
|
+
from chia.cmds.wallet_funcs import set_nft_did
|
|
1425
|
+
|
|
1426
|
+
return asyncio.run(
|
|
1427
|
+
set_nft_did(
|
|
1428
|
+
root_path=ChiaCliContext.set_default(ctx).root_path,
|
|
1429
|
+
wallet_rpc_port=wallet_rpc_port,
|
|
1430
|
+
fp=fingerprint,
|
|
1431
|
+
wallet_id=id,
|
|
1432
|
+
fee=fee,
|
|
1433
|
+
nft_coin_id=nft_coin_id,
|
|
1434
|
+
did_id=did_id,
|
|
1435
|
+
reuse_puzhash=True if reuse else None,
|
|
1436
|
+
push=push,
|
|
1437
|
+
condition_valid_times=condition_valid_times,
|
|
1438
|
+
)
|
|
1439
|
+
)
|
|
1440
|
+
|
|
1441
|
+
|
|
1442
|
+
@nft_cmd.command("get_info", help="Get NFT information")
|
|
1443
|
+
@click.option(
|
|
1444
|
+
"-wp",
|
|
1445
|
+
"--wallet-rpc-port",
|
|
1446
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1447
|
+
type=int,
|
|
1448
|
+
default=None,
|
|
1449
|
+
)
|
|
1450
|
+
@options.create_fingerprint()
|
|
1451
|
+
# TODO: Change RPC to use bytes instead of hex string
|
|
1452
|
+
@click.option("-ni", "--nft-coin-id", help="Id of the NFT coin to get information on", type=str, required=True)
|
|
1453
|
+
@click.pass_context
|
|
1454
|
+
def nft_get_info_cmd(
|
|
1455
|
+
ctx: click.Context,
|
|
1456
|
+
wallet_rpc_port: Optional[int],
|
|
1457
|
+
fingerprint: int,
|
|
1458
|
+
nft_coin_id: str,
|
|
1459
|
+
) -> None:
|
|
1460
|
+
from chia.cmds.wallet_funcs import get_nft_info
|
|
1461
|
+
|
|
1462
|
+
asyncio.run(get_nft_info(ChiaCliContext.set_default(ctx).root_path, wallet_rpc_port, fingerprint, nft_coin_id))
|
|
1463
|
+
|
|
1464
|
+
|
|
1465
|
+
# Keep at bottom.
|
|
1466
|
+
wallet_cmd.add_command(coins_cmd)
|
|
1467
|
+
|
|
1468
|
+
|
|
1469
|
+
@wallet_cmd.group("notifications", help="Send/Manage notifications")
|
|
1470
|
+
def notification_cmd() -> None:
|
|
1471
|
+
pass
|
|
1472
|
+
|
|
1473
|
+
|
|
1474
|
+
@notification_cmd.command("send", help="Send a notification to the owner of an address")
|
|
1475
|
+
@click.option(
|
|
1476
|
+
"-wp",
|
|
1477
|
+
"--wallet-rpc-port",
|
|
1478
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1479
|
+
type=int,
|
|
1480
|
+
default=None,
|
|
1481
|
+
)
|
|
1482
|
+
@options.create_fingerprint()
|
|
1483
|
+
@click.option(
|
|
1484
|
+
"-t", "--to-address", help="The address to send the notification to", type=AddressParamType(), required=True
|
|
1485
|
+
)
|
|
1486
|
+
@click.option(
|
|
1487
|
+
"-a",
|
|
1488
|
+
"--amount",
|
|
1489
|
+
help="The amount (in XCH) to send to get the notification past the recipient's spam filter",
|
|
1490
|
+
type=AmountParamType(),
|
|
1491
|
+
default=CliAmount(mojos=True, amount=uint64(10000000)),
|
|
1492
|
+
required=True,
|
|
1493
|
+
show_default=True,
|
|
1494
|
+
)
|
|
1495
|
+
@click.option("-n", "--message", help="The message of the notification", type=str)
|
|
1496
|
+
@options.create_fee()
|
|
1497
|
+
@tx_out_cmd()
|
|
1498
|
+
@click.pass_context
|
|
1499
|
+
def send_notification_cmd(
|
|
1500
|
+
ctx: click.Context,
|
|
1501
|
+
wallet_rpc_port: Optional[int],
|
|
1502
|
+
fingerprint: int,
|
|
1503
|
+
to_address: CliAddress,
|
|
1504
|
+
amount: CliAmount,
|
|
1505
|
+
message: str,
|
|
1506
|
+
fee: uint64,
|
|
1507
|
+
push: bool,
|
|
1508
|
+
condition_valid_times: ConditionValidTimes,
|
|
1509
|
+
) -> list[TransactionRecord]:
|
|
1510
|
+
from chia.cmds.wallet_funcs import send_notification
|
|
1511
|
+
|
|
1512
|
+
message_bytes: bytes = bytes(message, "utf8")
|
|
1513
|
+
return asyncio.run(
|
|
1514
|
+
send_notification(
|
|
1515
|
+
ChiaCliContext.set_default(ctx).root_path,
|
|
1516
|
+
wallet_rpc_port,
|
|
1517
|
+
fingerprint,
|
|
1518
|
+
fee,
|
|
1519
|
+
to_address,
|
|
1520
|
+
message_bytes,
|
|
1521
|
+
amount,
|
|
1522
|
+
push,
|
|
1523
|
+
condition_valid_times=condition_valid_times,
|
|
1524
|
+
)
|
|
1525
|
+
)
|
|
1526
|
+
|
|
1527
|
+
|
|
1528
|
+
@notification_cmd.command("get", help="Get notification(s) that are in your wallet")
|
|
1529
|
+
@click.option(
|
|
1530
|
+
"-wp",
|
|
1531
|
+
"--wallet-rpc-port",
|
|
1532
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1533
|
+
type=int,
|
|
1534
|
+
default=None,
|
|
1535
|
+
)
|
|
1536
|
+
@options.create_fingerprint()
|
|
1537
|
+
@click.option("-i", "--id", help="The specific notification ID to show", type=Bytes32ParamType(), multiple=True)
|
|
1538
|
+
@click.option("-s", "--start", help="The number of notifications to skip", type=int, default=None)
|
|
1539
|
+
@click.option("-e", "--end", help="The number of notifications to stop at", type=int, default=None)
|
|
1540
|
+
@click.pass_context
|
|
1541
|
+
def get_notifications_cmd(
|
|
1542
|
+
ctx: click.Context,
|
|
1543
|
+
wallet_rpc_port: Optional[int],
|
|
1544
|
+
fingerprint: int,
|
|
1545
|
+
id: Sequence[bytes32],
|
|
1546
|
+
start: Optional[int],
|
|
1547
|
+
end: Optional[int],
|
|
1548
|
+
) -> None:
|
|
1549
|
+
from chia.cmds.wallet_funcs import get_notifications
|
|
1550
|
+
|
|
1551
|
+
asyncio.run(
|
|
1552
|
+
get_notifications(ChiaCliContext.set_default(ctx).root_path, wallet_rpc_port, fingerprint, id, start, end)
|
|
1553
|
+
)
|
|
1554
|
+
|
|
1555
|
+
|
|
1556
|
+
@notification_cmd.command("delete", help="Delete notification(s) that are in your wallet")
|
|
1557
|
+
@click.option(
|
|
1558
|
+
"-wp",
|
|
1559
|
+
"--wallet-rpc-port",
|
|
1560
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1561
|
+
type=int,
|
|
1562
|
+
default=None,
|
|
1563
|
+
)
|
|
1564
|
+
@options.create_fingerprint()
|
|
1565
|
+
@click.option("-i", "--id", help="A specific notification ID to delete", type=Bytes32ParamType(), multiple=True)
|
|
1566
|
+
@click.option("--all", help="All notifications can be deleted (they will be recovered during resync)", is_flag=True)
|
|
1567
|
+
@click.pass_context
|
|
1568
|
+
def delete_notifications_cmd(
|
|
1569
|
+
ctx: click.Context,
|
|
1570
|
+
wallet_rpc_port: Optional[int],
|
|
1571
|
+
fingerprint: int,
|
|
1572
|
+
id: Sequence[bytes32],
|
|
1573
|
+
all: bool,
|
|
1574
|
+
) -> None:
|
|
1575
|
+
from chia.cmds.wallet_funcs import delete_notifications
|
|
1576
|
+
|
|
1577
|
+
asyncio.run(delete_notifications(ChiaCliContext.set_default(ctx).root_path, wallet_rpc_port, fingerprint, id, all))
|
|
1578
|
+
|
|
1579
|
+
|
|
1580
|
+
@wallet_cmd.group("vcs", short_help="Verifiable Credential related actions")
|
|
1581
|
+
def vcs_cmd() -> None: # pragma: no cover
|
|
1582
|
+
pass
|
|
1583
|
+
|
|
1584
|
+
|
|
1585
|
+
@vcs_cmd.command("mint", short_help="Mint a VC")
|
|
1586
|
+
@click.option(
|
|
1587
|
+
"-wp",
|
|
1588
|
+
"--wallet-rpc-port",
|
|
1589
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1590
|
+
type=int,
|
|
1591
|
+
default=None,
|
|
1592
|
+
)
|
|
1593
|
+
@options.create_fingerprint()
|
|
1594
|
+
@click.option("-d", "--did", help="The DID of the VC's proof provider", type=AddressParamType(), required=True)
|
|
1595
|
+
@click.option(
|
|
1596
|
+
"-t",
|
|
1597
|
+
"--target-address",
|
|
1598
|
+
help="The address to send the VC to once it's minted",
|
|
1599
|
+
type=AddressParamType(),
|
|
1600
|
+
required=False,
|
|
1601
|
+
)
|
|
1602
|
+
@options.create_fee("Blockchain fee for mint transaction, in XCH")
|
|
1603
|
+
@tx_out_cmd()
|
|
1604
|
+
@click.pass_context
|
|
1605
|
+
def mint_vc_cmd(
|
|
1606
|
+
ctx: click.Context,
|
|
1607
|
+
wallet_rpc_port: Optional[int],
|
|
1608
|
+
fingerprint: int,
|
|
1609
|
+
did: CliAddress,
|
|
1610
|
+
target_address: Optional[CliAddress],
|
|
1611
|
+
fee: uint64,
|
|
1612
|
+
push: bool,
|
|
1613
|
+
condition_valid_times: ConditionValidTimes,
|
|
1614
|
+
) -> list[TransactionRecord]:
|
|
1615
|
+
from chia.cmds.wallet_funcs import mint_vc
|
|
1616
|
+
|
|
1617
|
+
return asyncio.run(
|
|
1618
|
+
mint_vc(
|
|
1619
|
+
ChiaCliContext.set_default(ctx).root_path,
|
|
1620
|
+
wallet_rpc_port,
|
|
1621
|
+
fingerprint,
|
|
1622
|
+
did,
|
|
1623
|
+
fee,
|
|
1624
|
+
target_address,
|
|
1625
|
+
push,
|
|
1626
|
+
condition_valid_times=condition_valid_times,
|
|
1627
|
+
)
|
|
1628
|
+
)
|
|
1629
|
+
|
|
1630
|
+
|
|
1631
|
+
@vcs_cmd.command("get", short_help="Get a list of existing VCs")
|
|
1632
|
+
@click.option(
|
|
1633
|
+
"-wp",
|
|
1634
|
+
"--wallet-rpc-port",
|
|
1635
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1636
|
+
type=int,
|
|
1637
|
+
default=None,
|
|
1638
|
+
)
|
|
1639
|
+
@options.create_fingerprint()
|
|
1640
|
+
@click.option(
|
|
1641
|
+
"-s", "--start", help="The index to start the list at", type=int, required=False, default=0, show_default=True
|
|
1642
|
+
)
|
|
1643
|
+
@click.option(
|
|
1644
|
+
"-c", "--count", help="How many results to return", type=int, required=False, default=50, show_default=True
|
|
1645
|
+
)
|
|
1646
|
+
@click.pass_context
|
|
1647
|
+
def get_vcs_cmd(
|
|
1648
|
+
ctx: click.Context,
|
|
1649
|
+
wallet_rpc_port: Optional[int],
|
|
1650
|
+
fingerprint: int,
|
|
1651
|
+
start: int,
|
|
1652
|
+
count: int,
|
|
1653
|
+
) -> None: # pragma: no cover
|
|
1654
|
+
from chia.cmds.wallet_funcs import get_vcs
|
|
1655
|
+
|
|
1656
|
+
asyncio.run(get_vcs(ChiaCliContext.set_default(ctx).root_path, wallet_rpc_port, fingerprint, start, count))
|
|
1657
|
+
|
|
1658
|
+
|
|
1659
|
+
@vcs_cmd.command("update_proofs", short_help="Update a VC's proofs if you have the provider DID")
|
|
1660
|
+
@click.option(
|
|
1661
|
+
"-wp",
|
|
1662
|
+
"--wallet-rpc-port",
|
|
1663
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1664
|
+
type=int,
|
|
1665
|
+
default=None,
|
|
1666
|
+
)
|
|
1667
|
+
@options.create_fingerprint()
|
|
1668
|
+
@click.option(
|
|
1669
|
+
"-l",
|
|
1670
|
+
"--vc-id",
|
|
1671
|
+
help="The launcher ID of the VC whose proofs should be updated",
|
|
1672
|
+
type=Bytes32ParamType(),
|
|
1673
|
+
required=True,
|
|
1674
|
+
)
|
|
1675
|
+
@click.option(
|
|
1676
|
+
"-t",
|
|
1677
|
+
"--new-puzhash",
|
|
1678
|
+
help="The address to send the VC after the proofs have been updated",
|
|
1679
|
+
type=Bytes32ParamType(),
|
|
1680
|
+
required=False,
|
|
1681
|
+
)
|
|
1682
|
+
@click.option("-p", "--new-proof-hash", help="The new proof hash to update the VC to", type=str, required=True)
|
|
1683
|
+
@options.create_fee("Blockchain fee for update transaction, in XCH")
|
|
1684
|
+
@click.option(
|
|
1685
|
+
"--reuse-puzhash/--generate-new-puzhash",
|
|
1686
|
+
help="Send the VC back to the same puzzle hash it came from (ignored if --new-puzhash is specified)",
|
|
1687
|
+
default=False,
|
|
1688
|
+
show_default=True,
|
|
1689
|
+
)
|
|
1690
|
+
@tx_out_cmd()
|
|
1691
|
+
@click.pass_context
|
|
1692
|
+
def spend_vc_cmd(
|
|
1693
|
+
ctx: click.Context,
|
|
1694
|
+
wallet_rpc_port: Optional[int],
|
|
1695
|
+
fingerprint: int,
|
|
1696
|
+
vc_id: bytes32,
|
|
1697
|
+
new_puzhash: Optional[bytes32],
|
|
1698
|
+
new_proof_hash: str,
|
|
1699
|
+
fee: uint64,
|
|
1700
|
+
reuse_puzhash: bool,
|
|
1701
|
+
push: bool,
|
|
1702
|
+
condition_valid_times: ConditionValidTimes,
|
|
1703
|
+
) -> list[TransactionRecord]:
|
|
1704
|
+
from chia.cmds.wallet_funcs import spend_vc
|
|
1705
|
+
|
|
1706
|
+
return asyncio.run(
|
|
1707
|
+
spend_vc(
|
|
1708
|
+
root_path=ChiaCliContext.set_default(ctx).root_path,
|
|
1709
|
+
wallet_rpc_port=wallet_rpc_port,
|
|
1710
|
+
fp=fingerprint,
|
|
1711
|
+
vc_id=vc_id,
|
|
1712
|
+
fee=fee,
|
|
1713
|
+
new_puzhash=new_puzhash,
|
|
1714
|
+
new_proof_hash=new_proof_hash,
|
|
1715
|
+
reuse_puzhash=reuse_puzhash,
|
|
1716
|
+
push=push,
|
|
1717
|
+
condition_valid_times=condition_valid_times,
|
|
1718
|
+
)
|
|
1719
|
+
)
|
|
1720
|
+
|
|
1721
|
+
|
|
1722
|
+
@vcs_cmd.command("add_proof_reveal", short_help="Add a series of proofs that will combine to a single proof hash")
|
|
1723
|
+
@click.option(
|
|
1724
|
+
"-wp",
|
|
1725
|
+
"--wallet-rpc-port",
|
|
1726
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1727
|
+
type=int,
|
|
1728
|
+
default=None,
|
|
1729
|
+
)
|
|
1730
|
+
@options.create_fingerprint()
|
|
1731
|
+
@click.option("-p", "--proof", help="A flag to add as a proof", type=str, multiple=True)
|
|
1732
|
+
@click.option("-r", "--root-only", help="Do not add the proofs to the DB, just output the root", is_flag=True)
|
|
1733
|
+
@click.pass_context
|
|
1734
|
+
def add_proof_reveal_cmd(
|
|
1735
|
+
ctx: click.Context,
|
|
1736
|
+
wallet_rpc_port: Optional[int],
|
|
1737
|
+
fingerprint: int,
|
|
1738
|
+
proof: Sequence[str],
|
|
1739
|
+
root_only: bool,
|
|
1740
|
+
) -> None: # pragma: no cover
|
|
1741
|
+
from chia.cmds.wallet_funcs import add_proof_reveal
|
|
1742
|
+
|
|
1743
|
+
asyncio.run(
|
|
1744
|
+
add_proof_reveal(ChiaCliContext.set_default(ctx).root_path, wallet_rpc_port, fingerprint, proof, root_only)
|
|
1745
|
+
)
|
|
1746
|
+
|
|
1747
|
+
|
|
1748
|
+
@vcs_cmd.command("get_proofs_for_root", short_help="Get the stored proof flags for a given proof hash")
|
|
1749
|
+
@click.option(
|
|
1750
|
+
"-wp",
|
|
1751
|
+
"--wallet-rpc-port",
|
|
1752
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1753
|
+
type=int,
|
|
1754
|
+
default=None,
|
|
1755
|
+
)
|
|
1756
|
+
@options.create_fingerprint()
|
|
1757
|
+
@click.option("-r", "--proof-hash", help="The root to search for", type=str, required=True)
|
|
1758
|
+
@click.pass_context
|
|
1759
|
+
def get_proofs_for_root_cmd(
|
|
1760
|
+
ctx: click.Context,
|
|
1761
|
+
wallet_rpc_port: Optional[int],
|
|
1762
|
+
fingerprint: int,
|
|
1763
|
+
proof_hash: str,
|
|
1764
|
+
) -> None: # pragma: no cover
|
|
1765
|
+
from chia.cmds.wallet_funcs import get_proofs_for_root
|
|
1766
|
+
|
|
1767
|
+
asyncio.run(
|
|
1768
|
+
get_proofs_for_root(ChiaCliContext.set_default(ctx).root_path, wallet_rpc_port, fingerprint, proof_hash)
|
|
1769
|
+
)
|
|
1770
|
+
|
|
1771
|
+
|
|
1772
|
+
@vcs_cmd.command("revoke", short_help="Revoke any VC if you have the proper DID and the VCs parent coin")
|
|
1773
|
+
@click.option(
|
|
1774
|
+
"-wp",
|
|
1775
|
+
"--wallet-rpc-port",
|
|
1776
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1777
|
+
type=int,
|
|
1778
|
+
default=None,
|
|
1779
|
+
)
|
|
1780
|
+
@options.create_fingerprint()
|
|
1781
|
+
@click.option(
|
|
1782
|
+
"-p",
|
|
1783
|
+
"--parent-coin-id",
|
|
1784
|
+
help="The ID of the parent coin of the VC (optional if VC ID is used)",
|
|
1785
|
+
type=Bytes32ParamType(),
|
|
1786
|
+
required=False,
|
|
1787
|
+
)
|
|
1788
|
+
@click.option(
|
|
1789
|
+
"-l",
|
|
1790
|
+
"--vc-id",
|
|
1791
|
+
help="The launcher ID of the VC to revoke (must be tracked by wallet) (optional if Parent ID is used)",
|
|
1792
|
+
type=Bytes32ParamType(),
|
|
1793
|
+
required=False,
|
|
1794
|
+
)
|
|
1795
|
+
@options.create_fee("Blockchain fee for revocation transaction, in XCH")
|
|
1796
|
+
@click.option(
|
|
1797
|
+
"--reuse-puzhash/--generate-new-puzhash",
|
|
1798
|
+
help="Send the VC back to the same puzzle hash it came from (ignored if --new-puzhash is specified)",
|
|
1799
|
+
default=False,
|
|
1800
|
+
show_default=True,
|
|
1801
|
+
)
|
|
1802
|
+
@tx_out_cmd()
|
|
1803
|
+
@click.pass_context
|
|
1804
|
+
def revoke_vc_cmd(
|
|
1805
|
+
ctx: click.Context,
|
|
1806
|
+
wallet_rpc_port: Optional[int],
|
|
1807
|
+
fingerprint: int,
|
|
1808
|
+
parent_coin_id: Optional[bytes32],
|
|
1809
|
+
vc_id: Optional[bytes32],
|
|
1810
|
+
fee: uint64,
|
|
1811
|
+
reuse_puzhash: bool,
|
|
1812
|
+
push: bool,
|
|
1813
|
+
condition_valid_times: ConditionValidTimes,
|
|
1814
|
+
) -> list[TransactionRecord]:
|
|
1815
|
+
from chia.cmds.wallet_funcs import revoke_vc
|
|
1816
|
+
|
|
1817
|
+
return asyncio.run(
|
|
1818
|
+
revoke_vc(
|
|
1819
|
+
ChiaCliContext.set_default(ctx).root_path,
|
|
1820
|
+
wallet_rpc_port,
|
|
1821
|
+
fingerprint,
|
|
1822
|
+
parent_coin_id,
|
|
1823
|
+
vc_id,
|
|
1824
|
+
fee,
|
|
1825
|
+
reuse_puzhash,
|
|
1826
|
+
push,
|
|
1827
|
+
condition_valid_times=condition_valid_times,
|
|
1828
|
+
)
|
|
1829
|
+
)
|
|
1830
|
+
|
|
1831
|
+
|
|
1832
|
+
@vcs_cmd.command("approve_r_cats", help="Claim any R-CATs that are currently pending VC approval")
|
|
1833
|
+
@click.option(
|
|
1834
|
+
"-wp",
|
|
1835
|
+
"--wallet-rpc-port",
|
|
1836
|
+
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
|
1837
|
+
type=int,
|
|
1838
|
+
default=None,
|
|
1839
|
+
)
|
|
1840
|
+
@options.create_fingerprint()
|
|
1841
|
+
@click.option("-i", "--id", help="Id of the wallet with the pending approval balance", type=int, required=True)
|
|
1842
|
+
@click.option(
|
|
1843
|
+
"-a",
|
|
1844
|
+
"--min-amount-to-claim",
|
|
1845
|
+
help="The minimum amount (in CAT units) to approve to move into the wallet",
|
|
1846
|
+
type=AmountParamType(),
|
|
1847
|
+
required=True,
|
|
1848
|
+
)
|
|
1849
|
+
@options.create_fee("Blockchain fee for approval transaction, in XCH")
|
|
1850
|
+
@click.option(
|
|
1851
|
+
"-ma",
|
|
1852
|
+
"--min-coin-amount",
|
|
1853
|
+
type=AmountParamType(),
|
|
1854
|
+
default=cli_amount_none,
|
|
1855
|
+
help="The minimum coin amount (in CAT units) to select",
|
|
1856
|
+
)
|
|
1857
|
+
@click.option(
|
|
1858
|
+
"-l",
|
|
1859
|
+
"--max-coin-amount",
|
|
1860
|
+
type=AmountParamType(),
|
|
1861
|
+
default=cli_amount_none,
|
|
1862
|
+
help="The maximum coin amount (in CAT units) to select",
|
|
1863
|
+
)
|
|
1864
|
+
@click.option(
|
|
1865
|
+
"--reuse",
|
|
1866
|
+
help="Reuse existing address for the change.",
|
|
1867
|
+
is_flag=True,
|
|
1868
|
+
default=False,
|
|
1869
|
+
)
|
|
1870
|
+
@tx_out_cmd()
|
|
1871
|
+
@click.pass_context
|
|
1872
|
+
def approve_r_cats_cmd(
|
|
1873
|
+
ctx: click.Context,
|
|
1874
|
+
wallet_rpc_port: Optional[int],
|
|
1875
|
+
fingerprint: int,
|
|
1876
|
+
id: int,
|
|
1877
|
+
min_amount_to_claim: CliAmount,
|
|
1878
|
+
fee: uint64,
|
|
1879
|
+
min_coin_amount: CliAmount,
|
|
1880
|
+
max_coin_amount: CliAmount,
|
|
1881
|
+
reuse: bool,
|
|
1882
|
+
push: bool,
|
|
1883
|
+
condition_valid_times: ConditionValidTimes,
|
|
1884
|
+
) -> list[TransactionRecord]:
|
|
1885
|
+
from chia.cmds.wallet_funcs import approve_r_cats
|
|
1886
|
+
|
|
1887
|
+
return asyncio.run(
|
|
1888
|
+
approve_r_cats(
|
|
1889
|
+
ChiaCliContext.set_default(ctx).root_path,
|
|
1890
|
+
wallet_rpc_port,
|
|
1891
|
+
fingerprint,
|
|
1892
|
+
uint32(id),
|
|
1893
|
+
min_amount_to_claim,
|
|
1894
|
+
fee,
|
|
1895
|
+
min_coin_amount,
|
|
1896
|
+
max_coin_amount,
|
|
1897
|
+
reuse,
|
|
1898
|
+
push,
|
|
1899
|
+
condition_valid_times=condition_valid_times,
|
|
1900
|
+
)
|
|
1901
|
+
)
|