chia-blockchain 2.5.2rc2__py3-none-any.whl → 2.5.3__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 +7 -0
- chia/_tests/blockchain/blockchain_test_utils.py +1 -1
- chia/_tests/blockchain/test_augmented_chain.py +54 -5
- chia/_tests/blockchain/test_blockchain.py +5 -12
- chia/_tests/blockchain/test_blockchain_transactions.py +3 -5
- chia/_tests/blockchain/test_get_block_generator.py +2 -2
- chia/_tests/blockchain/test_lookup_fork_chain.py +2 -2
- chia/_tests/clvm/benchmark_costs.py +2 -1
- chia/_tests/clvm/coin_store.py +4 -3
- chia/_tests/clvm/test_chialisp_deserialization.py +2 -2
- chia/_tests/clvm/test_curry_and_treehash.py +1 -1
- chia/_tests/clvm/test_puzzle_compression.py +2 -2
- chia/_tests/clvm/test_puzzles.py +2 -2
- chia/_tests/clvm/test_singletons.py +2 -2
- chia/_tests/clvm/test_spend_sim.py +1 -1
- chia/_tests/cmds/cmd_test_utils.py +2 -2
- chia/_tests/cmds/test_click_types.py +2 -2
- chia/_tests/cmds/test_cmd_framework.py +6 -6
- chia/_tests/cmds/test_show.py +4 -3
- chia/_tests/cmds/test_tx_config_args.py +1 -1
- chia/_tests/cmds/testing_classes.py +2 -2
- chia/_tests/cmds/wallet/test_consts.py +2 -2
- chia/_tests/cmds/wallet/test_did.py +2 -2
- chia/_tests/cmds/wallet/test_nft.py +2 -2
- chia/_tests/cmds/wallet/test_notifications.py +3 -2
- chia/_tests/cmds/wallet/test_vcs.py +2 -2
- chia/_tests/cmds/wallet/test_wallet.py +4 -8
- chia/_tests/conftest.py +4 -3
- chia/_tests/connection_utils.py +2 -2
- chia/_tests/core/cmds/test_keys.py +1 -2
- chia/_tests/core/cmds/test_wallet.py +2 -2
- chia/_tests/core/consensus/test_block_creation.py +2 -2
- chia/_tests/core/consensus/test_pot_iterations.py +1 -1
- chia/_tests/core/custom_types/test_coin.py +2 -2
- chia/_tests/core/custom_types/test_proof_of_space.py +2 -2
- chia/_tests/core/custom_types/test_spend_bundle.py +2 -2
- chia/_tests/core/data_layer/conftest.py +1 -1
- chia/_tests/core/data_layer/test_data_layer.py +1 -1
- chia/_tests/core/data_layer/test_data_layer_util.py +1 -1
- chia/_tests/core/data_layer/test_data_rpc.py +2 -2
- chia/_tests/core/data_layer/test_data_store.py +1 -1
- chia/_tests/core/data_layer/test_data_store_schema.py +1 -1
- chia/_tests/core/data_layer/util.py +2 -1
- chia/_tests/core/farmer/test_farmer_api.py +1 -1
- chia/_tests/core/full_node/full_sync/test_full_sync.py +1 -7
- chia/_tests/core/full_node/ram_db.py +2 -1
- chia/_tests/core/full_node/stores/test_block_store.py +2 -2
- chia/_tests/core/full_node/stores/test_coin_store.py +2 -2
- chia/_tests/core/full_node/stores/test_full_node_store.py +3 -3
- chia/_tests/core/full_node/stores/test_hint_store.py +2 -2
- chia/_tests/core/full_node/stores/test_sync_store.py +1 -1
- chia/_tests/core/full_node/test_address_manager.py +1 -1
- chia/_tests/core/full_node/test_block_height_map.py +2 -2
- chia/_tests/core/full_node/test_conditions.py +1 -1
- chia/_tests/core/full_node/test_full_node.py +346 -164
- chia/_tests/core/full_node/test_generator_tools.py +3 -2
- chia/_tests/core/full_node/test_hint_management.py +2 -2
- chia/_tests/core/full_node/test_performance.py +2 -15
- chia/_tests/core/full_node/test_subscriptions.py +1 -1
- chia/_tests/core/full_node/test_transactions.py +186 -185
- chia/_tests/core/full_node/test_tx_processing_queue.py +1 -1
- chia/_tests/core/make_block_generator.py +2 -2
- chia/_tests/core/mempool/test_mempool.py +165 -22
- chia/_tests/core/mempool/test_mempool_fee_estimator.py +1 -1
- chia/_tests/core/mempool/test_mempool_fee_protocol.py +1 -1
- chia/_tests/core/mempool/test_mempool_manager.py +476 -66
- chia/_tests/core/mempool/test_mempool_performance.py +2 -2
- chia/_tests/core/mempool/test_singleton_fast_forward.py +19 -25
- chia/_tests/core/node_height.py +2 -1
- chia/_tests/core/server/test_capabilities.py +1 -1
- chia/_tests/core/server/test_dos.py +36 -28
- chia/_tests/core/server/test_loop.py +3 -3
- chia/_tests/core/server/test_rate_limits.py +1 -1
- chia/_tests/core/server/test_server.py +2 -2
- chia/_tests/core/services/test_services.py +1 -1
- chia/_tests/core/ssl/test_ssl.py +1 -1
- chia/_tests/core/test_coins.py +2 -1
- chia/_tests/core/test_cost_calculation.py +2 -2
- chia/_tests/core/test_crawler.py +2 -2
- chia/_tests/core/test_db_conversion.py +2 -2
- chia/_tests/core/test_db_validation.py +26 -13
- chia/_tests/core/test_farmer_harvester_rpc.py +2 -2
- chia/_tests/core/test_full_node_rpc.py +2 -2
- chia/_tests/core/test_merkle_set.py +2 -2
- chia/_tests/core/test_program.py +2 -2
- chia/_tests/core/test_rpc_util.py +1 -1
- chia/_tests/core/test_seeder.py +1 -1
- chia/_tests/core/util/test_block_cache.py +3 -3
- chia/_tests/core/util/test_jsonify.py +3 -2
- chia/_tests/core/util/test_keychain.py +3 -3
- chia/_tests/core/util/test_streamable.py +3 -4
- chia/_tests/environments/wallet.py +3 -2
- chia/_tests/farmer_harvester/test_farmer.py +3 -4
- chia/_tests/farmer_harvester/test_farmer_harvester.py +2 -2
- chia/_tests/farmer_harvester/test_filter_prefix_bits.py +2 -2
- chia/_tests/farmer_harvester/test_third_party_harvesters.py +3 -4
- chia/_tests/fee_estimation/test_fee_estimation_integration.py +1 -1
- chia/_tests/fee_estimation/test_fee_estimation_rpc.py +2 -2
- chia/_tests/fee_estimation/test_fee_estimation_unit_tests.py +1 -1
- chia/_tests/fee_estimation/test_mempoolitem_height_added.py +3 -4
- chia/_tests/generator/test_compression.py +20 -10
- chia/_tests/generator/test_rom.py +7 -9
- chia/_tests/plot_sync/test_delta.py +2 -2
- chia/_tests/plot_sync/test_plot_sync.py +2 -2
- chia/_tests/plot_sync/test_receiver.py +2 -2
- chia/_tests/plot_sync/test_sender.py +2 -2
- chia/_tests/plot_sync/test_sync_simulated.py +2 -2
- chia/_tests/plot_sync/util.py +3 -2
- chia/_tests/plotting/test_plot_manager.py +1 -1
- chia/_tests/pools/test_pool_cli_parsing.py +3 -2
- chia/_tests/pools/test_pool_cmdline.py +2 -2
- chia/_tests/pools/test_pool_puzzles_lifecycle.py +3 -3
- chia/_tests/pools/test_pool_rpc.py +4 -5
- chia/_tests/pools/test_pool_wallet.py +1 -1
- chia/_tests/pools/test_wallet_pool_store.py +2 -2
- chia/_tests/rpc/test_rpc_client.py +1 -1
- chia/_tests/rpc/test_rpc_server.py +1 -1
- chia/_tests/simulation/test_simulation.py +36 -8
- chia/_tests/simulation/test_simulator.py +5 -5
- chia/_tests/simulation/test_start_simulator.py +2 -2
- chia/_tests/timelord/test_new_peak.py +2 -2
- chia/_tests/tools/test_run_block.py +3 -2
- chia/_tests/util/benchmark_cost.py +2 -2
- chia/_tests/util/benchmarks.py +17 -6
- chia/_tests/util/blockchain.py +2 -1
- chia/_tests/util/blockchain_mock.py +9 -5
- chia/_tests/util/build_network_protocol_files.py +2 -1
- chia/_tests/util/constants.py +2 -1
- chia/_tests/util/full_sync.py +6 -3
- chia/_tests/util/gen_ssl_certs.py +2 -2
- chia/_tests/util/generator_tools_testing.py +4 -3
- chia/_tests/util/get_name_puzzle_conditions.py +2 -2
- chia/_tests/util/misc.py +16 -2
- chia/_tests/util/network_protocol_data.py +17 -7
- chia/_tests/util/run_block.py +6 -8
- chia/_tests/util/setup_nodes.py +4 -3
- chia/_tests/util/spend_sim.py +9 -5
- chia/_tests/util/test_condition_tools.py +2 -2
- chia/_tests/util/test_config.py +2 -1
- chia/_tests/util/test_errors.py +2 -1
- chia/_tests/util/test_full_block_utils.py +17 -7
- chia/_tests/util/test_misc.py +1 -1
- chia/_tests/util/test_network_protocol_test.py +24 -24
- chia/_tests/util/test_replace_str_to_bytes.py +2 -2
- chia/_tests/util/test_trusted_peer.py +1 -1
- chia/_tests/util/time_out_assert.py +20 -7
- chia/_tests/wallet/cat_wallet/test_cat_lifecycle.py +1 -1
- chia/_tests/wallet/cat_wallet/test_cat_outer_puzzle.py +2 -2
- chia/_tests/wallet/cat_wallet/test_cat_wallet.py +5 -6
- chia/_tests/wallet/cat_wallet/test_offer_lifecycle.py +17 -15
- chia/_tests/wallet/cat_wallet/test_trades.py +2 -2
- chia/_tests/wallet/clawback/test_clawback_lifecycle.py +2 -2
- chia/_tests/wallet/clawback/test_clawback_metadata.py +2 -2
- chia/_tests/wallet/conftest.py +3 -3
- chia/_tests/wallet/db_wallet/test_db_graftroot.py +3 -5
- chia/_tests/wallet/db_wallet/test_dl_offers.py +2 -2
- chia/_tests/wallet/db_wallet/test_dl_wallet.py +433 -384
- chia/_tests/wallet/did_wallet/test_did.py +3 -3
- chia/_tests/wallet/nft_wallet/test_nft_1_offers.py +2 -2
- chia/_tests/wallet/nft_wallet/test_nft_bulk_mint.py +2 -2
- chia/_tests/wallet/nft_wallet/test_nft_lifecycle.py +3 -4
- chia/_tests/wallet/nft_wallet/test_nft_offers.py +1293 -703
- chia/_tests/wallet/nft_wallet/test_nft_puzzles.py +28 -30
- chia/_tests/wallet/nft_wallet/test_nft_wallet.py +2 -2
- chia/_tests/wallet/nft_wallet/test_ownership_outer_puzzle.py +2 -2
- chia/_tests/wallet/rpc/config.py +1 -1
- chia/_tests/wallet/rpc/test_dl_wallet_rpc.py +2 -2
- chia/_tests/wallet/rpc/test_wallet_rpc.py +20 -77
- chia/_tests/wallet/simple_sync/test_simple_sync_protocol.py +9 -7
- chia/_tests/wallet/sync/test_wallet_sync.py +79 -31
- chia/_tests/wallet/test_clvm_streamable.py +2 -2
- chia/_tests/wallet/test_coin_management.py +7 -7
- chia/_tests/wallet/test_coin_selection.py +20 -2
- chia/_tests/wallet/test_conditions.py +2 -2
- chia/_tests/wallet/test_debug_spend_bundle.py +2 -2
- chia/_tests/wallet/test_new_wallet_protocol.py +2 -2
- chia/_tests/wallet/test_nft_store.py +2 -2
- chia/_tests/wallet/test_notifications.py +2 -2
- chia/_tests/wallet/test_puzzle_store.py +2 -2
- chia/_tests/wallet/test_sign_coin_spends.py +2 -2
- chia/_tests/wallet/test_signer_protocol.py +3 -3
- chia/_tests/wallet/test_singleton.py +3 -11
- chia/_tests/wallet/test_singleton_lifecycle_fast.py +12 -13
- chia/_tests/wallet/test_singleton_store.py +2 -4
- chia/_tests/wallet/test_transaction_store.py +2 -2
- chia/_tests/wallet/test_util.py +2 -2
- chia/_tests/wallet/test_wallet.py +53 -49
- chia/_tests/wallet/test_wallet_action_scope.py +24 -6
- chia/_tests/wallet/test_wallet_blockchain.py +1 -1
- chia/_tests/wallet/test_wallet_coin_store.py +2 -2
- chia/_tests/wallet/test_wallet_interested_store.py +2 -2
- chia/_tests/wallet/test_wallet_node.py +3 -3
- chia/_tests/wallet/test_wallet_retry.py +3 -3
- chia/_tests/wallet/test_wallet_state_manager.py +8 -8
- chia/_tests/wallet/test_wallet_test_framework.py +1 -1
- chia/_tests/wallet/test_wallet_trade_store.py +2 -2
- chia/_tests/wallet/test_wallet_utils.py +2 -2
- chia/_tests/wallet/vc_wallet/test_cr_outer_puzzle.py +3 -2
- chia/_tests/wallet/vc_wallet/test_vc_lifecycle.py +15 -15
- chia/_tests/wallet/vc_wallet/test_vc_wallet.py +5 -3
- chia/_tests/wallet/wallet_block_tools.py +15 -7
- chia/_tests/weight_proof/test_weight_proof.py +3 -3
- chia/cmds/chia.py +0 -2
- chia/cmds/cmd_classes.py +3 -3
- chia/cmds/cmd_helpers.py +4 -4
- chia/cmds/cmds_util.py +2 -2
- chia/cmds/coin_funcs.py +3 -2
- chia/cmds/coins.py +1 -1
- chia/cmds/data.py +2 -2
- chia/cmds/data_funcs.py +3 -2
- chia/cmds/db_upgrade_func.py +2 -2
- chia/cmds/db_validate_func.py +15 -8
- chia/cmds/farm.py +2 -4
- chia/cmds/keys.py +0 -2
- chia/cmds/keys_funcs.py +1 -1
- chia/cmds/netspace_funcs.py +2 -1
- chia/cmds/param_types.py +2 -2
- chia/cmds/plotnft.py +2 -2
- chia/cmds/plotnft_funcs.py +2 -2
- chia/cmds/rpc.py +1 -1
- chia/cmds/show.py +1 -2
- chia/cmds/show_funcs.py +6 -3
- chia/cmds/signer.py +1 -2
- chia/cmds/sim.py +1 -2
- chia/cmds/sim_funcs.py +2 -2
- chia/cmds/wallet.py +2 -2
- chia/cmds/wallet_funcs.py +4 -11
- chia/consensus/block_body_validation.py +3 -4
- chia/consensus/block_creation.py +10 -6
- chia/consensus/block_header_validation.py +3 -4
- chia/consensus/block_record.py +2 -3
- chia/consensus/block_rewards.py +1 -1
- chia/consensus/blockchain.py +20 -17
- chia/consensus/blockchain_interface.py +5 -4
- chia/consensus/coinbase.py +2 -2
- chia/consensus/constants.py +1 -1
- chia/consensus/cost_calculator.py +2 -1
- chia/consensus/default_constants.py +4 -3
- chia/consensus/deficit.py +3 -2
- chia/consensus/difficulty_adjustment.py +8 -9
- chia/consensus/find_fork_point.py +4 -3
- chia/consensus/full_block_to_block_record.py +4 -3
- chia/consensus/get_block_challenge.py +4 -3
- chia/consensus/get_block_generator.py +3 -2
- chia/consensus/make_sub_epoch_summary.py +3 -2
- chia/consensus/multiprocess_validation.py +9 -4
- chia/consensus/pos_quality.py +1 -1
- chia/consensus/pot_iterations.py +4 -3
- chia/consensus/vdf_info_computation.py +4 -3
- chia/daemon/client.py +1 -1
- chia/daemon/keychain_server.py +1 -1
- chia/daemon/server.py +1 -1
- chia/daemon/windows_signal.py +1 -1
- chia/data_layer/data_layer.py +4 -3
- chia/data_layer/data_layer_errors.py +1 -1
- chia/data_layer/data_layer_util.py +2 -2
- chia/data_layer/data_layer_wallet.py +47 -69
- chia/data_layer/data_store.py +1 -1
- chia/data_layer/dl_wallet_store.py +5 -6
- chia/data_layer/download_data.py +1 -1
- chia/data_layer/s3_plugin_service.py +4 -4
- chia/data_layer/singleton_record.py +23 -0
- chia/data_layer/util/benchmark.py +2 -1
- chia/farmer/farmer.py +4 -6
- chia/farmer/farmer_api.py +4 -6
- chia/full_node/bitcoin_fee_estimator.py +2 -1
- chia/full_node/block_height_map.py +2 -2
- chia/full_node/block_store.py +8 -9
- chia/{util → full_node}/check_fork_next_block.py +2 -1
- chia/full_node/coin_store.py +10 -10
- chia/full_node/fee_estimate.py +2 -1
- chia/full_node/fee_estimation.py +2 -1
- chia/full_node/fee_estimator.py +2 -1
- chia/full_node/fee_estimator_interface.py +1 -1
- chia/full_node/fee_history.py +2 -1
- chia/full_node/fee_tracker.py +2 -1
- chia/full_node/full_node.py +15 -13
- chia/full_node/full_node_api.py +12 -32
- chia/full_node/full_node_store.py +4 -3
- chia/full_node/hint_management.py +2 -1
- chia/full_node/hint_store.py +3 -3
- chia/full_node/mempool.py +80 -12
- chia/full_node/mempool_check_conditions.py +6 -7
- chia/full_node/mempool_manager.py +168 -21
- chia/full_node/pending_tx_cache.py +2 -2
- chia/full_node/subscriptions.py +2 -2
- chia/full_node/sync_store.py +2 -3
- chia/full_node/tx_processing_queue.py +2 -1
- chia/full_node/weight_proof.py +5 -8
- chia/harvester/harvester.py +5 -3
- chia/harvester/harvester_api.py +2 -2
- chia/introducer/introducer.py +30 -2
- chia/introducer/introducer_api.py +9 -1
- chia/legacy/keyring.py +1 -2
- chia/plot_sync/exceptions.py +2 -1
- chia/plot_sync/receiver.py +2 -2
- chia/plot_sync/sender.py +1 -1
- chia/plotting/cache.py +2 -2
- chia/plotting/check_plots.py +4 -2
- chia/plotting/create_plots.py +1 -1
- chia/plotting/manager.py +3 -3
- chia/plotting/util.py +2 -2
- chia/pools/pool_config.py +1 -1
- chia/pools/pool_puzzles.py +23 -17
- chia/pools/pool_wallet.py +22 -9
- chia/pools/pool_wallet_info.py +2 -2
- chia/protocols/farmer_protocol.py +3 -6
- chia/protocols/full_node_protocol.py +3 -2
- chia/protocols/harvester_protocol.py +3 -4
- chia/protocols/pool_protocol.py +2 -2
- chia/protocols/shared_protocol.py +2 -1
- chia/protocols/timelord_protocol.py +4 -4
- chia/protocols/wallet_protocol.py +2 -2
- chia/rpc/data_layer_rpc_api.py +3 -4
- chia/rpc/data_layer_rpc_client.py +3 -2
- chia/rpc/farmer_rpc_api.py +2 -2
- chia/rpc/farmer_rpc_client.py +2 -1
- chia/rpc/full_node_rpc_api.py +3 -2
- chia/rpc/full_node_rpc_client.py +3 -2
- chia/rpc/harvester_rpc_api.py +2 -1
- chia/rpc/rpc_client.py +2 -2
- chia/rpc/rpc_server.py +1 -1
- chia/rpc/wallet_request_types.py +2 -62
- chia/rpc/wallet_rpc_api.py +98 -628
- chia/rpc/wallet_rpc_client.py +5 -253
- chia/seeder/crawl_store.py +1 -1
- chia/seeder/crawler.py +2 -2
- chia/seeder/peer_record.py +2 -1
- chia/seeder/start_crawler.py +3 -1
- chia/server/address_manager.py +2 -1
- chia/server/address_manager_store.py +1 -1
- chia/server/capabilities.py +2 -1
- chia/server/introducer_peers.py +2 -1
- chia/server/node_discovery.py +1 -1
- chia/server/outbound_message.py +2 -1
- chia/server/server.py +2 -2
- chia/server/start_data_layer.py +2 -1
- chia/server/start_farmer.py +3 -1
- chia/server/start_full_node.py +4 -2
- chia/server/start_harvester.py +3 -1
- chia/server/start_introducer.py +12 -1
- chia/server/start_service.py +2 -1
- chia/server/start_timelord.py +3 -1
- chia/server/start_wallet.py +3 -1
- chia/server/upnp.py +1 -2
- chia/server/ws_connection.py +3 -4
- chia/simulator/add_blocks_in_batches.py +5 -3
- chia/simulator/block_tools.py +16 -12
- chia/simulator/full_node_simulator.py +9 -14
- chia/simulator/setup_services.py +5 -3
- chia/simulator/simulator_full_node_rpc_api.py +3 -2
- chia/simulator/simulator_full_node_rpc_client.py +3 -2
- chia/simulator/simulator_protocol.py +3 -2
- chia/simulator/simulator_test_tools.py +2 -2
- chia/simulator/start_simulator.py +3 -2
- chia/simulator/wallet_tools.py +3 -4
- chia/timelord/iters_from_block.py +4 -4
- chia/timelord/timelord.py +7 -12
- chia/timelord/timelord_api.py +3 -3
- chia/timelord/timelord_state.py +4 -3
- chia/types/block_protocol.py +2 -2
- chia/types/blockchain_format/coin.py +2 -2
- chia/types/blockchain_format/program.py +1 -1
- chia/types/blockchain_format/proof_of_space.py +3 -4
- chia/types/blockchain_format/tree_hash.py +1 -1
- chia/types/blockchain_format/vdf.py +3 -4
- chia/types/clvm_cost.py +1 -1
- chia/types/coin_record.py +4 -3
- chia/types/coin_spend.py +1 -1
- chia/types/eligible_coin_spends.py +9 -5
- chia/types/fee_rate.py +1 -1
- chia/types/generator_types.py +3 -3
- chia/types/internal_mempool_item.py +3 -2
- chia/types/mempool_item.py +10 -3
- chia/types/mempool_submission_status.py +2 -1
- chia/types/mojos.py +1 -1
- chia/types/peer_info.py +2 -1
- chia/types/transaction_queue_entry.py +2 -1
- chia/types/unfinished_header_block.py +4 -4
- chia/types/validation_state.py +2 -1
- chia/types/weight_proof.py +1 -9
- chia/util/augmented_chain.py +20 -9
- chia/util/block_cache.py +8 -4
- chia/util/condition_tools.py +2 -2
- chia/util/full_block_utils.py +3 -4
- chia/util/generator_tools.py +2 -2
- chia/util/initial-config.yaml +2 -11
- chia/util/network.py +2 -2
- chia/util/prev_transaction_block.py +2 -1
- chia/util/task_timing.py +1 -1
- chia/util/vdf_prover.py +3 -3
- chia/util/ws_message.py +1 -1
- chia/wallet/cat_wallet/cat_info.py +3 -2
- chia/wallet/cat_wallet/cat_outer_puzzle.py +3 -2
- chia/wallet/cat_wallet/cat_utils.py +6 -4
- chia/wallet/cat_wallet/cat_wallet.py +16 -18
- chia/wallet/cat_wallet/lineage_store.py +2 -1
- chia/wallet/coin_selection.py +5 -5
- chia/wallet/conditions.py +22 -16
- chia/wallet/db_wallet/db_wallet_puzzles.py +15 -15
- chia/wallet/derivation_record.py +2 -2
- chia/wallet/derive_keys.py +2 -2
- chia/wallet/did_wallet/did_info.py +3 -2
- chia/wallet/did_wallet/did_wallet.py +41 -19
- chia/wallet/did_wallet/did_wallet_puzzles.py +18 -12
- chia/wallet/driver_protocol.py +1 -1
- chia/wallet/lineage_proof.py +3 -2
- chia/wallet/nft_wallet/metadata_outer_puzzle.py +6 -7
- chia/wallet/nft_wallet/nft_info.py +5 -5
- chia/wallet/nft_wallet/nft_puzzle_utils.py +293 -0
- chia/wallet/nft_wallet/nft_puzzles.py +21 -298
- chia/wallet/nft_wallet/nft_wallet.py +47 -62
- chia/wallet/nft_wallet/ownership_outer_puzzle.py +4 -8
- chia/wallet/nft_wallet/singleton_outer_puzzle.py +3 -2
- chia/wallet/nft_wallet/transfer_program_puzzle.py +6 -10
- chia/wallet/nft_wallet/uncurry_nft.py +6 -8
- chia/wallet/notification_manager.py +5 -5
- chia/wallet/notification_store.py +3 -2
- chia/wallet/outer_puzzles.py +2 -1
- chia/wallet/puzzles/clawback/drivers.py +21 -8
- chia/wallet/puzzles/clawback/metadata.py +3 -2
- chia/wallet/puzzles/clawback/puzzle_decorator.py +5 -4
- chia/wallet/puzzles/deployed_puzzle_hashes.json +0 -10
- chia/wallet/puzzles/p2_conditions.py +3 -2
- chia/wallet/puzzles/p2_delegated_conditions.py +3 -2
- chia/wallet/puzzles/p2_delegated_puzzle.py +3 -2
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py +3 -3
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.py +3 -2
- chia/wallet/puzzles/p2_puzzle_hash.py +4 -3
- chia/wallet/puzzles/puzzle_utils.py +3 -2
- chia/wallet/puzzles/singleton_top_layer.py +26 -10
- chia/wallet/puzzles/singleton_top_layer_v1_1.py +21 -9
- chia/wallet/puzzles/tails.py +21 -129
- chia/wallet/signer_protocol.py +3 -2
- chia/wallet/singleton.py +12 -6
- chia/wallet/singleton_record.py +3 -2
- chia/wallet/trade_manager.py +31 -55
- chia/wallet/trade_record.py +3 -2
- chia/wallet/trading/offer.py +14 -13
- chia/wallet/trading/trade_store.py +3 -4
- chia/wallet/transaction_record.py +2 -2
- chia/wallet/util/blind_signer_tl.py +3 -2
- chia/wallet/util/compute_hints.py +3 -2
- chia/wallet/util/compute_memos.py +2 -2
- chia/wallet/util/curry_and_treehash.py +1 -2
- chia/wallet/util/merkle_tree.py +1 -1
- chia/wallet/util/merkle_utils.py +1 -1
- chia/wallet/util/new_peak_queue.py +2 -1
- chia/wallet/util/notifications.py +5 -4
- chia/wallet/util/peer_request_cache.py +3 -2
- chia/wallet/util/puzzle_compression.py +6 -4
- chia/wallet/util/puzzle_decorator.py +6 -4
- chia/wallet/util/query_filter.py +3 -2
- chia/wallet/util/tx_config.py +3 -3
- chia/wallet/util/wallet_sync_utils.py +2 -2
- chia/wallet/util/wallet_types.py +2 -3
- chia/wallet/vc_wallet/cr_cat_drivers.py +18 -22
- chia/wallet/vc_wallet/cr_cat_wallet.py +14 -10
- chia/wallet/vc_wallet/cr_outer_puzzle.py +2 -2
- chia/wallet/vc_wallet/vc_drivers.py +50 -68
- chia/wallet/vc_wallet/vc_store.py +2 -2
- chia/wallet/vc_wallet/vc_wallet.py +47 -15
- chia/wallet/wallet.py +51 -46
- chia/wallet/wallet_action_scope.py +4 -0
- chia/wallet/wallet_blockchain.py +12 -7
- chia/wallet/wallet_coin_record.py +3 -2
- chia/wallet/wallet_coin_store.py +3 -2
- chia/wallet/wallet_info.py +2 -1
- chia/wallet/wallet_interested_store.py +3 -2
- chia/wallet/wallet_nft_store.py +4 -4
- chia/wallet/wallet_node.py +3 -4
- chia/wallet/wallet_pool_store.py +3 -4
- chia/wallet/wallet_protocol.py +19 -5
- chia/wallet/wallet_puzzle_store.py +2 -2
- chia/wallet/wallet_retry_store.py +3 -6
- chia/wallet/wallet_singleton_store.py +2 -2
- chia/wallet/wallet_state_manager.py +20 -197
- chia/wallet/wallet_transaction_store.py +2 -2
- chia/wallet/wallet_user_store.py +2 -1
- chia/wallet/wallet_weight_proof_handler.py +3 -2
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3.dist-info}/METADATA +3 -2
- chia_blockchain-2.5.3.dist-info/RECORD +891 -0
- mozilla-ca/cacert.pem +64 -33
- chia/_tests/clvm/test_condition_codes.py +0 -13
- chia/_tests/cmds/wallet/test_dao.py +0 -565
- chia/_tests/wallet/dao_wallet/__init__.py +0 -0
- chia/_tests/wallet/dao_wallet/config.py +0 -3
- chia/_tests/wallet/dao_wallet/test_dao_clvm.py +0 -1330
- chia/_tests/wallet/dao_wallet/test_dao_wallets.py +0 -3488
- chia/cmds/dao.py +0 -1064
- chia/cmds/dao_funcs.py +0 -598
- chia/consensus/puzzles/__init__.py +0 -0
- chia/consensus/puzzles/chialisp_deserialisation.clsp +0 -69
- chia/consensus/puzzles/chialisp_deserialisation.clsp.hex +0 -1
- chia/consensus/puzzles/rom_bootstrap_generator.clsp +0 -37
- chia/consensus/puzzles/rom_bootstrap_generator.clsp.hex +0 -1
- chia/full_node/puzzles/__init__.py +0 -0
- chia/full_node/puzzles/block_program_zero.clsp +0 -14
- chia/full_node/puzzles/block_program_zero.clsp.hex +0 -1
- chia/full_node/puzzles/decompress_coin_spend_entry.clsp +0 -5
- chia/full_node/puzzles/decompress_coin_spend_entry.clsp.hex +0 -1
- chia/full_node/puzzles/decompress_coin_spend_entry_with_prefix.clsp +0 -7
- chia/full_node/puzzles/decompress_coin_spend_entry_with_prefix.clsp.hex +0 -1
- chia/full_node/puzzles/decompress_puzzle.clsp +0 -6
- chia/full_node/puzzles/decompress_puzzle.clsp.hex +0 -1
- chia/pools/puzzles/__init__.py +0 -0
- chia/pools/puzzles/pool_member_innerpuz.clsp +0 -70
- chia/pools/puzzles/pool_member_innerpuz.clsp.hex +0 -1
- chia/pools/puzzles/pool_waitingroom_innerpuz.clsp +0 -69
- chia/pools/puzzles/pool_waitingroom_innerpuz.clsp.hex +0 -1
- chia/simulator/simulator_constants.py +0 -13
- chia/types/blockchain_format/foliage.py +0 -8
- chia/types/blockchain_format/pool_target.py +0 -5
- chia/types/blockchain_format/reward_chain_block.py +0 -6
- chia/types/blockchain_format/sized_bytes.py +0 -11
- chia/util/ints.py +0 -19
- chia/wallet/cat_wallet/dao_cat_info.py +0 -28
- chia/wallet/cat_wallet/dao_cat_wallet.py +0 -669
- chia/wallet/cat_wallet/puzzles/__init__.py +0 -0
- chia/wallet/cat_wallet/puzzles/cat_truths.clib +0 -31
- chia/wallet/cat_wallet/puzzles/cat_v2.clsp +0 -397
- chia/wallet/cat_wallet/puzzles/cat_v2.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/delegated_tail.clsp +0 -25
- chia/wallet/cat_wallet/puzzles/delegated_tail.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/everything_with_signature.clsp +0 -15
- chia/wallet/cat_wallet/puzzles/everything_with_signature.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id.clsp +0 -26
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id_or_singleton.clsp +0 -42
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id_or_singleton.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/genesis_by_puzzle_hash.clsp +0 -24
- chia/wallet/cat_wallet/puzzles/genesis_by_puzzle_hash.clsp.hex +0 -1
- chia/wallet/dao_wallet/__init__.py +0 -0
- chia/wallet/dao_wallet/dao_info.py +0 -61
- chia/wallet/dao_wallet/dao_utils.py +0 -811
- chia/wallet/dao_wallet/dao_wallet.py +0 -2119
- chia/wallet/did_wallet/puzzles/__init__.py +0 -0
- chia/wallet/did_wallet/puzzles/did_innerpuz.clsp +0 -135
- chia/wallet/did_wallet/puzzles/did_innerpuz.clsp.hex +0 -1
- chia/wallet/payment.py +0 -33
- chia/wallet/puzzles/augmented_condition.clsp +0 -13
- chia/wallet/puzzles/augmented_condition.clsp.hex +0 -1
- chia/wallet/puzzles/condition_codes.clib +0 -77
- chia/wallet/puzzles/curry-and-treehash.clib +0 -102
- chia/wallet/puzzles/curry.clib +0 -135
- chia/wallet/puzzles/curry_by_index.clib +0 -16
- chia/wallet/puzzles/dao_cat_eve.clsp +0 -17
- chia/wallet/puzzles/dao_cat_eve.clsp.hex +0 -1
- chia/wallet/puzzles/dao_cat_launcher.clsp +0 -36
- chia/wallet/puzzles/dao_cat_launcher.clsp.hex +0 -1
- chia/wallet/puzzles/dao_finished_state.clsp +0 -35
- chia/wallet/puzzles/dao_finished_state.clsp.hex +0 -1
- chia/wallet/puzzles/dao_finished_state.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_lockup.clsp +0 -288
- chia/wallet/puzzles/dao_lockup.clsp.hex +0 -1
- chia/wallet/puzzles/dao_lockup.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_proposal.clsp +0 -377
- chia/wallet/puzzles/dao_proposal.clsp.hex +0 -1
- chia/wallet/puzzles/dao_proposal.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_proposal_timer.clsp +0 -78
- chia/wallet/puzzles/dao_proposal_timer.clsp.hex +0 -1
- chia/wallet/puzzles/dao_proposal_timer.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_proposal_validator.clsp +0 -87
- chia/wallet/puzzles/dao_proposal_validator.clsp.hex +0 -1
- chia/wallet/puzzles/dao_proposal_validator.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp +0 -240
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp.hex +0 -1
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_treasury.clsp +0 -115
- chia/wallet/puzzles/dao_treasury.clsp.hex +0 -1
- chia/wallet/puzzles/dao_update_proposal.clsp +0 -44
- chia/wallet/puzzles/dao_update_proposal.clsp.hex +0 -1
- chia/wallet/puzzles/json.clib +0 -25
- chia/wallet/puzzles/merkle_utils.clib +0 -18
- chia/wallet/puzzles/notification.clsp +0 -7
- chia/wallet/puzzles/notification.clsp.hex +0 -1
- chia/wallet/puzzles/p2_1_of_n.clsp +0 -22
- chia/wallet/puzzles/p2_1_of_n.clsp.hex +0 -1
- chia/wallet/puzzles/p2_conditions.clsp +0 -3
- chia/wallet/puzzles/p2_conditions.clsp.hex +0 -1
- chia/wallet/puzzles/p2_delegated_conditions.clsp +0 -18
- chia/wallet/puzzles/p2_delegated_conditions.clsp.hex +0 -1
- chia/wallet/puzzles/p2_delegated_puzzle.clsp +0 -19
- chia/wallet/puzzles/p2_delegated_puzzle.clsp.hex +0 -1
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clsp +0 -91
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clsp.hex +0 -1
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.clsp +0 -108
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.clsp.hex +0 -1
- chia/wallet/puzzles/p2_parent.clsp +0 -19
- chia/wallet/puzzles/p2_parent.clsp.hex +0 -1
- chia/wallet/puzzles/p2_puzzle_hash.clsp +0 -18
- chia/wallet/puzzles/p2_puzzle_hash.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton.clsp +0 -30
- chia/wallet/puzzles/p2_singleton.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton_aggregator.clsp +0 -81
- chia/wallet/puzzles/p2_singleton_aggregator.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clsp +0 -50
- chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton_via_delegated_puzzle.clsp +0 -47
- chia/wallet/puzzles/p2_singleton_via_delegated_puzzle.clsp.hex +0 -1
- chia/wallet/puzzles/settlement_payments.clsp +0 -49
- chia/wallet/puzzles/settlement_payments.clsp.hex +0 -1
- chia/wallet/puzzles/sha256tree.clib +0 -11
- chia/wallet/puzzles/singleton_launcher.clsp +0 -16
- chia/wallet/puzzles/singleton_launcher.clsp.hex +0 -1
- chia/wallet/puzzles/singleton_top_layer.clsp +0 -177
- chia/wallet/puzzles/singleton_top_layer.clsp.hex +0 -1
- chia/wallet/puzzles/singleton_top_layer_v1_1.clsp +0 -107
- chia/wallet/puzzles/singleton_top_layer_v1_1.clsp.hex +0 -1
- chia/wallet/puzzles/singleton_truths.clib +0 -21
- chia/wallet/vc_wallet/cr_puzzles/__init__.py +0 -0
- chia/wallet/vc_wallet/cr_puzzles/conditions_w_fee_announce.clsp +0 -3
- chia/wallet/vc_wallet/cr_puzzles/conditions_w_fee_announce.clsp.hex +0 -1
- chia/wallet/vc_wallet/cr_puzzles/credential_restriction.clsp +0 -304
- chia/wallet/vc_wallet/cr_puzzles/credential_restriction.clsp.hex +0 -1
- chia/wallet/vc_wallet/cr_puzzles/flag_proofs_checker.clsp +0 -45
- chia/wallet/vc_wallet/cr_puzzles/flag_proofs_checker.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/__init__.py +0 -0
- chia/wallet/vc_wallet/vc_puzzles/covenant_layer.clsp +0 -30
- chia/wallet/vc_wallet/vc_puzzles/covenant_layer.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/eml_covenant_morpher.clsp +0 -75
- chia/wallet/vc_wallet/vc_puzzles/eml_covenant_morpher.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/eml_transfer_program_covenant_adapter.clsp +0 -32
- chia/wallet/vc_wallet/vc_puzzles/eml_transfer_program_covenant_adapter.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/eml_update_metadata_with_DID.clsp +0 -80
- chia/wallet/vc_wallet/vc_puzzles/eml_update_metadata_with_DID.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/exigent_metadata_layer.clsp +0 -163
- chia/wallet/vc_wallet/vc_puzzles/exigent_metadata_layer.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/p2_announced_delegated_puzzle.clsp +0 -16
- chia/wallet/vc_wallet/vc_puzzles/p2_announced_delegated_puzzle.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/standard_vc_backdoor_puzzle.clsp +0 -74
- chia/wallet/vc_wallet/vc_puzzles/standard_vc_backdoor_puzzle.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/std_parent_morpher.clsp +0 -23
- chia/wallet/vc_wallet/vc_puzzles/std_parent_morpher.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/viral_backdoor.clsp +0 -64
- chia/wallet/vc_wallet/vc_puzzles/viral_backdoor.clsp.hex +0 -1
- chia_blockchain-2.5.2rc2.dist-info/RECORD +0 -1042
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3.dist-info}/LICENSE +0 -0
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3.dist-info}/WHEEL +0 -0
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3.dist-info}/entry_points.txt +0 -0
chia/rpc/wallet_rpc_api.py
CHANGED
|
@@ -3,11 +3,12 @@ from __future__ import annotations
|
|
|
3
3
|
import dataclasses
|
|
4
4
|
import json
|
|
5
5
|
import logging
|
|
6
|
-
import zlib
|
|
7
6
|
from pathlib import Path
|
|
8
7
|
from typing import TYPE_CHECKING, Any, Callable, ClassVar, Optional, Union, cast
|
|
9
8
|
|
|
10
9
|
from chia_rs import AugSchemeMPL, Coin, G1Element, G2Element, PrivateKey
|
|
10
|
+
from chia_rs.sized_bytes import bytes32
|
|
11
|
+
from chia_rs.sized_ints import uint8, uint16, uint32, uint64
|
|
11
12
|
from clvm_tools.binutils import assemble
|
|
12
13
|
|
|
13
14
|
from chia.consensus.block_rewards import calculate_base_farmer_reward
|
|
@@ -77,7 +78,6 @@ from chia.server.outbound_message import NodeType
|
|
|
77
78
|
from chia.server.ws_connection import WSChiaConnection
|
|
78
79
|
from chia.types.blockchain_format.coin import coin_as_list
|
|
79
80
|
from chia.types.blockchain_format.program import INFINITE_COST, Program
|
|
80
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
81
81
|
from chia.types.coin_record import CoinRecord
|
|
82
82
|
from chia.types.coin_spend import CoinSpend
|
|
83
83
|
from chia.types.signing_mode import CHIP_0002_SIGN_MESSAGE_PREFIX, SigningMode
|
|
@@ -86,7 +86,6 @@ from chia.util.byte_types import hexstr_to_bytes
|
|
|
86
86
|
from chia.util.config import load_config, str2bool
|
|
87
87
|
from chia.util.errors import KeychainIsLocked
|
|
88
88
|
from chia.util.hash import std_hash
|
|
89
|
-
from chia.util.ints import uint8, uint16, uint32, uint64
|
|
90
89
|
from chia.util.keychain import bytes_to_mnemonic, generate_mnemonic
|
|
91
90
|
from chia.util.path import path_from_root
|
|
92
91
|
from chia.util.streamable import Streamable, UInt32Range, streamable
|
|
@@ -94,27 +93,18 @@ from chia.util.ws_message import WsRpcMessage, create_payload_dict
|
|
|
94
93
|
from chia.wallet.cat_wallet.cat_constants import DEFAULT_CATS
|
|
95
94
|
from chia.wallet.cat_wallet.cat_info import CRCATInfo
|
|
96
95
|
from chia.wallet.cat_wallet.cat_wallet import CATWallet
|
|
97
|
-
from chia.wallet.cat_wallet.dao_cat_info import LockedCoinInfo
|
|
98
|
-
from chia.wallet.cat_wallet.dao_cat_wallet import DAOCATWallet
|
|
99
96
|
from chia.wallet.conditions import (
|
|
100
97
|
AssertCoinAnnouncement,
|
|
101
98
|
AssertPuzzleAnnouncement,
|
|
102
99
|
Condition,
|
|
103
100
|
ConditionValidTimes,
|
|
101
|
+
CreateCoin,
|
|
104
102
|
CreateCoinAnnouncement,
|
|
105
103
|
CreatePuzzleAnnouncement,
|
|
106
104
|
conditions_from_json_dicts,
|
|
107
105
|
parse_conditions_non_consensus,
|
|
108
106
|
parse_timelock_info,
|
|
109
107
|
)
|
|
110
|
-
from chia.wallet.dao_wallet.dao_info import DAORules
|
|
111
|
-
from chia.wallet.dao_wallet.dao_utils import (
|
|
112
|
-
generate_mint_proposal_innerpuz,
|
|
113
|
-
generate_simple_proposal_innerpuz,
|
|
114
|
-
generate_update_proposal_innerpuz,
|
|
115
|
-
get_treasury_rules_from_puzzle,
|
|
116
|
-
)
|
|
117
|
-
from chia.wallet.dao_wallet.dao_wallet import DAOWallet
|
|
118
108
|
from chia.wallet.derive_keys import (
|
|
119
109
|
MAX_POOL_WALLETS,
|
|
120
110
|
master_sk_to_farmer_sk,
|
|
@@ -131,14 +121,13 @@ from chia.wallet.did_wallet.did_wallet_puzzles import (
|
|
|
131
121
|
match_did_puzzle,
|
|
132
122
|
metadata_to_program,
|
|
133
123
|
)
|
|
134
|
-
from chia.wallet.nft_wallet import
|
|
124
|
+
from chia.wallet.nft_wallet import nft_puzzle_utils
|
|
135
125
|
from chia.wallet.nft_wallet.nft_info import NFTCoinInfo, NFTInfo
|
|
136
|
-
from chia.wallet.nft_wallet.
|
|
126
|
+
from chia.wallet.nft_wallet.nft_puzzle_utils import get_metadata_and_phs
|
|
137
127
|
from chia.wallet.nft_wallet.nft_wallet import NFTWallet
|
|
138
128
|
from chia.wallet.nft_wallet.uncurry_nft import UncurriedNFT
|
|
139
129
|
from chia.wallet.notification_store import Notification
|
|
140
130
|
from chia.wallet.outer_puzzles import AssetType
|
|
141
|
-
from chia.wallet.payment import Payment
|
|
142
131
|
from chia.wallet.puzzle_drivers import PuzzleInfo, Solver
|
|
143
132
|
from chia.wallet.puzzles import p2_delegated_conditions
|
|
144
133
|
from chia.wallet.puzzles.clawback.metadata import AutoClaimSettings, ClawbackMetadata
|
|
@@ -473,21 +462,6 @@ class WalletRpcApi:
|
|
|
473
462
|
"/did_message_spend": self.did_message_spend,
|
|
474
463
|
"/did_get_info": self.did_get_info,
|
|
475
464
|
"/did_find_lost_did": self.did_find_lost_did,
|
|
476
|
-
# DAO Wallets
|
|
477
|
-
"/dao_get_proposals": self.dao_get_proposals,
|
|
478
|
-
"/dao_create_proposal": self.dao_create_proposal,
|
|
479
|
-
"/dao_parse_proposal": self.dao_parse_proposal,
|
|
480
|
-
"/dao_vote_on_proposal": self.dao_vote_on_proposal,
|
|
481
|
-
"/dao_get_treasury_balance": self.dao_get_treasury_balance,
|
|
482
|
-
"/dao_get_treasury_id": self.dao_get_treasury_id,
|
|
483
|
-
"/dao_get_rules": self.dao_get_rules,
|
|
484
|
-
"/dao_close_proposal": self.dao_close_proposal,
|
|
485
|
-
"/dao_exit_lockup": self.dao_exit_lockup,
|
|
486
|
-
"/dao_adjust_filter_level": self.dao_adjust_filter_level,
|
|
487
|
-
"/dao_add_funds_to_treasury": self.dao_add_funds_to_treasury,
|
|
488
|
-
"/dao_send_to_lockup": self.dao_send_to_lockup,
|
|
489
|
-
"/dao_get_proposal_state": self.dao_get_proposal_state,
|
|
490
|
-
"/dao_free_coins_from_finished_proposals": self.dao_free_coins_from_finished_proposals,
|
|
491
465
|
# NFT Wallet
|
|
492
466
|
"/nft_mint_nft": self.nft_mint_nft,
|
|
493
467
|
"/nft_count_nfts": self.nft_count_nfts,
|
|
@@ -1103,48 +1077,6 @@ class WalletRpcApi:
|
|
|
1103
1077
|
}
|
|
1104
1078
|
else: # undefined did_type
|
|
1105
1079
|
pass
|
|
1106
|
-
elif request["wallet_type"] == "dao_wallet":
|
|
1107
|
-
name = request.get("name", None)
|
|
1108
|
-
mode = request.get("mode", None)
|
|
1109
|
-
if mode == "new":
|
|
1110
|
-
dao_rules_json = request.get("dao_rules", None)
|
|
1111
|
-
if dao_rules_json:
|
|
1112
|
-
dao_rules = DAORules.from_json_dict(dao_rules_json)
|
|
1113
|
-
else:
|
|
1114
|
-
raise ValueError("DAO rules must be specified for wallet creation")
|
|
1115
|
-
async with self.service.wallet_state_manager.lock:
|
|
1116
|
-
dao_wallet = await DAOWallet.create_new_dao_and_wallet(
|
|
1117
|
-
wallet_state_manager,
|
|
1118
|
-
main_wallet,
|
|
1119
|
-
uint64(request.get("amount_of_cats", None)),
|
|
1120
|
-
dao_rules,
|
|
1121
|
-
action_scope,
|
|
1122
|
-
uint64(request.get("filter_amount", 1)),
|
|
1123
|
-
name,
|
|
1124
|
-
uint64(request.get("fee", 0)),
|
|
1125
|
-
uint64(request.get("fee_for_cat", 0)),
|
|
1126
|
-
)
|
|
1127
|
-
elif mode == "existing":
|
|
1128
|
-
# async with self.service.wallet_state_manager.lock:
|
|
1129
|
-
dao_wallet = await DAOWallet.create_new_dao_wallet_for_existing_dao(
|
|
1130
|
-
wallet_state_manager,
|
|
1131
|
-
main_wallet,
|
|
1132
|
-
bytes32.from_hexstr(request.get("treasury_id", None)),
|
|
1133
|
-
uint64(request.get("filter_amount", 1)),
|
|
1134
|
-
name,
|
|
1135
|
-
)
|
|
1136
|
-
else:
|
|
1137
|
-
raise Exception(f"Invalid DAO wallet mode: {mode!r}")
|
|
1138
|
-
|
|
1139
|
-
return {
|
|
1140
|
-
"success": True,
|
|
1141
|
-
"type": dao_wallet.type(),
|
|
1142
|
-
"wallet_id": dao_wallet.id(),
|
|
1143
|
-
"treasury_id": dao_wallet.dao_info.treasury_id,
|
|
1144
|
-
"cat_wallet_id": dao_wallet.dao_info.cat_wallet_id,
|
|
1145
|
-
"dao_cat_wallet_id": dao_wallet.dao_info.dao_cat_wallet_id,
|
|
1146
|
-
"transactions": None, # tx_endpoint wrapper will take care of this
|
|
1147
|
-
}
|
|
1148
1080
|
elif request["wallet_type"] == "nft_wallet":
|
|
1149
1081
|
for wallet in self.service.wallet_state_manager.wallets.values():
|
|
1150
1082
|
did_id: Optional[bytes32] = None
|
|
@@ -1341,7 +1273,7 @@ class WalletRpcApi:
|
|
|
1341
1273
|
raise ValueError("Cannot split coins from non-fungible wallet types")
|
|
1342
1274
|
|
|
1343
1275
|
outputs = [
|
|
1344
|
-
|
|
1276
|
+
CreateCoin(
|
|
1345
1277
|
await wallet.get_puzzle_hash(new=True)
|
|
1346
1278
|
if isinstance(wallet, Wallet)
|
|
1347
1279
|
else await wallet.standard_wallet.get_puzzle_hash(new=True),
|
|
@@ -1352,38 +1284,25 @@ class WalletRpcApi:
|
|
|
1352
1284
|
if len(outputs) == 0:
|
|
1353
1285
|
return SplitCoinsResponse([], [])
|
|
1354
1286
|
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
interface.side_effects.selected_coins.append(coin)
|
|
1361
|
-
coins = await wallet.select_coins(
|
|
1362
|
-
uint64(total_amount + request.fee - coin.amount),
|
|
1363
|
-
action_scope,
|
|
1364
|
-
)
|
|
1365
|
-
coins.add(coin)
|
|
1366
|
-
else:
|
|
1367
|
-
coins = {coin}
|
|
1368
|
-
await wallet.generate_signed_transaction(
|
|
1369
|
-
outputs[0].amount,
|
|
1370
|
-
outputs[0].puzzle_hash,
|
|
1287
|
+
if wallet.type() == WalletType.STANDARD_WALLET and coin.amount < total_amount + request.fee:
|
|
1288
|
+
async with action_scope.use() as interface:
|
|
1289
|
+
interface.side_effects.selected_coins.append(coin)
|
|
1290
|
+
coins = await wallet.select_coins(
|
|
1291
|
+
uint64(total_amount + request.fee - coin.amount),
|
|
1371
1292
|
action_scope,
|
|
1372
|
-
request.fee,
|
|
1373
|
-
coins,
|
|
1374
|
-
outputs[1:] if len(outputs) > 1 else None,
|
|
1375
|
-
extra_conditions=extra_conditions,
|
|
1376
1293
|
)
|
|
1294
|
+
coins.add(coin)
|
|
1377
1295
|
else:
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1296
|
+
coins = {coin}
|
|
1297
|
+
|
|
1298
|
+
await wallet.generate_signed_transaction(
|
|
1299
|
+
[output.amount for output in outputs],
|
|
1300
|
+
[output.puzzle_hash for output in outputs],
|
|
1301
|
+
action_scope,
|
|
1302
|
+
request.fee,
|
|
1303
|
+
coins=coins,
|
|
1304
|
+
extra_conditions=extra_conditions,
|
|
1305
|
+
)
|
|
1387
1306
|
|
|
1388
1307
|
return SplitCoinsResponse([], []) # tx_endpoint will take care to fill this out
|
|
1389
1308
|
|
|
@@ -1469,24 +1388,18 @@ class WalletRpcApi:
|
|
|
1469
1388
|
)
|
|
1470
1389
|
if isinstance(wallet, Wallet):
|
|
1471
1390
|
primary_output_amount = uint64(primary_output_amount - request.fee)
|
|
1472
|
-
|
|
1473
|
-
primary_output_amount,
|
|
1474
|
-
await wallet.get_puzzle_hash(new=not action_scope.config.tx_config.reuse_puzhash),
|
|
1475
|
-
action_scope,
|
|
1476
|
-
request.fee,
|
|
1477
|
-
set(coins),
|
|
1478
|
-
extra_conditions=extra_conditions,
|
|
1479
|
-
)
|
|
1391
|
+
main_wallet = wallet
|
|
1480
1392
|
else:
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1393
|
+
main_wallet = wallet.standard_wallet
|
|
1394
|
+
|
|
1395
|
+
await wallet.generate_signed_transaction(
|
|
1396
|
+
[primary_output_amount],
|
|
1397
|
+
[await main_wallet.get_puzzle_hash(new=not action_scope.config.tx_config.reuse_puzhash)],
|
|
1398
|
+
action_scope,
|
|
1399
|
+
request.fee,
|
|
1400
|
+
coins=set(coins),
|
|
1401
|
+
extra_conditions=extra_conditions,
|
|
1402
|
+
)
|
|
1490
1403
|
|
|
1491
1404
|
return CombineCoinsResponse([], []) # tx_endpoint will take care to fill this out
|
|
1492
1405
|
|
|
@@ -1596,6 +1509,7 @@ class WalletRpcApi:
|
|
|
1596
1509
|
wallet_id = uint32(request["wallet_id"])
|
|
1597
1510
|
wallet = self.service.wallet_state_manager.get_wallet(id=wallet_id, required_type=Wallet)
|
|
1598
1511
|
|
|
1512
|
+
# TODO: Add support for multiple puzhash/amount/memo sets
|
|
1599
1513
|
if not isinstance(request["amount"], int) or not isinstance(request["fee"], int):
|
|
1600
1514
|
raise ValueError("An integer amount or fee is required (too many decimals)")
|
|
1601
1515
|
amount: uint64 = uint64(request["amount"])
|
|
@@ -1612,16 +1526,15 @@ class WalletRpcApi:
|
|
|
1612
1526
|
|
|
1613
1527
|
fee: uint64 = uint64(request.get("fee", 0))
|
|
1614
1528
|
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
)
|
|
1529
|
+
await wallet.generate_signed_transaction(
|
|
1530
|
+
[amount],
|
|
1531
|
+
[puzzle_hash],
|
|
1532
|
+
action_scope,
|
|
1533
|
+
fee,
|
|
1534
|
+
memos=[memos],
|
|
1535
|
+
puzzle_decorator_override=request.get("puzzle_decorator", None),
|
|
1536
|
+
extra_conditions=extra_conditions,
|
|
1537
|
+
)
|
|
1625
1538
|
|
|
1626
1539
|
# Transaction may not have been included in the mempool yet. Use get_transaction to check.
|
|
1627
1540
|
return {
|
|
@@ -2109,7 +2022,7 @@ class WalletRpcApi:
|
|
|
2109
2022
|
pubkey, signature = await selected_wallet.sign_message(request["message"], target_nft, mode)
|
|
2110
2023
|
latest_coin_id = target_nft.coin.name()
|
|
2111
2024
|
else:
|
|
2112
|
-
return {"success": False, "error": f
|
|
2025
|
+
return {"success": False, "error": f"Unknown ID type, {request['id']}"}
|
|
2113
2026
|
|
|
2114
2027
|
return {
|
|
2115
2028
|
"success": True,
|
|
@@ -2317,25 +2230,6 @@ class WalletRpcApi:
|
|
|
2317
2230
|
async def get_offer_summary(self, request: dict[str, Any]) -> EndpointResult:
|
|
2318
2231
|
offer_hex: str = request["offer"]
|
|
2319
2232
|
|
|
2320
|
-
###
|
|
2321
|
-
# This is temporary code, delete it when we no longer care about incorrectly parsing old offers
|
|
2322
|
-
# There's also temp code in test_wallet_rpc.py
|
|
2323
|
-
from chia.util.bech32m import bech32_decode, convertbits
|
|
2324
|
-
from chia.wallet.util.puzzle_compression import OFFER_MOD_OLD, decompress_object_with_puzzles
|
|
2325
|
-
|
|
2326
|
-
_hrpgot, data = bech32_decode(offer_hex, max_length=len(offer_hex))
|
|
2327
|
-
if data is None:
|
|
2328
|
-
raise ValueError("Invalid Offer")
|
|
2329
|
-
decoded = convertbits(list(data), 5, 8, False)
|
|
2330
|
-
decoded_bytes = bytes(decoded)
|
|
2331
|
-
try:
|
|
2332
|
-
decompressed_bytes = decompress_object_with_puzzles(decoded_bytes)
|
|
2333
|
-
except zlib.error:
|
|
2334
|
-
decompressed_bytes = decoded_bytes
|
|
2335
|
-
if bytes(OFFER_MOD_OLD) in decompressed_bytes:
|
|
2336
|
-
raise ValueError("Old offer format is no longer supported")
|
|
2337
|
-
###
|
|
2338
|
-
|
|
2339
2233
|
offer = Offer.from_bech32(offer_hex)
|
|
2340
2234
|
offered, requested, infos, valid_times = offer.summary()
|
|
2341
2235
|
|
|
@@ -2396,25 +2290,6 @@ class WalletRpcApi:
|
|
|
2396
2290
|
async def check_offer_validity(self, request: dict[str, Any]) -> EndpointResult:
|
|
2397
2291
|
offer_hex: str = request["offer"]
|
|
2398
2292
|
|
|
2399
|
-
###
|
|
2400
|
-
# This is temporary code, delete it when we no longer care about incorrectly parsing old offers
|
|
2401
|
-
# There's also temp code in test_wallet_rpc.py
|
|
2402
|
-
from chia.util.bech32m import bech32_decode, convertbits
|
|
2403
|
-
from chia.wallet.util.puzzle_compression import OFFER_MOD_OLD, decompress_object_with_puzzles
|
|
2404
|
-
|
|
2405
|
-
_hrpgot, data = bech32_decode(offer_hex, max_length=len(offer_hex))
|
|
2406
|
-
if data is None:
|
|
2407
|
-
raise ValueError("Invalid Offer") # pragma: no cover
|
|
2408
|
-
decoded = convertbits(list(data), 5, 8, False)
|
|
2409
|
-
decoded_bytes = bytes(decoded)
|
|
2410
|
-
try:
|
|
2411
|
-
decompressed_bytes = decompress_object_with_puzzles(decoded_bytes)
|
|
2412
|
-
except zlib.error:
|
|
2413
|
-
decompressed_bytes = decoded_bytes
|
|
2414
|
-
if bytes(OFFER_MOD_OLD) in decompressed_bytes:
|
|
2415
|
-
raise ValueError("Old offer format is no longer supported")
|
|
2416
|
-
###
|
|
2417
|
-
|
|
2418
2293
|
offer = Offer.from_bech32(offer_hex)
|
|
2419
2294
|
peer = self.service.get_full_node_peer()
|
|
2420
2295
|
return {
|
|
@@ -2431,25 +2306,6 @@ class WalletRpcApi:
|
|
|
2431
2306
|
) -> EndpointResult:
|
|
2432
2307
|
offer_hex: str = request["offer"]
|
|
2433
2308
|
|
|
2434
|
-
###
|
|
2435
|
-
# This is temporary code, delete it when we no longer care about incorrectly parsing old offers
|
|
2436
|
-
# There's also temp code in test_wallet_rpc.py
|
|
2437
|
-
from chia.util.bech32m import bech32_decode, convertbits
|
|
2438
|
-
from chia.wallet.util.puzzle_compression import OFFER_MOD_OLD, decompress_object_with_puzzles
|
|
2439
|
-
|
|
2440
|
-
_hrpgot, data = bech32_decode(offer_hex, max_length=len(offer_hex))
|
|
2441
|
-
if data is None:
|
|
2442
|
-
raise ValueError("Invalid Offer") # pragma: no cover
|
|
2443
|
-
decoded = convertbits(list(data), 5, 8, False)
|
|
2444
|
-
decoded_bytes = bytes(decoded)
|
|
2445
|
-
try:
|
|
2446
|
-
decompressed_bytes = decompress_object_with_puzzles(decoded_bytes)
|
|
2447
|
-
except zlib.error:
|
|
2448
|
-
decompressed_bytes = decoded_bytes
|
|
2449
|
-
if bytes(OFFER_MOD_OLD) in decompressed_bytes:
|
|
2450
|
-
raise ValueError("Old offer format is no longer supported")
|
|
2451
|
-
###
|
|
2452
|
-
|
|
2453
2309
|
offer = Offer.from_bech32(offer_hex)
|
|
2454
2310
|
fee: uint64 = uint64(request.get("fee", 0))
|
|
2455
2311
|
maybe_marshalled_solver: Optional[dict[str, Any]] = request.get("solver")
|
|
@@ -3140,358 +2996,6 @@ class WalletRpcApi:
|
|
|
3140
2996
|
"transaction_id": None, # tx_endpoint wrapper will take care of this
|
|
3141
2997
|
}
|
|
3142
2998
|
|
|
3143
|
-
##########################################################################################
|
|
3144
|
-
# DAO Wallet
|
|
3145
|
-
##########################################################################################
|
|
3146
|
-
|
|
3147
|
-
async def dao_adjust_filter_level(self, request: dict[str, Any]) -> EndpointResult:
|
|
3148
|
-
wallet_id = uint32(request["wallet_id"])
|
|
3149
|
-
dao_wallet = self.service.wallet_state_manager.get_wallet(id=wallet_id, required_type=DAOWallet)
|
|
3150
|
-
await dao_wallet.adjust_filter_level(uint64(request["filter_level"]))
|
|
3151
|
-
return {
|
|
3152
|
-
"success": True,
|
|
3153
|
-
"dao_info": dao_wallet.dao_info,
|
|
3154
|
-
}
|
|
3155
|
-
|
|
3156
|
-
@tx_endpoint(push=True)
|
|
3157
|
-
async def dao_add_funds_to_treasury(
|
|
3158
|
-
self,
|
|
3159
|
-
request: dict[str, Any],
|
|
3160
|
-
action_scope: WalletActionScope,
|
|
3161
|
-
extra_conditions: tuple[Condition, ...] = tuple(),
|
|
3162
|
-
) -> EndpointResult:
|
|
3163
|
-
wallet_id = uint32(request["wallet_id"])
|
|
3164
|
-
dao_wallet = self.service.wallet_state_manager.get_wallet(id=wallet_id, required_type=DAOWallet)
|
|
3165
|
-
funding_wallet_id = uint32(request["funding_wallet_id"])
|
|
3166
|
-
wallet_type = self.service.wallet_state_manager.wallets[funding_wallet_id].type()
|
|
3167
|
-
amount = request.get("amount")
|
|
3168
|
-
assert amount
|
|
3169
|
-
if wallet_type not in {WalletType.STANDARD_WALLET, WalletType.CAT}: # pragma: no cover
|
|
3170
|
-
raise ValueError(f"Cannot fund a treasury with assets from a {wallet_type.name} wallet")
|
|
3171
|
-
await dao_wallet.create_add_funds_to_treasury_spend(
|
|
3172
|
-
uint64(amount),
|
|
3173
|
-
action_scope,
|
|
3174
|
-
fee=uint64(request.get("fee", 0)),
|
|
3175
|
-
funding_wallet_id=funding_wallet_id,
|
|
3176
|
-
extra_conditions=extra_conditions,
|
|
3177
|
-
)
|
|
3178
|
-
return {
|
|
3179
|
-
"success": True,
|
|
3180
|
-
"tx_id": None, # tx_endpoint wrapper will take care of this
|
|
3181
|
-
"tx": None, # tx_endpoint wrapper will take care of this
|
|
3182
|
-
"transactions": None, # tx_endpoint wrapper will take care of this
|
|
3183
|
-
}
|
|
3184
|
-
|
|
3185
|
-
async def dao_get_treasury_balance(self, request: dict[str, Any]) -> EndpointResult:
|
|
3186
|
-
wallet_id = uint32(request["wallet_id"])
|
|
3187
|
-
dao_wallet = self.service.wallet_state_manager.get_wallet(id=wallet_id, required_type=DAOWallet)
|
|
3188
|
-
assert dao_wallet is not None
|
|
3189
|
-
asset_list = dao_wallet.dao_info.assets
|
|
3190
|
-
balances = {}
|
|
3191
|
-
for asset_id in asset_list:
|
|
3192
|
-
balance = await dao_wallet.get_balance_by_asset_type(asset_id=asset_id)
|
|
3193
|
-
if asset_id is None:
|
|
3194
|
-
balances["xch"] = balance
|
|
3195
|
-
else:
|
|
3196
|
-
balances[asset_id.hex()] = balance
|
|
3197
|
-
return {"success": True, "balances": balances}
|
|
3198
|
-
|
|
3199
|
-
async def dao_get_treasury_id(self, request: dict[str, Any]) -> EndpointResult:
|
|
3200
|
-
wallet_id = uint32(request["wallet_id"])
|
|
3201
|
-
dao_wallet = self.service.wallet_state_manager.get_wallet(id=wallet_id, required_type=DAOWallet)
|
|
3202
|
-
assert dao_wallet is not None
|
|
3203
|
-
treasury_id = dao_wallet.dao_info.treasury_id
|
|
3204
|
-
return {"treasury_id": treasury_id}
|
|
3205
|
-
|
|
3206
|
-
async def dao_get_rules(self, request: dict[str, Any]) -> EndpointResult:
|
|
3207
|
-
wallet_id = uint32(request["wallet_id"])
|
|
3208
|
-
dao_wallet = self.service.wallet_state_manager.get_wallet(id=wallet_id, required_type=DAOWallet)
|
|
3209
|
-
assert dao_wallet is not None
|
|
3210
|
-
rules = dao_wallet.dao_rules
|
|
3211
|
-
return {"rules": rules}
|
|
3212
|
-
|
|
3213
|
-
@tx_endpoint(push=True)
|
|
3214
|
-
async def dao_send_to_lockup(
|
|
3215
|
-
self,
|
|
3216
|
-
request: dict[str, Any],
|
|
3217
|
-
action_scope: WalletActionScope,
|
|
3218
|
-
extra_conditions: tuple[Condition, ...] = tuple(),
|
|
3219
|
-
) -> EndpointResult:
|
|
3220
|
-
wallet_id = uint32(request["wallet_id"])
|
|
3221
|
-
dao_wallet = self.service.wallet_state_manager.get_wallet(id=wallet_id, required_type=DAOWallet)
|
|
3222
|
-
dao_cat_wallet = self.service.wallet_state_manager.get_wallet(
|
|
3223
|
-
id=dao_wallet.dao_info.dao_cat_wallet_id, required_type=DAOCATWallet
|
|
3224
|
-
)
|
|
3225
|
-
amount = uint64(request["amount"])
|
|
3226
|
-
fee = uint64(request.get("fee", 0))
|
|
3227
|
-
await dao_cat_wallet.enter_dao_cat_voting_mode(
|
|
3228
|
-
amount,
|
|
3229
|
-
action_scope,
|
|
3230
|
-
fee=fee,
|
|
3231
|
-
extra_conditions=extra_conditions,
|
|
3232
|
-
)
|
|
3233
|
-
return {
|
|
3234
|
-
"success": True,
|
|
3235
|
-
"tx_id": None,
|
|
3236
|
-
"txs": None,
|
|
3237
|
-
"transactions": None, # tx_endpoint wrapper will take care of this
|
|
3238
|
-
}
|
|
3239
|
-
|
|
3240
|
-
async def dao_get_proposals(self, request: dict[str, Any]) -> EndpointResult:
|
|
3241
|
-
wallet_id = uint32(request["wallet_id"])
|
|
3242
|
-
include_closed = request.get("include_closed", True)
|
|
3243
|
-
dao_wallet = self.service.wallet_state_manager.get_wallet(id=wallet_id, required_type=DAOWallet)
|
|
3244
|
-
assert dao_wallet is not None
|
|
3245
|
-
proposal_list = dao_wallet.dao_info.proposals_list
|
|
3246
|
-
if not include_closed:
|
|
3247
|
-
proposal_list = [prop for prop in proposal_list if not prop.closed]
|
|
3248
|
-
dao_rules = get_treasury_rules_from_puzzle(dao_wallet.dao_info.current_treasury_innerpuz)
|
|
3249
|
-
return {
|
|
3250
|
-
"success": True,
|
|
3251
|
-
"proposals": proposal_list,
|
|
3252
|
-
"proposal_timelock": dao_rules.proposal_timelock,
|
|
3253
|
-
"soft_close_length": dao_rules.soft_close_length,
|
|
3254
|
-
}
|
|
3255
|
-
|
|
3256
|
-
async def dao_get_proposal_state(self, request: dict[str, Any]) -> EndpointResult:
|
|
3257
|
-
wallet_id = uint32(request["wallet_id"])
|
|
3258
|
-
dao_wallet = self.service.wallet_state_manager.get_wallet(id=wallet_id, required_type=DAOWallet)
|
|
3259
|
-
assert dao_wallet is not None
|
|
3260
|
-
state = await dao_wallet.get_proposal_state(bytes32.from_hexstr(request["proposal_id"]))
|
|
3261
|
-
return {"success": True, "state": state}
|
|
3262
|
-
|
|
3263
|
-
@tx_endpoint(push=True)
|
|
3264
|
-
async def dao_exit_lockup(
|
|
3265
|
-
self,
|
|
3266
|
-
request: dict[str, Any],
|
|
3267
|
-
action_scope: WalletActionScope,
|
|
3268
|
-
extra_conditions: tuple[Condition, ...] = tuple(),
|
|
3269
|
-
) -> EndpointResult:
|
|
3270
|
-
wallet_id = uint32(request["wallet_id"])
|
|
3271
|
-
dao_wallet = self.service.wallet_state_manager.get_wallet(id=wallet_id, required_type=DAOWallet)
|
|
3272
|
-
assert dao_wallet is not None
|
|
3273
|
-
dao_cat_wallet = self.service.wallet_state_manager.get_wallet(
|
|
3274
|
-
id=dao_wallet.dao_info.dao_cat_wallet_id, required_type=DAOCATWallet
|
|
3275
|
-
)
|
|
3276
|
-
assert dao_cat_wallet is not None
|
|
3277
|
-
if request["coins"]: # pragma: no cover
|
|
3278
|
-
coin_list = [Coin.from_json_dict(coin) for coin in request["coins"]]
|
|
3279
|
-
coins: list[LockedCoinInfo] = []
|
|
3280
|
-
for lci in dao_cat_wallet.dao_cat_info.locked_coins:
|
|
3281
|
-
if lci.coin in coin_list:
|
|
3282
|
-
coins.append(lci)
|
|
3283
|
-
else:
|
|
3284
|
-
coins = []
|
|
3285
|
-
for lci in dao_cat_wallet.dao_cat_info.locked_coins:
|
|
3286
|
-
if lci.active_votes == []:
|
|
3287
|
-
coins.append(lci)
|
|
3288
|
-
fee = uint64(request.get("fee", 0))
|
|
3289
|
-
if not coins: # pragma: no cover
|
|
3290
|
-
raise ValueError("There are not coins available to exit lockup")
|
|
3291
|
-
await dao_cat_wallet.exit_vote_state(
|
|
3292
|
-
coins,
|
|
3293
|
-
action_scope,
|
|
3294
|
-
fee=fee,
|
|
3295
|
-
extra_conditions=extra_conditions,
|
|
3296
|
-
)
|
|
3297
|
-
return {
|
|
3298
|
-
"success": True,
|
|
3299
|
-
"tx_id": None, # tx_endpoint wrapper will take care of this
|
|
3300
|
-
"tx": None, # tx_endpoint wrapper will take care of this
|
|
3301
|
-
"transactions": None, # tx_endpoint wrapper will take care of this
|
|
3302
|
-
}
|
|
3303
|
-
|
|
3304
|
-
@tx_endpoint(push=True)
|
|
3305
|
-
async def dao_create_proposal(
|
|
3306
|
-
self,
|
|
3307
|
-
request: dict[str, Any],
|
|
3308
|
-
action_scope: WalletActionScope,
|
|
3309
|
-
extra_conditions: tuple[Condition, ...] = tuple(),
|
|
3310
|
-
) -> EndpointResult:
|
|
3311
|
-
wallet_id = uint32(request["wallet_id"])
|
|
3312
|
-
dao_wallet = self.service.wallet_state_manager.get_wallet(id=wallet_id, required_type=DAOWallet)
|
|
3313
|
-
assert dao_wallet is not None
|
|
3314
|
-
|
|
3315
|
-
if request["proposal_type"] == "spend":
|
|
3316
|
-
amounts: list[uint64] = []
|
|
3317
|
-
puzzle_hashes: list[bytes32] = []
|
|
3318
|
-
asset_types: list[Optional[bytes32]] = []
|
|
3319
|
-
additions: Optional[list[dict[str, Any]]] = request.get("additions")
|
|
3320
|
-
if additions is not None:
|
|
3321
|
-
for addition in additions:
|
|
3322
|
-
if "asset_id" in addition:
|
|
3323
|
-
asset_id = bytes32.from_hexstr(addition["asset_id"])
|
|
3324
|
-
else:
|
|
3325
|
-
asset_id = None
|
|
3326
|
-
receiver_ph = bytes32.from_hexstr(addition["puzzle_hash"])
|
|
3327
|
-
amount = uint64(addition["amount"])
|
|
3328
|
-
amounts.append(amount)
|
|
3329
|
-
puzzle_hashes.append(receiver_ph)
|
|
3330
|
-
asset_types.append(asset_id)
|
|
3331
|
-
else: # pragma: no cover
|
|
3332
|
-
amounts.append(uint64(request["amount"]))
|
|
3333
|
-
puzzle_hashes.append(decode_puzzle_hash(request["inner_address"]))
|
|
3334
|
-
if request["asset_id"] is not None:
|
|
3335
|
-
asset_types.append(bytes32.from_hexstr(request["asset_id"]))
|
|
3336
|
-
else:
|
|
3337
|
-
asset_types.append(None)
|
|
3338
|
-
proposed_puzzle = generate_simple_proposal_innerpuz(
|
|
3339
|
-
dao_wallet.dao_info.treasury_id, puzzle_hashes, amounts, asset_types
|
|
3340
|
-
)
|
|
3341
|
-
|
|
3342
|
-
elif request["proposal_type"] == "update":
|
|
3343
|
-
rules = dao_wallet.dao_rules
|
|
3344
|
-
prop = request["new_dao_rules"]
|
|
3345
|
-
new_rules = DAORules(
|
|
3346
|
-
proposal_timelock=prop.get("proposal_timelock") or rules.proposal_timelock,
|
|
3347
|
-
soft_close_length=prop.get("soft_close_length") or rules.soft_close_length,
|
|
3348
|
-
attendance_required=prop.get("attendance_required") or rules.attendance_required,
|
|
3349
|
-
proposal_minimum_amount=prop.get("proposal_minimum_amount") or rules.proposal_minimum_amount,
|
|
3350
|
-
pass_percentage=prop.get("pass_percentage") or rules.pass_percentage,
|
|
3351
|
-
self_destruct_length=prop.get("self_destruct_length") or rules.self_destruct_length,
|
|
3352
|
-
oracle_spend_delay=prop.get("oracle_spend_delay") or rules.oracle_spend_delay,
|
|
3353
|
-
)
|
|
3354
|
-
|
|
3355
|
-
current_innerpuz = dao_wallet.dao_info.current_treasury_innerpuz
|
|
3356
|
-
assert current_innerpuz is not None
|
|
3357
|
-
proposed_puzzle = await generate_update_proposal_innerpuz(current_innerpuz, new_rules)
|
|
3358
|
-
elif request["proposal_type"] == "mint":
|
|
3359
|
-
amount_of_cats = uint64(request["amount"])
|
|
3360
|
-
mint_address = decode_puzzle_hash(request["cat_target_address"])
|
|
3361
|
-
cat_wallet = self.service.wallet_state_manager.get_wallet(
|
|
3362
|
-
id=dao_wallet.dao_info.cat_wallet_id, required_type=CATWallet
|
|
3363
|
-
)
|
|
3364
|
-
proposed_puzzle = await generate_mint_proposal_innerpuz(
|
|
3365
|
-
dao_wallet.dao_info.treasury_id,
|
|
3366
|
-
cat_wallet.cat_info.limitations_program_hash,
|
|
3367
|
-
amount_of_cats,
|
|
3368
|
-
mint_address,
|
|
3369
|
-
)
|
|
3370
|
-
else: # pragma: no cover
|
|
3371
|
-
return {"success": False, "error": "Unknown proposal type."}
|
|
3372
|
-
|
|
3373
|
-
vote_amount = request.get("vote_amount")
|
|
3374
|
-
fee = uint64(request.get("fee", 0))
|
|
3375
|
-
await dao_wallet.generate_new_proposal(
|
|
3376
|
-
proposed_puzzle,
|
|
3377
|
-
action_scope,
|
|
3378
|
-
vote_amount=vote_amount,
|
|
3379
|
-
fee=fee,
|
|
3380
|
-
extra_conditions=extra_conditions,
|
|
3381
|
-
)
|
|
3382
|
-
async with action_scope.use() as interface:
|
|
3383
|
-
found: bool = False
|
|
3384
|
-
for tx in interface.side_effects.transactions:
|
|
3385
|
-
for coin in tx.removals:
|
|
3386
|
-
if coin.puzzle_hash == SINGLETON_LAUNCHER_PUZZLE_HASH:
|
|
3387
|
-
proposal_id = coin.name()
|
|
3388
|
-
found = True
|
|
3389
|
-
if found:
|
|
3390
|
-
break
|
|
3391
|
-
else: # pragma: no cover
|
|
3392
|
-
raise ValueError("Could not find proposal ID in transaction")
|
|
3393
|
-
return {
|
|
3394
|
-
"success": True,
|
|
3395
|
-
# Semantics guarantee proposal_id here
|
|
3396
|
-
"proposal_id": proposal_id,
|
|
3397
|
-
"tx_id": None, # tx_endpoint wrapper will take care of this
|
|
3398
|
-
"tx": None, # tx_endpoint wrapper will take care of this
|
|
3399
|
-
"transactions": None, # tx_endpoint wrapper will take care of this
|
|
3400
|
-
}
|
|
3401
|
-
|
|
3402
|
-
@tx_endpoint(push=True)
|
|
3403
|
-
async def dao_vote_on_proposal(
|
|
3404
|
-
self,
|
|
3405
|
-
request: dict[str, Any],
|
|
3406
|
-
action_scope: WalletActionScope,
|
|
3407
|
-
extra_conditions: tuple[Condition, ...] = tuple(),
|
|
3408
|
-
) -> EndpointResult:
|
|
3409
|
-
wallet_id = uint32(request["wallet_id"])
|
|
3410
|
-
dao_wallet = self.service.wallet_state_manager.get_wallet(id=wallet_id, required_type=DAOWallet)
|
|
3411
|
-
assert dao_wallet is not None
|
|
3412
|
-
vote_amount = None
|
|
3413
|
-
if "vote_amount" in request:
|
|
3414
|
-
vote_amount = uint64(request["vote_amount"])
|
|
3415
|
-
fee = uint64(request.get("fee", 0))
|
|
3416
|
-
await dao_wallet.generate_proposal_vote_spend(
|
|
3417
|
-
bytes32.from_hexstr(request["proposal_id"]),
|
|
3418
|
-
vote_amount,
|
|
3419
|
-
request["is_yes_vote"], # bool
|
|
3420
|
-
action_scope,
|
|
3421
|
-
fee,
|
|
3422
|
-
extra_conditions=extra_conditions,
|
|
3423
|
-
)
|
|
3424
|
-
return {
|
|
3425
|
-
"success": True,
|
|
3426
|
-
"tx_id": None, # tx_endpoint wrapper will take care of this
|
|
3427
|
-
"tx": None, # tx_endpoint wrapper will take care of this
|
|
3428
|
-
"transactions": None, # tx_endpoint wrapper will take care of this
|
|
3429
|
-
}
|
|
3430
|
-
|
|
3431
|
-
async def dao_parse_proposal(self, request: dict[str, Any]) -> EndpointResult:
|
|
3432
|
-
wallet_id = uint32(request["wallet_id"])
|
|
3433
|
-
dao_wallet = self.service.wallet_state_manager.get_wallet(id=wallet_id, required_type=DAOWallet)
|
|
3434
|
-
assert dao_wallet is not None
|
|
3435
|
-
proposal_id = bytes32.from_hexstr(request["proposal_id"])
|
|
3436
|
-
proposal_dictionary = await dao_wallet.parse_proposal(proposal_id)
|
|
3437
|
-
assert proposal_dictionary is not None
|
|
3438
|
-
return {"success": True, "proposal_dictionary": proposal_dictionary}
|
|
3439
|
-
|
|
3440
|
-
@tx_endpoint(push=True)
|
|
3441
|
-
async def dao_close_proposal(
|
|
3442
|
-
self,
|
|
3443
|
-
request: dict[str, Any],
|
|
3444
|
-
action_scope: WalletActionScope,
|
|
3445
|
-
extra_conditions: tuple[Condition, ...] = tuple(),
|
|
3446
|
-
) -> EndpointResult:
|
|
3447
|
-
wallet_id = uint32(request["wallet_id"])
|
|
3448
|
-
dao_wallet = self.service.wallet_state_manager.get_wallet(id=wallet_id, required_type=DAOWallet)
|
|
3449
|
-
assert dao_wallet is not None
|
|
3450
|
-
fee = uint64(request.get("fee", 0))
|
|
3451
|
-
if "genesis_id" in request: # pragma: no cover
|
|
3452
|
-
genesis_id = bytes32.from_hexstr(request["genesis_id"])
|
|
3453
|
-
else:
|
|
3454
|
-
genesis_id = None
|
|
3455
|
-
self_destruct = request.get("self_destruct", None)
|
|
3456
|
-
await dao_wallet.create_proposal_close_spend(
|
|
3457
|
-
bytes32.from_hexstr(request["proposal_id"]),
|
|
3458
|
-
action_scope,
|
|
3459
|
-
genesis_id,
|
|
3460
|
-
fee=fee,
|
|
3461
|
-
self_destruct=self_destruct,
|
|
3462
|
-
extra_conditions=extra_conditions,
|
|
3463
|
-
)
|
|
3464
|
-
return {
|
|
3465
|
-
"success": True,
|
|
3466
|
-
"tx_id": None, # tx_endpoint wrapper will take care of this
|
|
3467
|
-
"tx": None, # tx_endpoint wrapper will take care of this
|
|
3468
|
-
"transactions": None, # tx_endpoint wrapper will take care of this
|
|
3469
|
-
}
|
|
3470
|
-
|
|
3471
|
-
@tx_endpoint(push=True)
|
|
3472
|
-
async def dao_free_coins_from_finished_proposals(
|
|
3473
|
-
self,
|
|
3474
|
-
request: dict[str, Any],
|
|
3475
|
-
action_scope: WalletActionScope,
|
|
3476
|
-
extra_conditions: tuple[Condition, ...] = tuple(),
|
|
3477
|
-
) -> EndpointResult:
|
|
3478
|
-
wallet_id = uint32(request["wallet_id"])
|
|
3479
|
-
fee = uint64(request.get("fee", 0))
|
|
3480
|
-
dao_wallet = self.service.wallet_state_manager.get_wallet(id=wallet_id, required_type=DAOWallet)
|
|
3481
|
-
assert dao_wallet is not None
|
|
3482
|
-
await dao_wallet.free_coins_from_finished_proposals(
|
|
3483
|
-
action_scope,
|
|
3484
|
-
fee=fee,
|
|
3485
|
-
extra_conditions=extra_conditions,
|
|
3486
|
-
)
|
|
3487
|
-
|
|
3488
|
-
return {
|
|
3489
|
-
"success": True,
|
|
3490
|
-
"tx_id": None, # tx_endpoint wrapper will take care of this
|
|
3491
|
-
"tx": None, # tx_endpoint wrapper will take care of this
|
|
3492
|
-
"transactions": None, # tx_endpoint wrapper will take care of this
|
|
3493
|
-
}
|
|
3494
|
-
|
|
3495
2999
|
##########################################################################################
|
|
3496
3000
|
# NFT Wallet
|
|
3497
3001
|
##########################################################################################
|
|
@@ -3610,7 +3114,7 @@ class WalletRpcApi:
|
|
|
3610
3114
|
else:
|
|
3611
3115
|
nfts = await self.service.wallet_state_manager.nft_store.get_nft_list(start_index=start_index, count=count)
|
|
3612
3116
|
for nft in nfts:
|
|
3613
|
-
nft_info = await
|
|
3117
|
+
nft_info = await nft_puzzle_utils.get_nft_info_from_puzzle(nft, self.service.wallet_state_manager.config)
|
|
3614
3118
|
nft_info_list.append(nft_info)
|
|
3615
3119
|
return {"wallet_id": wallet_id, "success": True, "nft_list": nft_info_list}
|
|
3616
3120
|
|
|
@@ -3628,7 +3132,7 @@ class WalletRpcApi:
|
|
|
3628
3132
|
did_id = decode_puzzle_hash(did_id)
|
|
3629
3133
|
nft_coin_info = await nft_wallet.get_nft_coin_by_id(bytes32.from_hexstr(request["nft_coin_id"]))
|
|
3630
3134
|
if not (
|
|
3631
|
-
await
|
|
3135
|
+
await nft_puzzle_utils.get_nft_info_from_puzzle(nft_coin_info, self.service.wallet_state_manager.config)
|
|
3632
3136
|
).supports_did:
|
|
3633
3137
|
return {"success": False, "error": "The NFT doesn't support setting a DID."}
|
|
3634
3138
|
|
|
@@ -3689,7 +3193,7 @@ class WalletRpcApi:
|
|
|
3689
3193
|
nft_coin_info = await nft_wallet.get_nft_coin_by_id(nft_coin_id)
|
|
3690
3194
|
assert nft_coin_info is not None
|
|
3691
3195
|
if not (
|
|
3692
|
-
await
|
|
3196
|
+
await nft_puzzle_utils.get_nft_info_from_puzzle(nft_coin_info, self.service.wallet_state_manager.config)
|
|
3693
3197
|
).supports_did:
|
|
3694
3198
|
log.warning(f"Skipping NFT {nft_coin_info.nft_id.hex()}, doesn't support setting a DID.")
|
|
3695
3199
|
continue
|
|
@@ -3926,13 +3430,13 @@ class WalletRpcApi:
|
|
|
3926
3430
|
# There is no way to rebuild the full puzzle in a different wallet.
|
|
3927
3431
|
# But it shouldn't have impact on generating the NFTInfo, since inner_puzzle is not used there.
|
|
3928
3432
|
if uncurried_nft.supports_did:
|
|
3929
|
-
inner_puzzle =
|
|
3433
|
+
inner_puzzle = nft_puzzle_utils.recurry_nft_puzzle(
|
|
3930
3434
|
uncurried_nft, coin_spend.solution.to_program(), uncurried_nft.p2_puzzle
|
|
3931
3435
|
)
|
|
3932
3436
|
else:
|
|
3933
3437
|
inner_puzzle = uncurried_nft.p2_puzzle
|
|
3934
3438
|
|
|
3935
|
-
full_puzzle =
|
|
3439
|
+
full_puzzle = nft_puzzle_utils.create_full_puzzle(
|
|
3936
3440
|
uncurried_nft.singleton_launcher_id,
|
|
3937
3441
|
metadata,
|
|
3938
3442
|
bytes32(uncurried_nft.metadata_updater_hash.as_atom()),
|
|
@@ -3950,7 +3454,7 @@ class WalletRpcApi:
|
|
|
3950
3454
|
}
|
|
3951
3455
|
minter_did = await self.service.wallet_state_manager.get_minter_did(launcher_coin[0].coin, peer)
|
|
3952
3456
|
|
|
3953
|
-
nft_info: NFTInfo = await
|
|
3457
|
+
nft_info: NFTInfo = await nft_puzzle_utils.get_nft_info_from_puzzle(
|
|
3954
3458
|
NFTCoinInfo(
|
|
3955
3459
|
uncurried_nft.singleton_launcher_id,
|
|
3956
3460
|
coin_state.coin,
|
|
@@ -4128,7 +3632,7 @@ class WalletRpcApi:
|
|
|
4128
3632
|
)
|
|
4129
3633
|
nft_id_list = []
|
|
4130
3634
|
for cs in sb.coin_spends:
|
|
4131
|
-
if cs.coin.puzzle_hash ==
|
|
3635
|
+
if cs.coin.puzzle_hash == SINGLETON_LAUNCHER_PUZZLE_HASH:
|
|
4132
3636
|
nft_id_list.append(encode_puzzle_hash(cs.coin.name(), AddressType.NFT.hrp(self.service.config)))
|
|
4133
3637
|
|
|
4134
3638
|
return {
|
|
@@ -4238,9 +3742,9 @@ class WalletRpcApi:
|
|
|
4238
3742
|
else:
|
|
4239
3743
|
wallet = self.service.wallet_state_manager.main_wallet
|
|
4240
3744
|
|
|
4241
|
-
assert isinstance(
|
|
4242
|
-
|
|
4243
|
-
)
|
|
3745
|
+
assert isinstance(wallet, (Wallet, CATWallet, CRCATWallet)), (
|
|
3746
|
+
"create_signed_transaction only works for standard and CAT wallets"
|
|
3747
|
+
)
|
|
4244
3748
|
|
|
4245
3749
|
if "additions" not in request or len(request["additions"]) < 1:
|
|
4246
3750
|
raise ValueError("Specify additions list")
|
|
@@ -4254,7 +3758,7 @@ class WalletRpcApi:
|
|
|
4254
3758
|
|
|
4255
3759
|
memos_0 = [] if "memos" not in additions[0] else [mem.encode("utf-8") for mem in additions[0]["memos"]]
|
|
4256
3760
|
|
|
4257
|
-
additional_outputs: list[
|
|
3761
|
+
additional_outputs: list[CreateCoin] = []
|
|
4258
3762
|
for addition in additions[1:]:
|
|
4259
3763
|
receiver_ph = bytes32.from_hexstr(addition["puzzle_hash"])
|
|
4260
3764
|
if len(receiver_ph) != 32:
|
|
@@ -4263,7 +3767,7 @@ class WalletRpcApi:
|
|
|
4263
3767
|
if amount > self.service.constants.MAX_COIN_AMOUNT:
|
|
4264
3768
|
raise ValueError(f"Coin amount cannot exceed {self.service.constants.MAX_COIN_AMOUNT}")
|
|
4265
3769
|
memos = [] if "memos" not in addition else [mem.encode("utf-8") for mem in addition["memos"]]
|
|
4266
|
-
additional_outputs.append(
|
|
3770
|
+
additional_outputs.append(CreateCoin(receiver_ph, amount, memos))
|
|
4267
3771
|
|
|
4268
3772
|
fee: uint64 = uint64(request.get("fee", 0))
|
|
4269
3773
|
|
|
@@ -4272,82 +3776,41 @@ class WalletRpcApi:
|
|
|
4272
3776
|
coins = {Coin.from_json_dict(coin_json) for coin_json in request["coins"]}
|
|
4273
3777
|
|
|
4274
3778
|
async def _generate_signed_transaction() -> EndpointResult:
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
)
|
|
4295
|
-
for ca in request.get("coin_announcements", [])
|
|
4296
|
-
),
|
|
4297
|
-
*(
|
|
4298
|
-
AssertPuzzleAnnouncement(
|
|
4299
|
-
asserted_ph=bytes32.from_hexstr(pa["puzzle_hash"]),
|
|
4300
|
-
asserted_msg=(
|
|
4301
|
-
hexstr_to_bytes(pa["message"])
|
|
4302
|
-
if request.get("morph_bytes") is None
|
|
4303
|
-
else std_hash(hexstr_to_bytes(pa["morph_bytes"]) + hexstr_to_bytes(pa["message"]))
|
|
4304
|
-
),
|
|
4305
|
-
)
|
|
4306
|
-
for pa in request.get("puzzle_announcements", [])
|
|
4307
|
-
),
|
|
3779
|
+
await wallet.generate_signed_transaction(
|
|
3780
|
+
[amount_0] + [output.amount for output in additional_outputs],
|
|
3781
|
+
[bytes32(puzzle_hash_0)] + [output.puzzle_hash for output in additional_outputs],
|
|
3782
|
+
action_scope,
|
|
3783
|
+
fee,
|
|
3784
|
+
coins=coins,
|
|
3785
|
+
memos=[memos_0] + [output.memos if output.memos is not None else [] for output in additional_outputs],
|
|
3786
|
+
extra_conditions=(
|
|
3787
|
+
*extra_conditions,
|
|
3788
|
+
*(
|
|
3789
|
+
AssertCoinAnnouncement(
|
|
3790
|
+
asserted_id=bytes32.from_hexstr(ca["coin_id"]),
|
|
3791
|
+
asserted_msg=(
|
|
3792
|
+
hexstr_to_bytes(ca["message"])
|
|
3793
|
+
if request.get("morph_bytes") is None
|
|
3794
|
+
else std_hash(hexstr_to_bytes(ca["morph_bytes"]) + hexstr_to_bytes(ca["message"]))
|
|
3795
|
+
),
|
|
3796
|
+
)
|
|
3797
|
+
for ca in request.get("coin_announcements", [])
|
|
4308
3798
|
),
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
action_scope,
|
|
4320
|
-
fee,
|
|
4321
|
-
coins=coins,
|
|
4322
|
-
memos=[memos_0] + [output.memos for output in additional_outputs],
|
|
4323
|
-
extra_conditions=(
|
|
4324
|
-
*extra_conditions,
|
|
4325
|
-
*(
|
|
4326
|
-
AssertCoinAnnouncement(
|
|
4327
|
-
asserted_id=bytes32.from_hexstr(ca["coin_id"]),
|
|
4328
|
-
asserted_msg=(
|
|
4329
|
-
hexstr_to_bytes(ca["message"])
|
|
4330
|
-
if request.get("morph_bytes") is None
|
|
4331
|
-
else std_hash(hexstr_to_bytes(ca["morph_bytes"]) + hexstr_to_bytes(ca["message"]))
|
|
4332
|
-
),
|
|
4333
|
-
)
|
|
4334
|
-
for ca in request.get("coin_announcements", [])
|
|
4335
|
-
),
|
|
4336
|
-
*(
|
|
4337
|
-
AssertPuzzleAnnouncement(
|
|
4338
|
-
asserted_ph=bytes32.from_hexstr(pa["puzzle_hash"]),
|
|
4339
|
-
asserted_msg=(
|
|
4340
|
-
hexstr_to_bytes(pa["message"])
|
|
4341
|
-
if request.get("morph_bytes") is None
|
|
4342
|
-
else std_hash(hexstr_to_bytes(pa["morph_bytes"]) + hexstr_to_bytes(pa["message"]))
|
|
4343
|
-
),
|
|
4344
|
-
)
|
|
4345
|
-
for pa in request.get("puzzle_announcements", [])
|
|
4346
|
-
),
|
|
3799
|
+
*(
|
|
3800
|
+
AssertPuzzleAnnouncement(
|
|
3801
|
+
asserted_ph=bytes32.from_hexstr(pa["puzzle_hash"]),
|
|
3802
|
+
asserted_msg=(
|
|
3803
|
+
hexstr_to_bytes(pa["message"])
|
|
3804
|
+
if request.get("morph_bytes") is None
|
|
3805
|
+
else std_hash(hexstr_to_bytes(pa["morph_bytes"]) + hexstr_to_bytes(pa["message"]))
|
|
3806
|
+
),
|
|
3807
|
+
)
|
|
3808
|
+
for pa in request.get("puzzle_announcements", [])
|
|
4347
3809
|
),
|
|
4348
|
-
)
|
|
4349
|
-
|
|
4350
|
-
|
|
3810
|
+
),
|
|
3811
|
+
)
|
|
3812
|
+
# tx_endpoint wrapper will take care of this
|
|
3813
|
+
return {"signed_txs": None, "signed_tx": None, "transactions": None}
|
|
4351
3814
|
|
|
4352
3815
|
if hold_lock:
|
|
4353
3816
|
async with self.service.wallet_state_manager.lock:
|
|
@@ -4803,10 +4266,17 @@ class WalletRpcApi:
|
|
|
4803
4266
|
vc_wallet: VCWallet = await self.service.wallet_state_manager.get_or_create_vc_wallet()
|
|
4804
4267
|
|
|
4805
4268
|
await vc_wallet.generate_signed_transaction(
|
|
4806
|
-
|
|
4269
|
+
[uint64(1)],
|
|
4270
|
+
[
|
|
4271
|
+
request.new_puzhash
|
|
4272
|
+
if request.new_puzhash is not None
|
|
4273
|
+
else await vc_wallet.standard_wallet.get_puzzle_hash(
|
|
4274
|
+
new=not action_scope.config.tx_config.reuse_puzhash
|
|
4275
|
+
)
|
|
4276
|
+
],
|
|
4807
4277
|
action_scope,
|
|
4808
4278
|
request.fee,
|
|
4809
|
-
request.
|
|
4279
|
+
vc_id=request.vc_id,
|
|
4810
4280
|
new_proof_hash=request.new_proof_hash,
|
|
4811
4281
|
provider_inner_puzhash=request.provider_inner_puzhash,
|
|
4812
4282
|
extra_conditions=extra_conditions,
|