near-jsonrpc-client 1.0.5__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.
- near_jsonrpc_client/__init__.py +27 -0
- near_jsonrpc_client/api_methods_async.py +450 -0
- near_jsonrpc_client/api_methods_sync.py +450 -0
- near_jsonrpc_client/base_client.py +148 -0
- near_jsonrpc_client/client.py +13 -0
- near_jsonrpc_client/errors.py +35 -0
- near_jsonrpc_client/transport.py +43 -0
- near_jsonrpc_client-1.0.5.dist-info/METADATA +10 -0
- near_jsonrpc_client-1.0.5.dist-info/RECORD +357 -0
- near_jsonrpc_client-1.0.5.dist-info/WHEEL +5 -0
- near_jsonrpc_client-1.0.5.dist-info/licenses/LICENSE +201 -0
- near_jsonrpc_client-1.0.5.dist-info/top_level.txt +2 -0
- near_jsonrpc_models/__init__.py +3378 -0
- near_jsonrpc_models/access_key.py +18 -0
- near_jsonrpc_models/access_key_creation_config_view.py +13 -0
- near_jsonrpc_models/access_key_info_view.py +10 -0
- near_jsonrpc_models/access_key_list.py +9 -0
- near_jsonrpc_models/access_key_permission.py +21 -0
- near_jsonrpc_models/access_key_permission_view.py +25 -0
- near_jsonrpc_models/access_key_view.py +10 -0
- near_jsonrpc_models/account_creation_config_view.py +13 -0
- near_jsonrpc_models/account_data_view.py +30 -0
- near_jsonrpc_models/account_id.py +25 -0
- near_jsonrpc_models/account_id_validity_rules_version.py +8 -0
- near_jsonrpc_models/account_info.py +12 -0
- near_jsonrpc_models/account_view.py +18 -0
- near_jsonrpc_models/account_with_public_key.py +10 -0
- near_jsonrpc_models/action_creation_config_view.py +32 -0
- near_jsonrpc_models/action_error.py +13 -0
- near_jsonrpc_models/action_error_kind.py +200 -0
- near_jsonrpc_models/action_view.py +133 -0
- near_jsonrpc_models/actions_validation_error.py +150 -0
- near_jsonrpc_models/add_gas_key_action.py +10 -0
- near_jsonrpc_models/add_key_action.py +12 -0
- near_jsonrpc_models/bandwidth_request.py +14 -0
- near_jsonrpc_models/bandwidth_request_bitmap.py +11 -0
- near_jsonrpc_models/bandwidth_requests.py +16 -0
- near_jsonrpc_models/bandwidth_requests_v1.py +9 -0
- near_jsonrpc_models/block_header_inner_lite_view.py +22 -0
- near_jsonrpc_models/block_header_view.py +53 -0
- near_jsonrpc_models/block_id.py +16 -0
- near_jsonrpc_models/block_reference.py +21 -0
- near_jsonrpc_models/block_status_view.py +10 -0
- near_jsonrpc_models/call_result.py +10 -0
- near_jsonrpc_models/catchup_status_view.py +28 -0
- near_jsonrpc_models/chunk_distribution_network_config.py +12 -0
- near_jsonrpc_models/chunk_distribution_uris.py +10 -0
- near_jsonrpc_models/chunk_hash.py +4 -0
- near_jsonrpc_models/chunk_header_view.py +39 -0
- near_jsonrpc_models/cloud_archival_writer_config.py +14 -0
- near_jsonrpc_models/compilation_error.py +29 -0
- near_jsonrpc_models/congestion_control_config_view.py +58 -0
- near_jsonrpc_models/congestion_info_view.py +11 -0
- near_jsonrpc_models/contract_code_view.py +9 -0
- near_jsonrpc_models/cost_gas_used.py +10 -0
- near_jsonrpc_models/create_account_action.py +7 -0
- near_jsonrpc_models/crypto_hash.py +7 -0
- near_jsonrpc_models/current_epoch_validator_info.py +35 -0
- near_jsonrpc_models/data_receipt_creation_config_view.py +20 -0
- near_jsonrpc_models/data_receiver_view.py +8 -0
- near_jsonrpc_models/delegate_action.py +28 -0
- near_jsonrpc_models/delete_account_action.py +6 -0
- near_jsonrpc_models/delete_gas_key_action.py +6 -0
- near_jsonrpc_models/delete_key_action.py +7 -0
- near_jsonrpc_models/deploy_contract_action.py +8 -0
- near_jsonrpc_models/deploy_global_contract_action.py +10 -0
- near_jsonrpc_models/detailed_debug_status.py +15 -0
- near_jsonrpc_models/deterministic_account_state_init.py +13 -0
- near_jsonrpc_models/deterministic_account_state_init_v1.py +8 -0
- near_jsonrpc_models/deterministic_state_init_action.py +8 -0
- near_jsonrpc_models/direction.py +7 -0
- near_jsonrpc_models/dump_config.py +20 -0
- near_jsonrpc_models/duration_as_std_schema_provider.py +7 -0
- near_jsonrpc_models/dynamic_resharding_config_view.py +23 -0
- near_jsonrpc_models/epoch_id.py +8 -0
- near_jsonrpc_models/epoch_sync_config.py +25 -0
- near_jsonrpc_models/error_wrapper_for_genesis_config_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_block_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_call_function_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_chunk_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_client_config_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_gas_price_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_light_client_next_block_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_light_client_proof_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_maintenance_windows_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_network_info_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_protocol_config_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_query_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_receipt_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_split_storage_info_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_state_changes_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_status_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_transaction_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_validator_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_view_access_key_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_view_access_key_list_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_view_account_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_view_code_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_view_gas_key_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_view_gas_key_list_error.py +24 -0
- near_jsonrpc_models/error_wrapper_for_rpc_view_state_error.py +24 -0
- near_jsonrpc_models/execution_metadata_view.py +9 -0
- near_jsonrpc_models/execution_outcome_view.py +31 -0
- near_jsonrpc_models/execution_outcome_with_id_view.py +12 -0
- near_jsonrpc_models/execution_status_view.py +29 -0
- near_jsonrpc_models/ext_costs_config_view.py +162 -0
- near_jsonrpc_models/external_storage_config.py +17 -0
- near_jsonrpc_models/external_storage_location.py +34 -0
- near_jsonrpc_models/fee.py +17 -0
- near_jsonrpc_models/final_execution_outcome_view.py +23 -0
- near_jsonrpc_models/final_execution_outcome_with_receipt_view.py +26 -0
- near_jsonrpc_models/final_execution_status.py +27 -0
- near_jsonrpc_models/finality.py +9 -0
- near_jsonrpc_models/function_args.py +13 -0
- near_jsonrpc_models/function_call_action.py +10 -0
- near_jsonrpc_models/function_call_error.py +52 -0
- near_jsonrpc_models/function_call_permission.py +24 -0
- near_jsonrpc_models/gas_key.py +17 -0
- near_jsonrpc_models/gas_key_info_view.py +8 -0
- near_jsonrpc_models/gas_key_list.py +7 -0
- near_jsonrpc_models/gas_key_view.py +12 -0
- near_jsonrpc_models/gcconfig.py +19 -0
- near_jsonrpc_models/genesis_config.py +121 -0
- near_jsonrpc_models/genesis_config_error.py +7 -0
- near_jsonrpc_models/genesis_config_request.py +7 -0
- near_jsonrpc_models/global_contract_deploy_mode.py +13 -0
- near_jsonrpc_models/global_contract_identifier.py +17 -0
- near_jsonrpc_models/global_contract_identifier_view.py +17 -0
- near_jsonrpc_models/host_error.py +212 -0
- near_jsonrpc_models/internal_error.py +16 -0
- near_jsonrpc_models/invalid_access_key_error.py +54 -0
- near_jsonrpc_models/invalid_tx_error.py +135 -0
- near_jsonrpc_models/json_rpc_request_for_block.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_block_effects.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_broadcast_tx_async.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_broadcast_tx_commit.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_changes.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_chunk.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_client_config.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_call_function.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_changes.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_changes_in_block.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_congestion_level.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_genesis_config.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_light_client_block_proof.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_light_client_proof.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_maintenance_windows.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_protocol_config.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_receipt.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_split_storage_info.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_tx_status.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_validators_ordered.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_view_access_key.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_view_access_key_list.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_view_account.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_view_code.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_view_gas_key.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_view_gas_key_list.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_experimental_view_state.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_gas_price.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_genesis_config.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_health.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_light_client_proof.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_maintenance_windows.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_network_info.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_next_light_client_block.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_query.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_send_tx.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_status.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_tx.py +10 -0
- near_jsonrpc_models/json_rpc_request_for_validators.py +10 -0
- near_jsonrpc_models/json_rpc_response_for_array_of_range_of_uint64_and_rpc_maintenance_windows_error.py +21 -0
- near_jsonrpc_models/json_rpc_response_for_array_of_validator_stake_view_and_rpc_validator_error.py +21 -0
- near_jsonrpc_models/json_rpc_response_for_crypto_hash_and_rpc_transaction_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_genesis_config_and_genesis_config_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_nullable_rpc_health_response_and_rpc_status_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_block_response_and_rpc_block_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_call_function_response_and_rpc_call_function_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_chunk_response_and_rpc_chunk_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_client_config_response_and_rpc_client_config_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_congestion_level_response_and_rpc_chunk_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_gas_price_response_and_rpc_gas_price_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_light_client_block_proof_response_and_rpc_light_client_proof_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_light_client_execution_proof_response_and_rpc_light_client_proof_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_light_client_next_block_response_and_rpc_light_client_next_block_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_network_info_response_and_rpc_network_info_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_protocol_config_response_and_rpc_protocol_config_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_query_response_and_rpc_query_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_receipt_response_and_rpc_receipt_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_split_storage_info_response_and_rpc_split_storage_info_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_state_changes_in_block_by_type_response_and_rpc_state_changes_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_state_changes_in_block_response_and_rpc_state_changes_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_status_response_and_rpc_status_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_transaction_response_and_rpc_transaction_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_validator_response_and_rpc_validator_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_view_access_key_list_response_and_rpc_view_access_key_list_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_view_access_key_response_and_rpc_view_access_key_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_view_account_response_and_rpc_view_account_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_view_code_response_and_rpc_view_code_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_view_gas_key_list_response_and_rpc_view_gas_key_list_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_view_gas_key_response_and_rpc_view_gas_key_error.py +20 -0
- near_jsonrpc_models/json_rpc_response_for_rpc_view_state_response_and_rpc_view_state_error.py +20 -0
- near_jsonrpc_models/known_producer_view.py +13 -0
- near_jsonrpc_models/light_client_block_lite_view.py +9 -0
- near_jsonrpc_models/limit_config.py +81 -0
- near_jsonrpc_models/log_summary_style.py +7 -0
- near_jsonrpc_models/merkle_path_item.py +8 -0
- near_jsonrpc_models/method_resolve_error.py +7 -0
- near_jsonrpc_models/missing_trie_value.py +8 -0
- near_jsonrpc_models/missing_trie_value_context.py +9 -0
- near_jsonrpc_models/mutable_config_value.py +7 -0
- near_jsonrpc_models/near_gas.py +8 -0
- near_jsonrpc_models/near_token.py +7 -0
- near_jsonrpc_models/network_info_view.py +17 -0
- near_jsonrpc_models/next_epoch_validator_info.py +13 -0
- near_jsonrpc_models/non_delegate_action.py +71 -0
- near_jsonrpc_models/peer_id.py +6 -0
- near_jsonrpc_models/peer_info_view.py +26 -0
- near_jsonrpc_models/prepare_error.py +16 -0
- near_jsonrpc_models/protocol_version_check_config.py +9 -0
- near_jsonrpc_models/public_key.py +7 -0
- near_jsonrpc_models/range_of_uint64.py +7 -0
- near_jsonrpc_models/receipt_enum_view.py +48 -0
- near_jsonrpc_models/receipt_validation_error.py +76 -0
- near_jsonrpc_models/receipt_view.py +13 -0
- near_jsonrpc_models/rpc_block_error.py +25 -0
- near_jsonrpc_models/rpc_block_request.py +20 -0
- near_jsonrpc_models/rpc_block_response.py +12 -0
- near_jsonrpc_models/rpc_call_function_error.py +64 -0
- near_jsonrpc_models/rpc_call_function_request.py +31 -0
- near_jsonrpc_models/rpc_call_function_response.py +13 -0
- near_jsonrpc_models/rpc_chunk_error.py +38 -0
- near_jsonrpc_models/rpc_chunk_request.py +18 -0
- near_jsonrpc_models/rpc_chunk_response.py +13 -0
- near_jsonrpc_models/rpc_client_config_error.py +16 -0
- near_jsonrpc_models/rpc_client_config_request.py +7 -0
- near_jsonrpc_models/rpc_client_config_response.py +185 -0
- near_jsonrpc_models/rpc_congestion_level_request.py +18 -0
- near_jsonrpc_models/rpc_congestion_level_response.py +5 -0
- near_jsonrpc_models/rpc_gas_price_error.py +22 -0
- near_jsonrpc_models/rpc_gas_price_request.py +6 -0
- near_jsonrpc_models/rpc_gas_price_response.py +6 -0
- near_jsonrpc_models/rpc_health_request.py +7 -0
- near_jsonrpc_models/rpc_health_response.py +7 -0
- near_jsonrpc_models/rpc_known_producer.py +9 -0
- near_jsonrpc_models/rpc_light_client_block_proof_request.py +7 -0
- near_jsonrpc_models/rpc_light_client_block_proof_response.py +9 -0
- near_jsonrpc_models/rpc_light_client_execution_proof_request.py +23 -0
- near_jsonrpc_models/rpc_light_client_execution_proof_response.py +12 -0
- near_jsonrpc_models/rpc_light_client_next_block_error.py +30 -0
- near_jsonrpc_models/rpc_light_client_next_block_request.py +6 -0
- near_jsonrpc_models/rpc_light_client_next_block_response.py +19 -0
- near_jsonrpc_models/rpc_light_client_proof_error.py +55 -0
- near_jsonrpc_models/rpc_maintenance_windows_error.py +16 -0
- near_jsonrpc_models/rpc_maintenance_windows_request.py +6 -0
- near_jsonrpc_models/rpc_network_info_error.py +16 -0
- near_jsonrpc_models/rpc_network_info_request.py +7 -0
- near_jsonrpc_models/rpc_network_info_response.py +15 -0
- near_jsonrpc_models/rpc_peer_info.py +9 -0
- near_jsonrpc_models/rpc_protocol_config_error.py +22 -0
- near_jsonrpc_models/rpc_protocol_config_request.py +20 -0
- near_jsonrpc_models/rpc_protocol_config_response.py +103 -0
- near_jsonrpc_models/rpc_query_error.py +122 -0
- near_jsonrpc_models/rpc_query_request.py +185 -0
- near_jsonrpc_models/rpc_query_response.py +50 -0
- near_jsonrpc_models/rpc_receipt_error.py +24 -0
- near_jsonrpc_models/rpc_receipt_request.py +6 -0
- near_jsonrpc_models/rpc_receipt_response.py +13 -0
- near_jsonrpc_models/rpc_request_validation_error_kind.py +23 -0
- near_jsonrpc_models/rpc_send_transaction_request.py +9 -0
- near_jsonrpc_models/rpc_split_storage_info_error.py +16 -0
- near_jsonrpc_models/rpc_split_storage_info_request.py +5 -0
- near_jsonrpc_models/rpc_split_storage_info_response.py +11 -0
- near_jsonrpc_models/rpc_state_changes_error.py +25 -0
- near_jsonrpc_models/rpc_state_changes_in_block_by_type_request.py +129 -0
- near_jsonrpc_models/rpc_state_changes_in_block_by_type_response.py +9 -0
- near_jsonrpc_models/rpc_state_changes_in_block_request.py +20 -0
- near_jsonrpc_models/rpc_state_changes_in_block_response.py +9 -0
- near_jsonrpc_models/rpc_status_error.py +37 -0
- near_jsonrpc_models/rpc_status_request.py +7 -0
- near_jsonrpc_models/rpc_status_response.py +41 -0
- near_jsonrpc_models/rpc_transaction_error.py +43 -0
- near_jsonrpc_models/rpc_transaction_response.py +17 -0
- near_jsonrpc_models/rpc_transaction_status_request.py +21 -0
- near_jsonrpc_models/rpc_validator_error.py +22 -0
- near_jsonrpc_models/rpc_validator_request.py +20 -0
- near_jsonrpc_models/rpc_validator_response.py +28 -0
- near_jsonrpc_models/rpc_validators_ordered_request.py +6 -0
- near_jsonrpc_models/rpc_view_access_key_error.py +55 -0
- near_jsonrpc_models/rpc_view_access_key_list_error.py +45 -0
- near_jsonrpc_models/rpc_view_access_key_list_request.py +24 -0
- near_jsonrpc_models/rpc_view_access_key_list_response.py +13 -0
- near_jsonrpc_models/rpc_view_access_key_request.py +28 -0
- near_jsonrpc_models/rpc_view_access_key_response.py +13 -0
- near_jsonrpc_models/rpc_view_account_error.py +45 -0
- near_jsonrpc_models/rpc_view_account_request.py +24 -0
- near_jsonrpc_models/rpc_view_account_response.py +20 -0
- near_jsonrpc_models/rpc_view_code_error.py +54 -0
- near_jsonrpc_models/rpc_view_code_request.py +24 -0
- near_jsonrpc_models/rpc_view_code_response.py +12 -0
- near_jsonrpc_models/rpc_view_gas_key_error.py +55 -0
- near_jsonrpc_models/rpc_view_gas_key_list_error.py +45 -0
- near_jsonrpc_models/rpc_view_gas_key_list_request.py +24 -0
- near_jsonrpc_models/rpc_view_gas_key_list_response.py +11 -0
- near_jsonrpc_models/rpc_view_gas_key_request.py +28 -0
- near_jsonrpc_models/rpc_view_gas_key_response.py +15 -0
- near_jsonrpc_models/rpc_view_state_error.py +54 -0
- near_jsonrpc_models/rpc_view_state_request.py +31 -0
- near_jsonrpc_models/rpc_view_state_response.py +14 -0
- near_jsonrpc_models/runtime_config_view.py +30 -0
- near_jsonrpc_models/runtime_fees_config_view.py +29 -0
- near_jsonrpc_models/shard_id.py +16 -0
- near_jsonrpc_models/shard_layout.py +34 -0
- near_jsonrpc_models/shard_layout_v0.py +15 -0
- near_jsonrpc_models/shard_layout_v1.py +22 -0
- near_jsonrpc_models/shard_layout_v2.py +19 -0
- near_jsonrpc_models/shard_layout_v3.py +17 -0
- near_jsonrpc_models/shard_uid.py +17 -0
- near_jsonrpc_models/signature.py +7 -0
- near_jsonrpc_models/signed_delegate_action.py +8 -0
- near_jsonrpc_models/signed_transaction.py +7 -0
- near_jsonrpc_models/signed_transaction_view.py +19 -0
- near_jsonrpc_models/slashed_validator.py +7 -0
- near_jsonrpc_models/stake_action.py +12 -0
- near_jsonrpc_models/state_change_cause_view.py +50 -0
- near_jsonrpc_models/state_change_kind_view.py +31 -0
- near_jsonrpc_models/state_change_with_cause_view.py +129 -0
- near_jsonrpc_models/state_item.py +10 -0
- near_jsonrpc_models/state_sync_config.py +14 -0
- near_jsonrpc_models/status_sync_info.py +17 -0
- near_jsonrpc_models/storage_error.py +46 -0
- near_jsonrpc_models/storage_get_mode.py +9 -0
- near_jsonrpc_models/storage_usage_config_view.py +11 -0
- near_jsonrpc_models/store_key.py +12 -0
- near_jsonrpc_models/store_value.py +12 -0
- near_jsonrpc_models/strict_model.py +5 -0
- near_jsonrpc_models/sync_checkpoint.py +7 -0
- near_jsonrpc_models/sync_concurrency.py +19 -0
- near_jsonrpc_models/sync_config.py +23 -0
- near_jsonrpc_models/tier1proxy_view.py +7 -0
- near_jsonrpc_models/tracked_shards_config.py +42 -0
- near_jsonrpc_models/transfer_action.py +6 -0
- near_jsonrpc_models/transfer_to_gas_key_action.py +8 -0
- near_jsonrpc_models/tx_execution_error.py +21 -0
- near_jsonrpc_models/tx_execution_status.py +14 -0
- near_jsonrpc_models/use_global_contract_action.py +8 -0
- near_jsonrpc_models/validator_info.py +6 -0
- near_jsonrpc_models/validator_kickout_reason.py +67 -0
- near_jsonrpc_models/validator_kickout_view.py +8 -0
- near_jsonrpc_models/validator_stake_view.py +13 -0
- near_jsonrpc_models/validator_stake_view_v1.py +10 -0
- near_jsonrpc_models/version.py +10 -0
- near_jsonrpc_models/view_state_result.py +10 -0
- near_jsonrpc_models/vmconfig_view.py +44 -0
- near_jsonrpc_models/vmkind.py +9 -0
- near_jsonrpc_models/wasm_trap.py +9 -0
- near_jsonrpc_models/witness_config_view.py +17 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
2
|
+
from near_jsonrpc_models.action_view import ActionView
|
|
3
|
+
from near_jsonrpc_models.crypto_hash import CryptoHash
|
|
4
|
+
from near_jsonrpc_models.public_key import PublicKey
|
|
5
|
+
from near_jsonrpc_models.signature import Signature
|
|
6
|
+
from pydantic import BaseModel
|
|
7
|
+
from pydantic import conint
|
|
8
|
+
from typing import List
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class SignedTransactionView(BaseModel):
|
|
12
|
+
actions: List[ActionView]
|
|
13
|
+
hash: CryptoHash
|
|
14
|
+
nonce: conint(ge=0, le=18446744073709551615)
|
|
15
|
+
priority_fee: conint(ge=0, le=18446744073709551615) = 0
|
|
16
|
+
public_key: PublicKey
|
|
17
|
+
receiver_id: AccountId
|
|
18
|
+
signature: Signature
|
|
19
|
+
signer_id: AccountId
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""An action which stakes signer_id tokens and setup's validator public key"""
|
|
2
|
+
|
|
3
|
+
from near_jsonrpc_models.near_token import NearToken
|
|
4
|
+
from near_jsonrpc_models.public_key import PublicKey
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class StakeAction(BaseModel):
|
|
9
|
+
# Validator key which will be used to sign transactions on behalf of signer_id
|
|
10
|
+
public_key: PublicKey
|
|
11
|
+
# Amount of tokens to stake.
|
|
12
|
+
stake: NearToken
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""See crate::types::StateChangeCause for details."""
|
|
2
|
+
|
|
3
|
+
from near_jsonrpc_models.crypto_hash import CryptoHash
|
|
4
|
+
from pydantic import BaseModel
|
|
5
|
+
from pydantic import RootModel
|
|
6
|
+
from typing import Literal
|
|
7
|
+
from typing import Union
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class StateChangeCauseViewType(BaseModel):
|
|
11
|
+
type: Literal['not_writable_to_disk']
|
|
12
|
+
|
|
13
|
+
class StateChangeCauseViewTypeOption(BaseModel):
|
|
14
|
+
type: Literal['initial_state']
|
|
15
|
+
|
|
16
|
+
class StateChangeCauseViewTxHash(BaseModel):
|
|
17
|
+
tx_hash: CryptoHash
|
|
18
|
+
type: Literal['transaction_processing']
|
|
19
|
+
|
|
20
|
+
class StateChangeCauseViewReceiptHash(BaseModel):
|
|
21
|
+
receipt_hash: CryptoHash
|
|
22
|
+
type: Literal['action_receipt_processing_started']
|
|
23
|
+
|
|
24
|
+
class StateChangeCauseViewReceiptHashOption(BaseModel):
|
|
25
|
+
receipt_hash: CryptoHash
|
|
26
|
+
type: Literal['action_receipt_gas_reward']
|
|
27
|
+
|
|
28
|
+
class StateChangeCauseViewReceiptHash1(BaseModel):
|
|
29
|
+
receipt_hash: CryptoHash
|
|
30
|
+
type: Literal['receipt_processing']
|
|
31
|
+
|
|
32
|
+
class StateChangeCauseViewReceiptHash2(BaseModel):
|
|
33
|
+
receipt_hash: CryptoHash
|
|
34
|
+
type: Literal['postponed_receipt']
|
|
35
|
+
|
|
36
|
+
class StateChangeCauseViewType1(BaseModel):
|
|
37
|
+
type: Literal['updated_delayed_receipts']
|
|
38
|
+
|
|
39
|
+
class StateChangeCauseViewType2(BaseModel):
|
|
40
|
+
type: Literal['validator_accounts_update']
|
|
41
|
+
|
|
42
|
+
class StateChangeCauseViewType3(BaseModel):
|
|
43
|
+
type: Literal['migration']
|
|
44
|
+
|
|
45
|
+
class StateChangeCauseViewType4(BaseModel):
|
|
46
|
+
type: Literal['bandwidth_scheduler_state_update']
|
|
47
|
+
|
|
48
|
+
class StateChangeCauseView(RootModel[Union[StateChangeCauseViewType, StateChangeCauseViewTypeOption, StateChangeCauseViewTxHash, StateChangeCauseViewReceiptHash, StateChangeCauseViewReceiptHashOption, StateChangeCauseViewReceiptHash1, StateChangeCauseViewReceiptHash2, StateChangeCauseViewType1, StateChangeCauseViewType2, StateChangeCauseViewType3, StateChangeCauseViewType4]]):
|
|
49
|
+
pass
|
|
50
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""It is a [serializable view] of [`StateChangeKind`].
|
|
2
|
+
|
|
3
|
+
[serializable view]: ./index.html
|
|
4
|
+
[`StateChangeKind`]: ../types/struct.StateChangeKind.html"""
|
|
5
|
+
|
|
6
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
7
|
+
from pydantic import BaseModel
|
|
8
|
+
from pydantic import RootModel
|
|
9
|
+
from typing import Literal
|
|
10
|
+
from typing import Union
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class StateChangeKindViewAccountId(BaseModel):
|
|
14
|
+
account_id: AccountId
|
|
15
|
+
type: Literal['account_touched']
|
|
16
|
+
|
|
17
|
+
class StateChangeKindViewAccountIdOption(BaseModel):
|
|
18
|
+
account_id: AccountId
|
|
19
|
+
type: Literal['access_key_touched']
|
|
20
|
+
|
|
21
|
+
class StateChangeKindViewAccountId1(BaseModel):
|
|
22
|
+
account_id: AccountId
|
|
23
|
+
type: Literal['data_touched']
|
|
24
|
+
|
|
25
|
+
class StateChangeKindViewAccountId2(BaseModel):
|
|
26
|
+
account_id: AccountId
|
|
27
|
+
type: Literal['contract_code_touched']
|
|
28
|
+
|
|
29
|
+
class StateChangeKindView(RootModel[Union[StateChangeKindViewAccountId, StateChangeKindViewAccountIdOption, StateChangeKindViewAccountId1, StateChangeKindViewAccountId2]]):
|
|
30
|
+
pass
|
|
31
|
+
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
from near_jsonrpc_models.access_key_view import AccessKeyView
|
|
2
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
3
|
+
from near_jsonrpc_models.crypto_hash import CryptoHash
|
|
4
|
+
from near_jsonrpc_models.gas_key import GasKey
|
|
5
|
+
from near_jsonrpc_models.near_token import NearToken
|
|
6
|
+
from near_jsonrpc_models.public_key import PublicKey
|
|
7
|
+
from near_jsonrpc_models.state_change_cause_view import StateChangeCauseView
|
|
8
|
+
from near_jsonrpc_models.store_key import StoreKey
|
|
9
|
+
from near_jsonrpc_models.store_value import StoreValue
|
|
10
|
+
from pydantic import BaseModel
|
|
11
|
+
from pydantic import RootModel
|
|
12
|
+
from pydantic import conint
|
|
13
|
+
from typing import Literal
|
|
14
|
+
from typing import Union
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class StateChangeWithCauseViewChangePayload(BaseModel):
|
|
18
|
+
account_id: AccountId
|
|
19
|
+
amount: NearToken
|
|
20
|
+
code_hash: CryptoHash
|
|
21
|
+
global_contract_account_id: AccountId | None = None
|
|
22
|
+
global_contract_hash: CryptoHash | None = None
|
|
23
|
+
locked: NearToken
|
|
24
|
+
# TODO(2271): deprecated.
|
|
25
|
+
storage_paid_at: conint(ge=0, le=18446744073709551615) = 0
|
|
26
|
+
storage_usage: conint(ge=0, le=18446744073709551615)
|
|
27
|
+
|
|
28
|
+
class StateChangeWithCauseViewChange(BaseModel):
|
|
29
|
+
cause: StateChangeCauseView
|
|
30
|
+
# A view of the account
|
|
31
|
+
change: StateChangeWithCauseViewChangePayload
|
|
32
|
+
type: Literal['account_update']
|
|
33
|
+
|
|
34
|
+
class StateChangeWithCauseViewChangeOptionChange(BaseModel):
|
|
35
|
+
account_id: AccountId
|
|
36
|
+
|
|
37
|
+
class StateChangeWithCauseViewChangeOption(BaseModel):
|
|
38
|
+
cause: StateChangeCauseView
|
|
39
|
+
change: StateChangeWithCauseViewChangeOptionChange
|
|
40
|
+
type: Literal['account_deletion']
|
|
41
|
+
|
|
42
|
+
class StateChangeWithCauseViewChange1Change(BaseModel):
|
|
43
|
+
access_key: AccessKeyView
|
|
44
|
+
account_id: AccountId
|
|
45
|
+
public_key: PublicKey
|
|
46
|
+
|
|
47
|
+
class StateChangeWithCauseViewChange1(BaseModel):
|
|
48
|
+
cause: StateChangeCauseView
|
|
49
|
+
change: StateChangeWithCauseViewChange1Change
|
|
50
|
+
type: Literal['access_key_update']
|
|
51
|
+
|
|
52
|
+
class StateChangeWithCauseViewChange2Change(BaseModel):
|
|
53
|
+
account_id: AccountId
|
|
54
|
+
public_key: PublicKey
|
|
55
|
+
|
|
56
|
+
class StateChangeWithCauseViewChange2(BaseModel):
|
|
57
|
+
cause: StateChangeCauseView
|
|
58
|
+
change: StateChangeWithCauseViewChange2Change
|
|
59
|
+
type: Literal['access_key_deletion']
|
|
60
|
+
|
|
61
|
+
class StateChangeWithCauseViewChange3Change(BaseModel):
|
|
62
|
+
account_id: AccountId
|
|
63
|
+
gas_key: GasKey
|
|
64
|
+
public_key: PublicKey
|
|
65
|
+
|
|
66
|
+
class StateChangeWithCauseViewChange3(BaseModel):
|
|
67
|
+
cause: StateChangeCauseView
|
|
68
|
+
change: StateChangeWithCauseViewChange3Change
|
|
69
|
+
type: Literal['gas_key_update']
|
|
70
|
+
|
|
71
|
+
class StateChangeWithCauseViewChange4Change(BaseModel):
|
|
72
|
+
account_id: AccountId
|
|
73
|
+
index: conint(ge=0, le=4294967295)
|
|
74
|
+
nonce: conint(ge=0, le=18446744073709551615)
|
|
75
|
+
public_key: PublicKey
|
|
76
|
+
|
|
77
|
+
class StateChangeWithCauseViewChange4(BaseModel):
|
|
78
|
+
cause: StateChangeCauseView
|
|
79
|
+
change: StateChangeWithCauseViewChange4Change
|
|
80
|
+
type: Literal['gas_key_nonce_update']
|
|
81
|
+
|
|
82
|
+
class StateChangeWithCauseViewChange5Change(BaseModel):
|
|
83
|
+
account_id: AccountId
|
|
84
|
+
public_key: PublicKey
|
|
85
|
+
|
|
86
|
+
class StateChangeWithCauseViewChange5(BaseModel):
|
|
87
|
+
cause: StateChangeCauseView
|
|
88
|
+
change: StateChangeWithCauseViewChange5Change
|
|
89
|
+
type: Literal['gas_key_deletion']
|
|
90
|
+
|
|
91
|
+
class StateChangeWithCauseViewChange6Change(BaseModel):
|
|
92
|
+
account_id: AccountId
|
|
93
|
+
key_base64: StoreKey
|
|
94
|
+
value_base64: StoreValue
|
|
95
|
+
|
|
96
|
+
class StateChangeWithCauseViewChange6(BaseModel):
|
|
97
|
+
cause: StateChangeCauseView
|
|
98
|
+
change: StateChangeWithCauseViewChange6Change
|
|
99
|
+
type: Literal['data_update']
|
|
100
|
+
|
|
101
|
+
class StateChangeWithCauseViewChange7Change(BaseModel):
|
|
102
|
+
account_id: AccountId
|
|
103
|
+
key_base64: StoreKey
|
|
104
|
+
|
|
105
|
+
class StateChangeWithCauseViewChange7(BaseModel):
|
|
106
|
+
cause: StateChangeCauseView
|
|
107
|
+
change: StateChangeWithCauseViewChange7Change
|
|
108
|
+
type: Literal['data_deletion']
|
|
109
|
+
|
|
110
|
+
class StateChangeWithCauseViewChange8Change(BaseModel):
|
|
111
|
+
account_id: AccountId
|
|
112
|
+
code_base64: str
|
|
113
|
+
|
|
114
|
+
class StateChangeWithCauseViewChange8(BaseModel):
|
|
115
|
+
cause: StateChangeCauseView
|
|
116
|
+
change: StateChangeWithCauseViewChange8Change
|
|
117
|
+
type: Literal['contract_code_update']
|
|
118
|
+
|
|
119
|
+
class StateChangeWithCauseViewChange9Change(BaseModel):
|
|
120
|
+
account_id: AccountId
|
|
121
|
+
|
|
122
|
+
class StateChangeWithCauseViewChange9(BaseModel):
|
|
123
|
+
cause: StateChangeCauseView
|
|
124
|
+
change: StateChangeWithCauseViewChange9Change
|
|
125
|
+
type: Literal['contract_code_deletion']
|
|
126
|
+
|
|
127
|
+
class StateChangeWithCauseView(RootModel[Union[StateChangeWithCauseViewChange, StateChangeWithCauseViewChangeOption, StateChangeWithCauseViewChange1, StateChangeWithCauseViewChange2, StateChangeWithCauseViewChange3, StateChangeWithCauseViewChange4, StateChangeWithCauseViewChange5, StateChangeWithCauseViewChange6, StateChangeWithCauseViewChange7, StateChangeWithCauseViewChange8, StateChangeWithCauseViewChange9]]):
|
|
128
|
+
pass
|
|
129
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""Item of the state, key and value are serialized in base64 and proof for inclusion of given state item."""
|
|
2
|
+
|
|
3
|
+
from near_jsonrpc_models.store_key import StoreKey
|
|
4
|
+
from near_jsonrpc_models.store_value import StoreValue
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class StateItem(BaseModel):
|
|
9
|
+
key: StoreKey
|
|
10
|
+
value: StoreValue
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from near_jsonrpc_models.dump_config import DumpConfig
|
|
2
|
+
from near_jsonrpc_models.sync_concurrency import SyncConcurrency
|
|
3
|
+
from near_jsonrpc_models.sync_config import SyncConfig
|
|
4
|
+
from pydantic import BaseModel
|
|
5
|
+
from pydantic import conint
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class StateSyncConfig(BaseModel):
|
|
9
|
+
concurrency: SyncConcurrency = None
|
|
10
|
+
# `none` value disables state dump to external storage.
|
|
11
|
+
dump: DumpConfig | None = None
|
|
12
|
+
# Zstd compression level for state parts.
|
|
13
|
+
parts_compression_lvl: conint(ge=-2147483648, le=2147483647) = 1
|
|
14
|
+
sync: SyncConfig = None
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from near_jsonrpc_models.crypto_hash import CryptoHash
|
|
2
|
+
from near_jsonrpc_models.epoch_id import EpochId
|
|
3
|
+
from pydantic import BaseModel
|
|
4
|
+
from pydantic import conint
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class StatusSyncInfo(BaseModel):
|
|
8
|
+
earliest_block_hash: CryptoHash | None = None
|
|
9
|
+
earliest_block_height: conint(ge=0, le=18446744073709551615) | None = None
|
|
10
|
+
earliest_block_time: str | None = None
|
|
11
|
+
epoch_id: EpochId | None = None
|
|
12
|
+
epoch_start_height: conint(ge=0, le=18446744073709551615) | None = None
|
|
13
|
+
latest_block_hash: CryptoHash
|
|
14
|
+
latest_block_height: conint(ge=0, le=18446744073709551615)
|
|
15
|
+
latest_block_time: str
|
|
16
|
+
latest_state_root: CryptoHash
|
|
17
|
+
syncing: bool
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Errors which may occur during working with trie storages, storing
|
|
2
|
+
trie values (trie nodes and state values) by their hashes."""
|
|
3
|
+
|
|
4
|
+
from near_jsonrpc_models.missing_trie_value import MissingTrieValue
|
|
5
|
+
from near_jsonrpc_models.strict_model import StrictBaseModel
|
|
6
|
+
from pydantic import BaseModel
|
|
7
|
+
from pydantic import RootModel
|
|
8
|
+
from typing import Literal
|
|
9
|
+
from typing import Union
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
"""Key-value db internal failure"""
|
|
13
|
+
class StorageErrorStorageInternalError(RootModel[Literal['StorageInternalError']]):
|
|
14
|
+
pass
|
|
15
|
+
|
|
16
|
+
class StorageErrorMissingTrieValue(StrictBaseModel):
|
|
17
|
+
"""Requested trie value by its hash which is missing in storage."""
|
|
18
|
+
MissingTrieValue: MissingTrieValue
|
|
19
|
+
|
|
20
|
+
"""Found trie node which shouldn't be part of state. Raised during
|
|
21
|
+
validation of state sync parts where incorrect node was passed.
|
|
22
|
+
TODO (#8997): consider including hash of trie node."""
|
|
23
|
+
class StorageErrorUnexpectedTrieValue(RootModel[Literal['UnexpectedTrieValue']]):
|
|
24
|
+
pass
|
|
25
|
+
|
|
26
|
+
class StorageErrorStorageInconsistentState(StrictBaseModel):
|
|
27
|
+
"""Either invalid state or key-value db is corrupted.
|
|
28
|
+
For PartialStorage it cannot be corrupted.
|
|
29
|
+
Error message is unreliable and for debugging purposes only. It's also probably ok to
|
|
30
|
+
panic in every place that produces this error.
|
|
31
|
+
We can check if db is corrupted by verifying everything in the state trie."""
|
|
32
|
+
StorageInconsistentState: str
|
|
33
|
+
|
|
34
|
+
class StorageErrorFlatStorageBlockNotSupported(StrictBaseModel):
|
|
35
|
+
"""Flat storage error, meaning that it doesn't support some block anymore.
|
|
36
|
+
We guarantee that such block cannot become final, thus block processing
|
|
37
|
+
must resume normally."""
|
|
38
|
+
FlatStorageBlockNotSupported: str
|
|
39
|
+
|
|
40
|
+
class StorageErrorMemTrieLoadingError(StrictBaseModel):
|
|
41
|
+
"""In-memory trie could not be loaded for some reason."""
|
|
42
|
+
MemTrieLoadingError: str
|
|
43
|
+
|
|
44
|
+
class StorageError(RootModel[Union[StorageErrorStorageInternalError, StorageErrorMissingTrieValue, StorageErrorUnexpectedTrieValue, StorageErrorStorageInconsistentState, StorageErrorFlatStorageBlockNotSupported, StorageErrorMemTrieLoadingError]]):
|
|
45
|
+
pass
|
|
46
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""Describes cost of storage per block"""
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel
|
|
4
|
+
from pydantic import conint
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class StorageUsageConfigView(BaseModel):
|
|
8
|
+
# Number of bytes for an account record, including rounding up for account id.
|
|
9
|
+
num_bytes_account: conint(ge=0, le=18446744073709551615) = None
|
|
10
|
+
# Additional number of bytes for a k/v record
|
|
11
|
+
num_extra_bytes_record: conint(ge=0, le=18446744073709551615) = None
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""This type is used to mark keys (arrays of bytes) that are queried from store.
|
|
2
|
+
|
|
3
|
+
NOTE: Currently, this type is only used in the view_client and RPC to be able to transparently
|
|
4
|
+
pretty-serialize the bytes arrays as base64-encoded strings (see `serialize.rs`)."""
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel
|
|
7
|
+
from pydantic import RootModel
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class StoreKey(RootModel[str]):
|
|
11
|
+
pass
|
|
12
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""This type is used to mark values returned from store (arrays of bytes).
|
|
2
|
+
|
|
3
|
+
NOTE: Currently, this type is only used in the view_client and RPC to be able to transparently
|
|
4
|
+
pretty-serialize the bytes arrays as base64-encoded strings (see `serialize.rs`)."""
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel
|
|
7
|
+
from pydantic import RootModel
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class StoreValue(RootModel[str]):
|
|
11
|
+
pass
|
|
12
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from pydantic import BaseModel
|
|
2
|
+
from pydantic import conint
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class SyncConcurrency(BaseModel):
|
|
6
|
+
# Maximum number of "apply parts" tasks that can be performed in parallel.
|
|
7
|
+
# This is a very disk-heavy task and therefore we set this to a low limit,
|
|
8
|
+
# or else the rocksdb contention makes the whole server freeze up.
|
|
9
|
+
apply: conint(ge=0, le=255) = None
|
|
10
|
+
# Maximum number of "apply parts" tasks that can be performed in parallel
|
|
11
|
+
# during catchup. We set this to a very low value to avoid overloading the
|
|
12
|
+
# node while it is still performing normal tasks.
|
|
13
|
+
apply_during_catchup: conint(ge=0, le=255) = None
|
|
14
|
+
# Maximum number of outstanding requests for decentralized state sync.
|
|
15
|
+
peer_downloads: conint(ge=0, le=255) = None
|
|
16
|
+
# The maximum parallelism to use per shard. This is mostly for fairness, because
|
|
17
|
+
# the actual rate limiting is done by the TaskTrackers, but this is useful for
|
|
18
|
+
# balancing the shards a little.
|
|
19
|
+
per_shard: conint(ge=0, le=255) = None
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""Configures how to fetch state parts during state sync."""
|
|
2
|
+
|
|
3
|
+
from near_jsonrpc_models.external_storage_config import ExternalStorageConfig
|
|
4
|
+
from near_jsonrpc_models.strict_model import StrictBaseModel
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
from pydantic import RootModel
|
|
7
|
+
from typing import Literal
|
|
8
|
+
from typing import Union
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
"""Syncs state from the peers without reading anything from external storage."""
|
|
12
|
+
class SyncConfigPeers(RootModel[Literal['Peers']]):
|
|
13
|
+
pass
|
|
14
|
+
|
|
15
|
+
class SyncConfigExternalStorage(StrictBaseModel):
|
|
16
|
+
"""Expects parts to be available in external storage.
|
|
17
|
+
|
|
18
|
+
Usually as a fallback after some number of attempts to use peers."""
|
|
19
|
+
ExternalStorage: ExternalStorageConfig
|
|
20
|
+
|
|
21
|
+
class SyncConfig(RootModel[Union[SyncConfigPeers, SyncConfigExternalStorage]]):
|
|
22
|
+
pass
|
|
23
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""Describes the expected behavior of the node regarding shard tracking.
|
|
2
|
+
If the node is an active validator, it will also track the shards it is responsible for as a validator."""
|
|
3
|
+
|
|
4
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
5
|
+
from near_jsonrpc_models.shard_id import ShardId
|
|
6
|
+
from near_jsonrpc_models.shard_uid import ShardUId
|
|
7
|
+
from near_jsonrpc_models.strict_model import StrictBaseModel
|
|
8
|
+
from pydantic import BaseModel
|
|
9
|
+
from pydantic import RootModel
|
|
10
|
+
from typing import List
|
|
11
|
+
from typing import Literal
|
|
12
|
+
from typing import Union
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
"""Tracks no shards (light client)."""
|
|
16
|
+
class TrackedShardsConfigNoShards(RootModel[Literal['NoShards']]):
|
|
17
|
+
pass
|
|
18
|
+
|
|
19
|
+
class TrackedShardsConfigShards(StrictBaseModel):
|
|
20
|
+
"""Tracks arbitrary shards."""
|
|
21
|
+
Shards: List[ShardUId]
|
|
22
|
+
|
|
23
|
+
"""Tracks all shards."""
|
|
24
|
+
class TrackedShardsConfigAllShards(RootModel[Literal['AllShards']]):
|
|
25
|
+
pass
|
|
26
|
+
|
|
27
|
+
class TrackedShardsConfigShadowValidator(StrictBaseModel):
|
|
28
|
+
"""Tracks shards that are assigned to given validator account."""
|
|
29
|
+
ShadowValidator: AccountId
|
|
30
|
+
|
|
31
|
+
class TrackedShardsConfigSchedule(StrictBaseModel):
|
|
32
|
+
"""Rotate between these sets of tracked shards.
|
|
33
|
+
Used to simulate the behavior of chunk only producers without staking tokens."""
|
|
34
|
+
Schedule: List[List[ShardId]]
|
|
35
|
+
|
|
36
|
+
class TrackedShardsConfigAccounts(StrictBaseModel):
|
|
37
|
+
"""Tracks shards that contain one of the given account."""
|
|
38
|
+
Accounts: List[AccountId]
|
|
39
|
+
|
|
40
|
+
class TrackedShardsConfig(RootModel[Union[TrackedShardsConfigNoShards, TrackedShardsConfigShards, TrackedShardsConfigAllShards, TrackedShardsConfigShadowValidator, TrackedShardsConfigSchedule, TrackedShardsConfigAccounts]]):
|
|
41
|
+
pass
|
|
42
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""Error returned in the ExecutionOutcome in case of failure"""
|
|
2
|
+
|
|
3
|
+
from near_jsonrpc_models.action_error import ActionError
|
|
4
|
+
from near_jsonrpc_models.invalid_tx_error import InvalidTxError
|
|
5
|
+
from near_jsonrpc_models.strict_model import StrictBaseModel
|
|
6
|
+
from pydantic import BaseModel
|
|
7
|
+
from pydantic import RootModel
|
|
8
|
+
from typing import Union
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class TxExecutionErrorActionError(StrictBaseModel):
|
|
12
|
+
"""An error happened during Action execution"""
|
|
13
|
+
ActionError: ActionError
|
|
14
|
+
|
|
15
|
+
class TxExecutionErrorInvalidTxError(StrictBaseModel):
|
|
16
|
+
"""An error happened during Transaction execution"""
|
|
17
|
+
InvalidTxError: InvalidTxError
|
|
18
|
+
|
|
19
|
+
class TxExecutionError(RootModel[Union[TxExecutionErrorActionError, TxExecutionErrorInvalidTxError]]):
|
|
20
|
+
pass
|
|
21
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""NONE: Transaction is waiting to be included into the blockINCLUDED: Transaction is included into the block. The block may be not finalized yetEXECUTED_OPTIMISTIC: Transaction is included into the block +
|
|
2
|
+
All non-refund transaction receipts finished their execution.
|
|
3
|
+
The corresponding blocks for tx and each receipt may be not finalized yetINCLUDED_FINAL: Transaction is included into finalized blockEXECUTED: Transaction is included into finalized block +
|
|
4
|
+
All non-refund transaction receipts finished their execution.
|
|
5
|
+
The corresponding blocks for each receipt may be not finalized yetFINAL: Transaction is included into finalized block +
|
|
6
|
+
Execution of all transaction receipts is finalized, including refund receipts"""
|
|
7
|
+
|
|
8
|
+
from pydantic import RootModel
|
|
9
|
+
from typing import Literal
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class TxExecutionStatus(RootModel[Literal['NONE', 'INCLUDED', 'EXECUTED_OPTIMISTIC', 'INCLUDED_FINAL', 'EXECUTED', 'FINAL']]):
|
|
13
|
+
pass
|
|
14
|
+
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""Reasons for removing a validator from the validator set."""
|
|
2
|
+
|
|
3
|
+
from near_jsonrpc_models.near_token import NearToken
|
|
4
|
+
from near_jsonrpc_models.strict_model import StrictBaseModel
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
from pydantic import RootModel
|
|
7
|
+
from pydantic import conint
|
|
8
|
+
from typing import Literal
|
|
9
|
+
from typing import Union
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
"""Deprecated"""
|
|
13
|
+
class ValidatorKickoutReasonUnusedSlashed(RootModel[Literal['_UnusedSlashed']]):
|
|
14
|
+
pass
|
|
15
|
+
|
|
16
|
+
class ValidatorKickoutReasonNotEnoughBlocksPayload(BaseModel):
|
|
17
|
+
expected: conint(ge=0, le=18446744073709551615)
|
|
18
|
+
produced: conint(ge=0, le=18446744073709551615)
|
|
19
|
+
|
|
20
|
+
class ValidatorKickoutReasonNotEnoughBlocks(StrictBaseModel):
|
|
21
|
+
"""Validator didn't produce enough blocks."""
|
|
22
|
+
NotEnoughBlocks: ValidatorKickoutReasonNotEnoughBlocksPayload
|
|
23
|
+
|
|
24
|
+
class ValidatorKickoutReasonNotEnoughChunksPayload(BaseModel):
|
|
25
|
+
expected: conint(ge=0, le=18446744073709551615)
|
|
26
|
+
produced: conint(ge=0, le=18446744073709551615)
|
|
27
|
+
|
|
28
|
+
class ValidatorKickoutReasonNotEnoughChunks(StrictBaseModel):
|
|
29
|
+
"""Validator didn't produce enough chunks."""
|
|
30
|
+
NotEnoughChunks: ValidatorKickoutReasonNotEnoughChunksPayload
|
|
31
|
+
|
|
32
|
+
"""Validator unstaked themselves."""
|
|
33
|
+
class ValidatorKickoutReasonUnstaked(RootModel[Literal['Unstaked']]):
|
|
34
|
+
pass
|
|
35
|
+
|
|
36
|
+
class ValidatorKickoutReasonNotEnoughStakePayload(BaseModel):
|
|
37
|
+
stake_u128: NearToken
|
|
38
|
+
threshold_u128: NearToken
|
|
39
|
+
|
|
40
|
+
class ValidatorKickoutReasonNotEnoughStake(StrictBaseModel):
|
|
41
|
+
"""Validator stake is now below threshold"""
|
|
42
|
+
NotEnoughStake: ValidatorKickoutReasonNotEnoughStakePayload
|
|
43
|
+
|
|
44
|
+
"""Enough stake but is not chosen because of seat limits."""
|
|
45
|
+
class ValidatorKickoutReasonDidNotGetASeat(RootModel[Literal['DidNotGetASeat']]):
|
|
46
|
+
pass
|
|
47
|
+
|
|
48
|
+
class ValidatorKickoutReasonNotEnoughChunkEndorsementsPayload(BaseModel):
|
|
49
|
+
expected: conint(ge=0, le=18446744073709551615)
|
|
50
|
+
produced: conint(ge=0, le=18446744073709551615)
|
|
51
|
+
|
|
52
|
+
class ValidatorKickoutReasonNotEnoughChunkEndorsements(StrictBaseModel):
|
|
53
|
+
"""Validator didn't produce enough chunk endorsements."""
|
|
54
|
+
NotEnoughChunkEndorsements: ValidatorKickoutReasonNotEnoughChunkEndorsementsPayload
|
|
55
|
+
|
|
56
|
+
class ValidatorKickoutReasonProtocolVersionTooOldPayload(BaseModel):
|
|
57
|
+
network_version: conint(ge=0, le=4294967295)
|
|
58
|
+
version: conint(ge=0, le=4294967295)
|
|
59
|
+
|
|
60
|
+
class ValidatorKickoutReasonProtocolVersionTooOld(StrictBaseModel):
|
|
61
|
+
"""Validator's last block proposal was for a protocol version older than
|
|
62
|
+
the network's voted protocol version."""
|
|
63
|
+
ProtocolVersionTooOld: ValidatorKickoutReasonProtocolVersionTooOldPayload
|
|
64
|
+
|
|
65
|
+
class ValidatorKickoutReason(RootModel[Union[ValidatorKickoutReasonUnusedSlashed, ValidatorKickoutReasonNotEnoughBlocks, ValidatorKickoutReasonNotEnoughChunks, ValidatorKickoutReasonUnstaked, ValidatorKickoutReasonNotEnoughStake, ValidatorKickoutReasonDidNotGetASeat, ValidatorKickoutReasonNotEnoughChunkEndorsements, ValidatorKickoutReasonProtocolVersionTooOld]]):
|
|
66
|
+
pass
|
|
67
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
2
|
+
from near_jsonrpc_models.validator_kickout_reason import ValidatorKickoutReason
|
|
3
|
+
from pydantic import BaseModel
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ValidatorKickoutView(BaseModel):
|
|
7
|
+
account_id: AccountId
|
|
8
|
+
reason: ValidatorKickoutReason
|