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,24 @@
|
|
|
1
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
2
|
+
from near_jsonrpc_models.block_id import BlockId
|
|
3
|
+
from near_jsonrpc_models.finality import Finality
|
|
4
|
+
from near_jsonrpc_models.sync_checkpoint import SyncCheckpoint
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
from pydantic import RootModel
|
|
7
|
+
from typing import Union
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class RpcViewAccountRequestBlockId(BaseModel):
|
|
11
|
+
account_id: AccountId
|
|
12
|
+
block_id: BlockId
|
|
13
|
+
|
|
14
|
+
class RpcViewAccountRequestFinality(BaseModel):
|
|
15
|
+
account_id: AccountId
|
|
16
|
+
finality: Finality
|
|
17
|
+
|
|
18
|
+
class RpcViewAccountRequestSyncCheckpoint(BaseModel):
|
|
19
|
+
account_id: AccountId
|
|
20
|
+
sync_checkpoint: SyncCheckpoint
|
|
21
|
+
|
|
22
|
+
class RpcViewAccountRequest(RootModel[Union[RpcViewAccountRequestBlockId, RpcViewAccountRequestFinality, RpcViewAccountRequestSyncCheckpoint]]):
|
|
23
|
+
pass
|
|
24
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""A view of the account"""
|
|
2
|
+
|
|
3
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
4
|
+
from near_jsonrpc_models.crypto_hash import CryptoHash
|
|
5
|
+
from near_jsonrpc_models.near_token import NearToken
|
|
6
|
+
from pydantic import BaseModel
|
|
7
|
+
from pydantic import conint
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class RpcViewAccountResponse(BaseModel):
|
|
11
|
+
amount: NearToken
|
|
12
|
+
block_hash: CryptoHash
|
|
13
|
+
block_height: conint(ge=0, le=18446744073709551615)
|
|
14
|
+
code_hash: CryptoHash
|
|
15
|
+
global_contract_account_id: AccountId | None = None
|
|
16
|
+
global_contract_hash: CryptoHash | None = None
|
|
17
|
+
locked: NearToken
|
|
18
|
+
# TODO(2271): deprecated.
|
|
19
|
+
storage_paid_at: conint(ge=0, le=18446744073709551615) = 0
|
|
20
|
+
storage_usage: conint(ge=0, le=18446744073709551615)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
2
|
+
from near_jsonrpc_models.block_reference import BlockReference
|
|
3
|
+
from near_jsonrpc_models.crypto_hash import CryptoHash
|
|
4
|
+
from pydantic import BaseModel
|
|
5
|
+
from pydantic import RootModel
|
|
6
|
+
from pydantic import conint
|
|
7
|
+
from typing import Literal
|
|
8
|
+
from typing import Union
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class RpcViewCodeErrorUnknownBlockInfo(BaseModel):
|
|
12
|
+
block_reference: BlockReference
|
|
13
|
+
|
|
14
|
+
class RpcViewCodeErrorUnknownBlock(BaseModel):
|
|
15
|
+
info: RpcViewCodeErrorUnknownBlockInfo
|
|
16
|
+
name: Literal['UNKNOWN_BLOCK']
|
|
17
|
+
|
|
18
|
+
class RpcViewCodeErrorInvalidAccountInfo(BaseModel):
|
|
19
|
+
block_hash: CryptoHash
|
|
20
|
+
block_height: conint(ge=0, le=18446744073709551615)
|
|
21
|
+
requested_account_id: AccountId
|
|
22
|
+
|
|
23
|
+
class RpcViewCodeErrorInvalidAccount(BaseModel):
|
|
24
|
+
info: RpcViewCodeErrorInvalidAccountInfo
|
|
25
|
+
name: Literal['INVALID_ACCOUNT']
|
|
26
|
+
|
|
27
|
+
class RpcViewCodeErrorUnknownAccountInfo(BaseModel):
|
|
28
|
+
block_hash: CryptoHash
|
|
29
|
+
block_height: conint(ge=0, le=18446744073709551615)
|
|
30
|
+
requested_account_id: AccountId
|
|
31
|
+
|
|
32
|
+
class RpcViewCodeErrorUnknownAccount(BaseModel):
|
|
33
|
+
info: RpcViewCodeErrorUnknownAccountInfo
|
|
34
|
+
name: Literal['UNKNOWN_ACCOUNT']
|
|
35
|
+
|
|
36
|
+
class RpcViewCodeErrorNoContractCodeInfo(BaseModel):
|
|
37
|
+
block_hash: CryptoHash
|
|
38
|
+
block_height: conint(ge=0, le=18446744073709551615)
|
|
39
|
+
contract_account_id: AccountId
|
|
40
|
+
|
|
41
|
+
class RpcViewCodeErrorNoContractCode(BaseModel):
|
|
42
|
+
info: RpcViewCodeErrorNoContractCodeInfo
|
|
43
|
+
name: Literal['NO_CONTRACT_CODE']
|
|
44
|
+
|
|
45
|
+
class RpcViewCodeErrorInternalErrorInfo(BaseModel):
|
|
46
|
+
error_message: str
|
|
47
|
+
|
|
48
|
+
class RpcViewCodeErrorInternalError(BaseModel):
|
|
49
|
+
info: RpcViewCodeErrorInternalErrorInfo
|
|
50
|
+
name: Literal['INTERNAL_ERROR']
|
|
51
|
+
|
|
52
|
+
class RpcViewCodeError(RootModel[Union[RpcViewCodeErrorUnknownBlock, RpcViewCodeErrorInvalidAccount, RpcViewCodeErrorUnknownAccount, RpcViewCodeErrorNoContractCode, RpcViewCodeErrorInternalError]]):
|
|
53
|
+
pass
|
|
54
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
2
|
+
from near_jsonrpc_models.block_id import BlockId
|
|
3
|
+
from near_jsonrpc_models.finality import Finality
|
|
4
|
+
from near_jsonrpc_models.sync_checkpoint import SyncCheckpoint
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
from pydantic import RootModel
|
|
7
|
+
from typing import Union
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class RpcViewCodeRequestBlockId(BaseModel):
|
|
11
|
+
account_id: AccountId
|
|
12
|
+
block_id: BlockId
|
|
13
|
+
|
|
14
|
+
class RpcViewCodeRequestFinality(BaseModel):
|
|
15
|
+
account_id: AccountId
|
|
16
|
+
finality: Finality
|
|
17
|
+
|
|
18
|
+
class RpcViewCodeRequestSyncCheckpoint(BaseModel):
|
|
19
|
+
account_id: AccountId
|
|
20
|
+
sync_checkpoint: SyncCheckpoint
|
|
21
|
+
|
|
22
|
+
class RpcViewCodeRequest(RootModel[Union[RpcViewCodeRequestBlockId, RpcViewCodeRequestFinality, RpcViewCodeRequestSyncCheckpoint]]):
|
|
23
|
+
pass
|
|
24
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""A view of the contract code."""
|
|
2
|
+
|
|
3
|
+
from near_jsonrpc_models.crypto_hash import CryptoHash
|
|
4
|
+
from pydantic import BaseModel
|
|
5
|
+
from pydantic import conint
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class RpcViewCodeResponse(BaseModel):
|
|
9
|
+
block_hash: CryptoHash
|
|
10
|
+
block_height: conint(ge=0, le=18446744073709551615)
|
|
11
|
+
code_base64: str
|
|
12
|
+
hash: CryptoHash
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
2
|
+
from near_jsonrpc_models.block_reference import BlockReference
|
|
3
|
+
from near_jsonrpc_models.crypto_hash import CryptoHash
|
|
4
|
+
from near_jsonrpc_models.public_key import PublicKey
|
|
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
|
+
class RpcViewGasKeyErrorUnknownBlockInfo(BaseModel):
|
|
13
|
+
block_reference: BlockReference
|
|
14
|
+
|
|
15
|
+
class RpcViewGasKeyErrorUnknownBlock(BaseModel):
|
|
16
|
+
info: RpcViewGasKeyErrorUnknownBlockInfo
|
|
17
|
+
name: Literal['UNKNOWN_BLOCK']
|
|
18
|
+
|
|
19
|
+
class RpcViewGasKeyErrorInvalidAccountInfo(BaseModel):
|
|
20
|
+
block_hash: CryptoHash
|
|
21
|
+
block_height: conint(ge=0, le=18446744073709551615)
|
|
22
|
+
requested_account_id: AccountId
|
|
23
|
+
|
|
24
|
+
class RpcViewGasKeyErrorInvalidAccount(BaseModel):
|
|
25
|
+
info: RpcViewGasKeyErrorInvalidAccountInfo
|
|
26
|
+
name: Literal['INVALID_ACCOUNT']
|
|
27
|
+
|
|
28
|
+
class RpcViewGasKeyErrorUnknownAccountInfo(BaseModel):
|
|
29
|
+
block_hash: CryptoHash
|
|
30
|
+
block_height: conint(ge=0, le=18446744073709551615)
|
|
31
|
+
requested_account_id: AccountId
|
|
32
|
+
|
|
33
|
+
class RpcViewGasKeyErrorUnknownAccount(BaseModel):
|
|
34
|
+
info: RpcViewGasKeyErrorUnknownAccountInfo
|
|
35
|
+
name: Literal['UNKNOWN_ACCOUNT']
|
|
36
|
+
|
|
37
|
+
class RpcViewGasKeyErrorUnknownGasKeyInfo(BaseModel):
|
|
38
|
+
block_hash: CryptoHash
|
|
39
|
+
block_height: conint(ge=0, le=18446744073709551615)
|
|
40
|
+
public_key: PublicKey
|
|
41
|
+
|
|
42
|
+
class RpcViewGasKeyErrorUnknownGasKey(BaseModel):
|
|
43
|
+
info: RpcViewGasKeyErrorUnknownGasKeyInfo
|
|
44
|
+
name: Literal['UNKNOWN_GAS_KEY']
|
|
45
|
+
|
|
46
|
+
class RpcViewGasKeyErrorInternalErrorInfo(BaseModel):
|
|
47
|
+
error_message: str
|
|
48
|
+
|
|
49
|
+
class RpcViewGasKeyErrorInternalError(BaseModel):
|
|
50
|
+
info: RpcViewGasKeyErrorInternalErrorInfo
|
|
51
|
+
name: Literal['INTERNAL_ERROR']
|
|
52
|
+
|
|
53
|
+
class RpcViewGasKeyError(RootModel[Union[RpcViewGasKeyErrorUnknownBlock, RpcViewGasKeyErrorInvalidAccount, RpcViewGasKeyErrorUnknownAccount, RpcViewGasKeyErrorUnknownGasKey, RpcViewGasKeyErrorInternalError]]):
|
|
54
|
+
pass
|
|
55
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
2
|
+
from near_jsonrpc_models.block_reference import BlockReference
|
|
3
|
+
from near_jsonrpc_models.crypto_hash import CryptoHash
|
|
4
|
+
from pydantic import BaseModel
|
|
5
|
+
from pydantic import RootModel
|
|
6
|
+
from pydantic import conint
|
|
7
|
+
from typing import Literal
|
|
8
|
+
from typing import Union
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class RpcViewGasKeyListErrorUnknownBlockInfo(BaseModel):
|
|
12
|
+
block_reference: BlockReference
|
|
13
|
+
|
|
14
|
+
class RpcViewGasKeyListErrorUnknownBlock(BaseModel):
|
|
15
|
+
info: RpcViewGasKeyListErrorUnknownBlockInfo
|
|
16
|
+
name: Literal['UNKNOWN_BLOCK']
|
|
17
|
+
|
|
18
|
+
class RpcViewGasKeyListErrorInvalidAccountInfo(BaseModel):
|
|
19
|
+
block_hash: CryptoHash
|
|
20
|
+
block_height: conint(ge=0, le=18446744073709551615)
|
|
21
|
+
requested_account_id: AccountId
|
|
22
|
+
|
|
23
|
+
class RpcViewGasKeyListErrorInvalidAccount(BaseModel):
|
|
24
|
+
info: RpcViewGasKeyListErrorInvalidAccountInfo
|
|
25
|
+
name: Literal['INVALID_ACCOUNT']
|
|
26
|
+
|
|
27
|
+
class RpcViewGasKeyListErrorUnknownAccountInfo(BaseModel):
|
|
28
|
+
block_hash: CryptoHash
|
|
29
|
+
block_height: conint(ge=0, le=18446744073709551615)
|
|
30
|
+
requested_account_id: AccountId
|
|
31
|
+
|
|
32
|
+
class RpcViewGasKeyListErrorUnknownAccount(BaseModel):
|
|
33
|
+
info: RpcViewGasKeyListErrorUnknownAccountInfo
|
|
34
|
+
name: Literal['UNKNOWN_ACCOUNT']
|
|
35
|
+
|
|
36
|
+
class RpcViewGasKeyListErrorInternalErrorInfo(BaseModel):
|
|
37
|
+
error_message: str
|
|
38
|
+
|
|
39
|
+
class RpcViewGasKeyListErrorInternalError(BaseModel):
|
|
40
|
+
info: RpcViewGasKeyListErrorInternalErrorInfo
|
|
41
|
+
name: Literal['INTERNAL_ERROR']
|
|
42
|
+
|
|
43
|
+
class RpcViewGasKeyListError(RootModel[Union[RpcViewGasKeyListErrorUnknownBlock, RpcViewGasKeyListErrorInvalidAccount, RpcViewGasKeyListErrorUnknownAccount, RpcViewGasKeyListErrorInternalError]]):
|
|
44
|
+
pass
|
|
45
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
2
|
+
from near_jsonrpc_models.block_id import BlockId
|
|
3
|
+
from near_jsonrpc_models.finality import Finality
|
|
4
|
+
from near_jsonrpc_models.sync_checkpoint import SyncCheckpoint
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
from pydantic import RootModel
|
|
7
|
+
from typing import Union
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class RpcViewGasKeyListRequestBlockId(BaseModel):
|
|
11
|
+
account_id: AccountId
|
|
12
|
+
block_id: BlockId
|
|
13
|
+
|
|
14
|
+
class RpcViewGasKeyListRequestFinality(BaseModel):
|
|
15
|
+
account_id: AccountId
|
|
16
|
+
finality: Finality
|
|
17
|
+
|
|
18
|
+
class RpcViewGasKeyListRequestSyncCheckpoint(BaseModel):
|
|
19
|
+
account_id: AccountId
|
|
20
|
+
sync_checkpoint: SyncCheckpoint
|
|
21
|
+
|
|
22
|
+
class RpcViewGasKeyListRequest(RootModel[Union[RpcViewGasKeyListRequestBlockId, RpcViewGasKeyListRequestFinality, RpcViewGasKeyListRequestSyncCheckpoint]]):
|
|
23
|
+
pass
|
|
24
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from near_jsonrpc_models.crypto_hash import CryptoHash
|
|
2
|
+
from near_jsonrpc_models.gas_key_info_view import GasKeyInfoView
|
|
3
|
+
from pydantic import BaseModel
|
|
4
|
+
from pydantic import conint
|
|
5
|
+
from typing import List
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class RpcViewGasKeyListResponse(BaseModel):
|
|
9
|
+
block_hash: CryptoHash
|
|
10
|
+
block_height: conint(ge=0, le=18446744073709551615)
|
|
11
|
+
keys: List[GasKeyInfoView]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
2
|
+
from near_jsonrpc_models.block_id import BlockId
|
|
3
|
+
from near_jsonrpc_models.finality import Finality
|
|
4
|
+
from near_jsonrpc_models.public_key import PublicKey
|
|
5
|
+
from near_jsonrpc_models.sync_checkpoint import SyncCheckpoint
|
|
6
|
+
from pydantic import BaseModel
|
|
7
|
+
from pydantic import RootModel
|
|
8
|
+
from typing import Union
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class RpcViewGasKeyRequestBlockId(BaseModel):
|
|
12
|
+
account_id: AccountId
|
|
13
|
+
public_key: PublicKey
|
|
14
|
+
block_id: BlockId
|
|
15
|
+
|
|
16
|
+
class RpcViewGasKeyRequestFinality(BaseModel):
|
|
17
|
+
account_id: AccountId
|
|
18
|
+
public_key: PublicKey
|
|
19
|
+
finality: Finality
|
|
20
|
+
|
|
21
|
+
class RpcViewGasKeyRequestSyncCheckpoint(BaseModel):
|
|
22
|
+
account_id: AccountId
|
|
23
|
+
public_key: PublicKey
|
|
24
|
+
sync_checkpoint: SyncCheckpoint
|
|
25
|
+
|
|
26
|
+
class RpcViewGasKeyRequest(RootModel[Union[RpcViewGasKeyRequestBlockId, RpcViewGasKeyRequestFinality, RpcViewGasKeyRequestSyncCheckpoint]]):
|
|
27
|
+
pass
|
|
28
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from near_jsonrpc_models.access_key_permission_view import AccessKeyPermissionView
|
|
2
|
+
from near_jsonrpc_models.crypto_hash import CryptoHash
|
|
3
|
+
from near_jsonrpc_models.near_token import NearToken
|
|
4
|
+
from pydantic import BaseModel
|
|
5
|
+
from pydantic import conint
|
|
6
|
+
from typing import List
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class RpcViewGasKeyResponse(BaseModel):
|
|
10
|
+
balance: NearToken
|
|
11
|
+
block_hash: CryptoHash
|
|
12
|
+
block_height: conint(ge=0, le=18446744073709551615)
|
|
13
|
+
nonces: List[conint(ge=0, le=18446744073709551615)]
|
|
14
|
+
num_nonces: conint(ge=0, le=4294967295)
|
|
15
|
+
permission: AccessKeyPermissionView
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
2
|
+
from near_jsonrpc_models.block_reference import BlockReference
|
|
3
|
+
from near_jsonrpc_models.crypto_hash import CryptoHash
|
|
4
|
+
from pydantic import BaseModel
|
|
5
|
+
from pydantic import RootModel
|
|
6
|
+
from pydantic import conint
|
|
7
|
+
from typing import Literal
|
|
8
|
+
from typing import Union
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class RpcViewStateErrorUnknownBlockInfo(BaseModel):
|
|
12
|
+
block_reference: BlockReference
|
|
13
|
+
|
|
14
|
+
class RpcViewStateErrorUnknownBlock(BaseModel):
|
|
15
|
+
info: RpcViewStateErrorUnknownBlockInfo
|
|
16
|
+
name: Literal['UNKNOWN_BLOCK']
|
|
17
|
+
|
|
18
|
+
class RpcViewStateErrorInvalidAccountInfo(BaseModel):
|
|
19
|
+
block_hash: CryptoHash
|
|
20
|
+
block_height: conint(ge=0, le=18446744073709551615)
|
|
21
|
+
requested_account_id: AccountId
|
|
22
|
+
|
|
23
|
+
class RpcViewStateErrorInvalidAccount(BaseModel):
|
|
24
|
+
info: RpcViewStateErrorInvalidAccountInfo
|
|
25
|
+
name: Literal['INVALID_ACCOUNT']
|
|
26
|
+
|
|
27
|
+
class RpcViewStateErrorUnknownAccountInfo(BaseModel):
|
|
28
|
+
block_hash: CryptoHash
|
|
29
|
+
block_height: conint(ge=0, le=18446744073709551615)
|
|
30
|
+
requested_account_id: AccountId
|
|
31
|
+
|
|
32
|
+
class RpcViewStateErrorUnknownAccount(BaseModel):
|
|
33
|
+
info: RpcViewStateErrorUnknownAccountInfo
|
|
34
|
+
name: Literal['UNKNOWN_ACCOUNT']
|
|
35
|
+
|
|
36
|
+
class RpcViewStateErrorTooLargeContractStateInfo(BaseModel):
|
|
37
|
+
block_hash: CryptoHash
|
|
38
|
+
block_height: conint(ge=0, le=18446744073709551615)
|
|
39
|
+
contract_account_id: AccountId
|
|
40
|
+
|
|
41
|
+
class RpcViewStateErrorTooLargeContractState(BaseModel):
|
|
42
|
+
info: RpcViewStateErrorTooLargeContractStateInfo
|
|
43
|
+
name: Literal['TOO_LARGE_CONTRACT_STATE']
|
|
44
|
+
|
|
45
|
+
class RpcViewStateErrorInternalErrorInfo(BaseModel):
|
|
46
|
+
error_message: str
|
|
47
|
+
|
|
48
|
+
class RpcViewStateErrorInternalError(BaseModel):
|
|
49
|
+
info: RpcViewStateErrorInternalErrorInfo
|
|
50
|
+
name: Literal['INTERNAL_ERROR']
|
|
51
|
+
|
|
52
|
+
class RpcViewStateError(RootModel[Union[RpcViewStateErrorUnknownBlock, RpcViewStateErrorInvalidAccount, RpcViewStateErrorUnknownAccount, RpcViewStateErrorTooLargeContractState, RpcViewStateErrorInternalError]]):
|
|
53
|
+
pass
|
|
54
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
2
|
+
from near_jsonrpc_models.block_id import BlockId
|
|
3
|
+
from near_jsonrpc_models.finality import Finality
|
|
4
|
+
from near_jsonrpc_models.store_key import StoreKey
|
|
5
|
+
from near_jsonrpc_models.sync_checkpoint import SyncCheckpoint
|
|
6
|
+
from pydantic import BaseModel
|
|
7
|
+
from pydantic import RootModel
|
|
8
|
+
from typing import Union
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class RpcViewStateRequestBlockId(BaseModel):
|
|
12
|
+
account_id: AccountId
|
|
13
|
+
include_proof: bool = False
|
|
14
|
+
prefix_base64: StoreKey
|
|
15
|
+
block_id: BlockId
|
|
16
|
+
|
|
17
|
+
class RpcViewStateRequestFinality(BaseModel):
|
|
18
|
+
account_id: AccountId
|
|
19
|
+
include_proof: bool = False
|
|
20
|
+
prefix_base64: StoreKey
|
|
21
|
+
finality: Finality
|
|
22
|
+
|
|
23
|
+
class RpcViewStateRequestSyncCheckpoint(BaseModel):
|
|
24
|
+
account_id: AccountId
|
|
25
|
+
include_proof: bool = False
|
|
26
|
+
prefix_base64: StoreKey
|
|
27
|
+
sync_checkpoint: SyncCheckpoint
|
|
28
|
+
|
|
29
|
+
class RpcViewStateRequest(RootModel[Union[RpcViewStateRequestBlockId, RpcViewStateRequestFinality, RpcViewStateRequestSyncCheckpoint]]):
|
|
30
|
+
pass
|
|
31
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Resulting state values for a view state query request"""
|
|
2
|
+
|
|
3
|
+
from near_jsonrpc_models.crypto_hash import CryptoHash
|
|
4
|
+
from near_jsonrpc_models.state_item import StateItem
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
from pydantic import conint
|
|
7
|
+
from typing import List
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class RpcViewStateResponse(BaseModel):
|
|
11
|
+
block_hash: CryptoHash
|
|
12
|
+
block_height: conint(ge=0, le=18446744073709551615)
|
|
13
|
+
proof: List[str] = None
|
|
14
|
+
values: List[StateItem]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""View that preserves JSON format of the runtime config."""
|
|
2
|
+
|
|
3
|
+
from near_jsonrpc_models.account_creation_config_view import AccountCreationConfigView
|
|
4
|
+
from near_jsonrpc_models.congestion_control_config_view import CongestionControlConfigView
|
|
5
|
+
from near_jsonrpc_models.dynamic_resharding_config_view import DynamicReshardingConfigView
|
|
6
|
+
from near_jsonrpc_models.near_token import NearToken
|
|
7
|
+
from near_jsonrpc_models.runtime_fees_config_view import RuntimeFeesConfigView
|
|
8
|
+
from near_jsonrpc_models.vmconfig_view import VMConfigView
|
|
9
|
+
from near_jsonrpc_models.witness_config_view import WitnessConfigView
|
|
10
|
+
from pydantic import BaseModel
|
|
11
|
+
from pydantic import Field
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class RuntimeConfigView(BaseModel):
|
|
15
|
+
# Config that defines rules for account creation.
|
|
16
|
+
account_creation_config: AccountCreationConfigView = None
|
|
17
|
+
# The configuration for congestion control.
|
|
18
|
+
congestion_control_config: CongestionControlConfigView = None
|
|
19
|
+
# Configuration for dynamic resharding feature.
|
|
20
|
+
dynamic_resharding_config: DynamicReshardingConfigView = Field(default_factory=lambda: DynamicReshardingConfigView(**{'max_number_of_shards': 999999999999999, 'memory_usage_threshold': 999999999999999, 'min_child_memory_usage': 999999999999999, 'min_epochs_between_resharding': 999999999999999}))
|
|
21
|
+
# Amount of yN per byte required to have on the account. See
|
|
22
|
+
# <https://nomicon.io/Economics/Economics.html#state-stake> for details.
|
|
23
|
+
storage_amount_per_byte: NearToken = None
|
|
24
|
+
# Costs of different actions that need to be performed when sending and
|
|
25
|
+
# processing transaction and receipts.
|
|
26
|
+
transaction_costs: RuntimeFeesConfigView = None
|
|
27
|
+
# Config of wasm operations.
|
|
28
|
+
wasm_config: VMConfigView = None
|
|
29
|
+
# Configuration specific to ChunkStateWitness.
|
|
30
|
+
witness_config: WitnessConfigView = None
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Describes different fees for the runtime"""
|
|
2
|
+
|
|
3
|
+
from near_jsonrpc_models.action_creation_config_view import ActionCreationConfigView
|
|
4
|
+
from near_jsonrpc_models.data_receipt_creation_config_view import DataReceiptCreationConfigView
|
|
5
|
+
from near_jsonrpc_models.fee import Fee
|
|
6
|
+
from near_jsonrpc_models.storage_usage_config_view import StorageUsageConfigView
|
|
7
|
+
from pydantic import BaseModel
|
|
8
|
+
from pydantic import conint
|
|
9
|
+
from pydantic import conlist
|
|
10
|
+
from typing import List
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class RuntimeFeesConfigView(BaseModel):
|
|
14
|
+
# Describes the cost of creating a certain action, `Action`. Includes all variants.
|
|
15
|
+
action_creation_config: ActionCreationConfigView = None
|
|
16
|
+
# Describes the cost of creating an action receipt, `ActionReceipt`, excluding the actual cost
|
|
17
|
+
# of actions.
|
|
18
|
+
# - `send` cost is burned when a receipt is created using `promise_create` or
|
|
19
|
+
# `promise_batch_create`
|
|
20
|
+
# - `exec` cost is burned when the receipt is being executed.
|
|
21
|
+
action_receipt_creation_config: Fee = None
|
|
22
|
+
# Fraction of the burnt gas to reward to the contract account for execution.
|
|
23
|
+
burnt_gas_reward: conlist(conint(ge=-2147483648, le=2147483647), min_length=2, max_length=2) = None
|
|
24
|
+
# Describes the cost of creating a data receipt, `DataReceipt`.
|
|
25
|
+
data_receipt_creation_config: DataReceiptCreationConfigView = None
|
|
26
|
+
# Pessimistic gas price inflation ratio.
|
|
27
|
+
pessimistic_gas_price_inflation_ratio: conlist(conint(ge=-2147483648, le=2147483647), min_length=2, max_length=2) = None
|
|
28
|
+
# Describes fees for storage.
|
|
29
|
+
storage_usage_config: StorageUsageConfigView = None
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""The shard identifier. It may be an arbitrary number - it does not need to be
|
|
2
|
+
a number in the range 0..NUM_SHARDS. The shard ids do not need to be
|
|
3
|
+
sequential or contiguous.
|
|
4
|
+
|
|
5
|
+
The shard id is wrapped in a new type to prevent the old pattern of using
|
|
6
|
+
indices in range 0..NUM_SHARDS and casting to ShardId. Once the transition
|
|
7
|
+
if fully complete it potentially may be simplified to a regular type alias."""
|
|
8
|
+
|
|
9
|
+
from pydantic import BaseModel
|
|
10
|
+
from pydantic import RootModel
|
|
11
|
+
from pydantic import conint
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ShardId(RootModel[conint(ge=0, le=18446744073709551615)]):
|
|
15
|
+
pass
|
|
16
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""A versioned struct that contains all information needed to assign accounts to shards.
|
|
2
|
+
|
|
3
|
+
Because of re-sharding, the chain may use different shard layout to split shards at different
|
|
4
|
+
times. Currently, `ShardLayout` is stored as part of `EpochConfig`, which is generated each
|
|
5
|
+
epoch given the epoch protocol version. In mainnet/testnet, we use two shard layouts since
|
|
6
|
+
re-sharding has only happened once. It is stored as part of genesis config, see
|
|
7
|
+
default_simple_nightshade_shard_layout() Below is an overview for some important
|
|
8
|
+
functionalities of ShardLayout interface."""
|
|
9
|
+
|
|
10
|
+
from near_jsonrpc_models.shard_layout_v0 import ShardLayoutV0
|
|
11
|
+
from near_jsonrpc_models.shard_layout_v1 import ShardLayoutV1
|
|
12
|
+
from near_jsonrpc_models.shard_layout_v2 import ShardLayoutV2
|
|
13
|
+
from near_jsonrpc_models.shard_layout_v3 import ShardLayoutV3
|
|
14
|
+
from near_jsonrpc_models.strict_model import StrictBaseModel
|
|
15
|
+
from pydantic import BaseModel
|
|
16
|
+
from pydantic import RootModel
|
|
17
|
+
from typing import Union
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ShardLayoutV0Option(StrictBaseModel):
|
|
21
|
+
V0: ShardLayoutV0
|
|
22
|
+
|
|
23
|
+
class ShardLayoutV1Option(StrictBaseModel):
|
|
24
|
+
V1: ShardLayoutV1
|
|
25
|
+
|
|
26
|
+
class ShardLayoutV2Option(StrictBaseModel):
|
|
27
|
+
V2: ShardLayoutV2
|
|
28
|
+
|
|
29
|
+
class ShardLayoutV3Option(StrictBaseModel):
|
|
30
|
+
V3: ShardLayoutV3
|
|
31
|
+
|
|
32
|
+
class ShardLayout(RootModel[Union[ShardLayoutV0Option, ShardLayoutV1Option, ShardLayoutV2Option, ShardLayoutV3Option]]):
|
|
33
|
+
pass
|
|
34
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""A shard layout that maps accounts evenly across all shards -- by calculate the hash of account
|
|
2
|
+
id and mod number of shards. This is added to capture the old `account_id_to_shard_id` algorithm,
|
|
3
|
+
to keep backward compatibility for some existing tests.
|
|
4
|
+
`parent_shards` for `ShardLayoutV1` is always `None`, meaning it can only be the first shard layout
|
|
5
|
+
a chain uses."""
|
|
6
|
+
|
|
7
|
+
from pydantic import BaseModel
|
|
8
|
+
from pydantic import conint
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ShardLayoutV0(BaseModel):
|
|
12
|
+
# Map accounts evenly across all shards
|
|
13
|
+
num_shards: conint(ge=0, le=18446744073709551615)
|
|
14
|
+
# Version of the shard layout, this is useful for uniquely identify the shard layout
|
|
15
|
+
version: conint(ge=0, le=4294967295)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
2
|
+
from near_jsonrpc_models.shard_id import ShardId
|
|
3
|
+
from pydantic import BaseModel
|
|
4
|
+
from pydantic import conint
|
|
5
|
+
from typing import List
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ShardLayoutV1(BaseModel):
|
|
9
|
+
# The boundary accounts are the accounts on boundaries between shards.
|
|
10
|
+
# Each shard contains a range of accounts from one boundary account to
|
|
11
|
+
# another - or the smallest or largest account possible. The total
|
|
12
|
+
# number of shards is equal to the number of boundary accounts plus 1.
|
|
13
|
+
boundary_accounts: List[AccountId]
|
|
14
|
+
# Maps shards from the last shard layout to shards that it splits to in this shard layout,
|
|
15
|
+
# Useful for constructing states for the shards.
|
|
16
|
+
# None for the genesis shard layout
|
|
17
|
+
shards_split_map: List[List[ShardId]] | None = None
|
|
18
|
+
# Maps shard in this shard layout to their parent shard
|
|
19
|
+
# Since shard_ids always range from 0 to num_shards - 1, we use vec instead of a hashmap
|
|
20
|
+
to_parent_shard_map: List[ShardId] | None = None
|
|
21
|
+
# Version of the shard layout, this is useful for uniquely identify the shard layout
|
|
22
|
+
version: conint(ge=0, le=4294967295)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Counterpart to `ShardLayoutV2` composed of maps with string keys to aid
|
|
2
|
+
serde serialization."""
|
|
3
|
+
|
|
4
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
5
|
+
from near_jsonrpc_models.shard_id import ShardId
|
|
6
|
+
from pydantic import BaseModel
|
|
7
|
+
from pydantic import conint
|
|
8
|
+
from typing import Dict
|
|
9
|
+
from typing import List
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ShardLayoutV2(BaseModel):
|
|
13
|
+
boundary_accounts: List[AccountId]
|
|
14
|
+
id_to_index_map: Dict[str, conint(ge=0, le=4294967295)]
|
|
15
|
+
index_to_id_map: Dict[str, ShardId]
|
|
16
|
+
shard_ids: List[ShardId]
|
|
17
|
+
shards_parent_map: Dict[str, ShardId] | None = None
|
|
18
|
+
shards_split_map: Dict[str, List[ShardId]] | None = None
|
|
19
|
+
version: conint(ge=0, le=4294967295)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Counterpart to `ShardLayoutV3` composed of maps with string keys to aid
|
|
2
|
+
serde serialization."""
|
|
3
|
+
|
|
4
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
5
|
+
from near_jsonrpc_models.shard_id import ShardId
|
|
6
|
+
from pydantic import BaseModel
|
|
7
|
+
from pydantic import conint
|
|
8
|
+
from typing import Dict
|
|
9
|
+
from typing import List
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ShardLayoutV3(BaseModel):
|
|
13
|
+
boundary_accounts: List[AccountId]
|
|
14
|
+
id_to_index_map: Dict[str, conint(ge=0, le=4294967295)]
|
|
15
|
+
last_split: ShardId
|
|
16
|
+
shard_ids: List[ShardId]
|
|
17
|
+
shards_split_map: Dict[str, List[ShardId]]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""`ShardUId` is a unique representation for shards from different shard layouts.
|
|
2
|
+
|
|
3
|
+
Comparing to `ShardId`, which is just an ordinal number ranging from 0 to NUM_SHARDS-1,
|
|
4
|
+
`ShardUId` provides a way to unique identify shards when shard layouts may change across epochs.
|
|
5
|
+
This is important because we store states indexed by shards in our database, so we need a
|
|
6
|
+
way to unique identify shard even when shards change across epochs.
|
|
7
|
+
Another difference between `ShardUId` and `ShardId` is that `ShardUId` should only exist in
|
|
8
|
+
a node's internal state while `ShardId` can be exposed to outside APIs and used in protocol
|
|
9
|
+
level information (for example, `ShardChunkHeader` contains `ShardId` instead of `ShardUId`)"""
|
|
10
|
+
|
|
11
|
+
from pydantic import BaseModel
|
|
12
|
+
from pydantic import conint
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class ShardUId(BaseModel):
|
|
16
|
+
shard_id: conint(ge=0, le=4294967295)
|
|
17
|
+
version: conint(ge=0, le=4294967295)
|