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.
Files changed (357) hide show
  1. near_jsonrpc_client/__init__.py +27 -0
  2. near_jsonrpc_client/api_methods_async.py +450 -0
  3. near_jsonrpc_client/api_methods_sync.py +450 -0
  4. near_jsonrpc_client/base_client.py +148 -0
  5. near_jsonrpc_client/client.py +13 -0
  6. near_jsonrpc_client/errors.py +35 -0
  7. near_jsonrpc_client/transport.py +43 -0
  8. near_jsonrpc_client-1.0.5.dist-info/METADATA +10 -0
  9. near_jsonrpc_client-1.0.5.dist-info/RECORD +357 -0
  10. near_jsonrpc_client-1.0.5.dist-info/WHEEL +5 -0
  11. near_jsonrpc_client-1.0.5.dist-info/licenses/LICENSE +201 -0
  12. near_jsonrpc_client-1.0.5.dist-info/top_level.txt +2 -0
  13. near_jsonrpc_models/__init__.py +3378 -0
  14. near_jsonrpc_models/access_key.py +18 -0
  15. near_jsonrpc_models/access_key_creation_config_view.py +13 -0
  16. near_jsonrpc_models/access_key_info_view.py +10 -0
  17. near_jsonrpc_models/access_key_list.py +9 -0
  18. near_jsonrpc_models/access_key_permission.py +21 -0
  19. near_jsonrpc_models/access_key_permission_view.py +25 -0
  20. near_jsonrpc_models/access_key_view.py +10 -0
  21. near_jsonrpc_models/account_creation_config_view.py +13 -0
  22. near_jsonrpc_models/account_data_view.py +30 -0
  23. near_jsonrpc_models/account_id.py +25 -0
  24. near_jsonrpc_models/account_id_validity_rules_version.py +8 -0
  25. near_jsonrpc_models/account_info.py +12 -0
  26. near_jsonrpc_models/account_view.py +18 -0
  27. near_jsonrpc_models/account_with_public_key.py +10 -0
  28. near_jsonrpc_models/action_creation_config_view.py +32 -0
  29. near_jsonrpc_models/action_error.py +13 -0
  30. near_jsonrpc_models/action_error_kind.py +200 -0
  31. near_jsonrpc_models/action_view.py +133 -0
  32. near_jsonrpc_models/actions_validation_error.py +150 -0
  33. near_jsonrpc_models/add_gas_key_action.py +10 -0
  34. near_jsonrpc_models/add_key_action.py +12 -0
  35. near_jsonrpc_models/bandwidth_request.py +14 -0
  36. near_jsonrpc_models/bandwidth_request_bitmap.py +11 -0
  37. near_jsonrpc_models/bandwidth_requests.py +16 -0
  38. near_jsonrpc_models/bandwidth_requests_v1.py +9 -0
  39. near_jsonrpc_models/block_header_inner_lite_view.py +22 -0
  40. near_jsonrpc_models/block_header_view.py +53 -0
  41. near_jsonrpc_models/block_id.py +16 -0
  42. near_jsonrpc_models/block_reference.py +21 -0
  43. near_jsonrpc_models/block_status_view.py +10 -0
  44. near_jsonrpc_models/call_result.py +10 -0
  45. near_jsonrpc_models/catchup_status_view.py +28 -0
  46. near_jsonrpc_models/chunk_distribution_network_config.py +12 -0
  47. near_jsonrpc_models/chunk_distribution_uris.py +10 -0
  48. near_jsonrpc_models/chunk_hash.py +4 -0
  49. near_jsonrpc_models/chunk_header_view.py +39 -0
  50. near_jsonrpc_models/cloud_archival_writer_config.py +14 -0
  51. near_jsonrpc_models/compilation_error.py +29 -0
  52. near_jsonrpc_models/congestion_control_config_view.py +58 -0
  53. near_jsonrpc_models/congestion_info_view.py +11 -0
  54. near_jsonrpc_models/contract_code_view.py +9 -0
  55. near_jsonrpc_models/cost_gas_used.py +10 -0
  56. near_jsonrpc_models/create_account_action.py +7 -0
  57. near_jsonrpc_models/crypto_hash.py +7 -0
  58. near_jsonrpc_models/current_epoch_validator_info.py +35 -0
  59. near_jsonrpc_models/data_receipt_creation_config_view.py +20 -0
  60. near_jsonrpc_models/data_receiver_view.py +8 -0
  61. near_jsonrpc_models/delegate_action.py +28 -0
  62. near_jsonrpc_models/delete_account_action.py +6 -0
  63. near_jsonrpc_models/delete_gas_key_action.py +6 -0
  64. near_jsonrpc_models/delete_key_action.py +7 -0
  65. near_jsonrpc_models/deploy_contract_action.py +8 -0
  66. near_jsonrpc_models/deploy_global_contract_action.py +10 -0
  67. near_jsonrpc_models/detailed_debug_status.py +15 -0
  68. near_jsonrpc_models/deterministic_account_state_init.py +13 -0
  69. near_jsonrpc_models/deterministic_account_state_init_v1.py +8 -0
  70. near_jsonrpc_models/deterministic_state_init_action.py +8 -0
  71. near_jsonrpc_models/direction.py +7 -0
  72. near_jsonrpc_models/dump_config.py +20 -0
  73. near_jsonrpc_models/duration_as_std_schema_provider.py +7 -0
  74. near_jsonrpc_models/dynamic_resharding_config_view.py +23 -0
  75. near_jsonrpc_models/epoch_id.py +8 -0
  76. near_jsonrpc_models/epoch_sync_config.py +25 -0
  77. near_jsonrpc_models/error_wrapper_for_genesis_config_error.py +24 -0
  78. near_jsonrpc_models/error_wrapper_for_rpc_block_error.py +24 -0
  79. near_jsonrpc_models/error_wrapper_for_rpc_call_function_error.py +24 -0
  80. near_jsonrpc_models/error_wrapper_for_rpc_chunk_error.py +24 -0
  81. near_jsonrpc_models/error_wrapper_for_rpc_client_config_error.py +24 -0
  82. near_jsonrpc_models/error_wrapper_for_rpc_gas_price_error.py +24 -0
  83. near_jsonrpc_models/error_wrapper_for_rpc_light_client_next_block_error.py +24 -0
  84. near_jsonrpc_models/error_wrapper_for_rpc_light_client_proof_error.py +24 -0
  85. near_jsonrpc_models/error_wrapper_for_rpc_maintenance_windows_error.py +24 -0
  86. near_jsonrpc_models/error_wrapper_for_rpc_network_info_error.py +24 -0
  87. near_jsonrpc_models/error_wrapper_for_rpc_protocol_config_error.py +24 -0
  88. near_jsonrpc_models/error_wrapper_for_rpc_query_error.py +24 -0
  89. near_jsonrpc_models/error_wrapper_for_rpc_receipt_error.py +24 -0
  90. near_jsonrpc_models/error_wrapper_for_rpc_split_storage_info_error.py +24 -0
  91. near_jsonrpc_models/error_wrapper_for_rpc_state_changes_error.py +24 -0
  92. near_jsonrpc_models/error_wrapper_for_rpc_status_error.py +24 -0
  93. near_jsonrpc_models/error_wrapper_for_rpc_transaction_error.py +24 -0
  94. near_jsonrpc_models/error_wrapper_for_rpc_validator_error.py +24 -0
  95. near_jsonrpc_models/error_wrapper_for_rpc_view_access_key_error.py +24 -0
  96. near_jsonrpc_models/error_wrapper_for_rpc_view_access_key_list_error.py +24 -0
  97. near_jsonrpc_models/error_wrapper_for_rpc_view_account_error.py +24 -0
  98. near_jsonrpc_models/error_wrapper_for_rpc_view_code_error.py +24 -0
  99. near_jsonrpc_models/error_wrapper_for_rpc_view_gas_key_error.py +24 -0
  100. near_jsonrpc_models/error_wrapper_for_rpc_view_gas_key_list_error.py +24 -0
  101. near_jsonrpc_models/error_wrapper_for_rpc_view_state_error.py +24 -0
  102. near_jsonrpc_models/execution_metadata_view.py +9 -0
  103. near_jsonrpc_models/execution_outcome_view.py +31 -0
  104. near_jsonrpc_models/execution_outcome_with_id_view.py +12 -0
  105. near_jsonrpc_models/execution_status_view.py +29 -0
  106. near_jsonrpc_models/ext_costs_config_view.py +162 -0
  107. near_jsonrpc_models/external_storage_config.py +17 -0
  108. near_jsonrpc_models/external_storage_location.py +34 -0
  109. near_jsonrpc_models/fee.py +17 -0
  110. near_jsonrpc_models/final_execution_outcome_view.py +23 -0
  111. near_jsonrpc_models/final_execution_outcome_with_receipt_view.py +26 -0
  112. near_jsonrpc_models/final_execution_status.py +27 -0
  113. near_jsonrpc_models/finality.py +9 -0
  114. near_jsonrpc_models/function_args.py +13 -0
  115. near_jsonrpc_models/function_call_action.py +10 -0
  116. near_jsonrpc_models/function_call_error.py +52 -0
  117. near_jsonrpc_models/function_call_permission.py +24 -0
  118. near_jsonrpc_models/gas_key.py +17 -0
  119. near_jsonrpc_models/gas_key_info_view.py +8 -0
  120. near_jsonrpc_models/gas_key_list.py +7 -0
  121. near_jsonrpc_models/gas_key_view.py +12 -0
  122. near_jsonrpc_models/gcconfig.py +19 -0
  123. near_jsonrpc_models/genesis_config.py +121 -0
  124. near_jsonrpc_models/genesis_config_error.py +7 -0
  125. near_jsonrpc_models/genesis_config_request.py +7 -0
  126. near_jsonrpc_models/global_contract_deploy_mode.py +13 -0
  127. near_jsonrpc_models/global_contract_identifier.py +17 -0
  128. near_jsonrpc_models/global_contract_identifier_view.py +17 -0
  129. near_jsonrpc_models/host_error.py +212 -0
  130. near_jsonrpc_models/internal_error.py +16 -0
  131. near_jsonrpc_models/invalid_access_key_error.py +54 -0
  132. near_jsonrpc_models/invalid_tx_error.py +135 -0
  133. near_jsonrpc_models/json_rpc_request_for_block.py +10 -0
  134. near_jsonrpc_models/json_rpc_request_for_block_effects.py +10 -0
  135. near_jsonrpc_models/json_rpc_request_for_broadcast_tx_async.py +10 -0
  136. near_jsonrpc_models/json_rpc_request_for_broadcast_tx_commit.py +10 -0
  137. near_jsonrpc_models/json_rpc_request_for_changes.py +10 -0
  138. near_jsonrpc_models/json_rpc_request_for_chunk.py +10 -0
  139. near_jsonrpc_models/json_rpc_request_for_client_config.py +10 -0
  140. near_jsonrpc_models/json_rpc_request_for_experimental_call_function.py +10 -0
  141. near_jsonrpc_models/json_rpc_request_for_experimental_changes.py +10 -0
  142. near_jsonrpc_models/json_rpc_request_for_experimental_changes_in_block.py +10 -0
  143. near_jsonrpc_models/json_rpc_request_for_experimental_congestion_level.py +10 -0
  144. near_jsonrpc_models/json_rpc_request_for_experimental_genesis_config.py +10 -0
  145. near_jsonrpc_models/json_rpc_request_for_experimental_light_client_block_proof.py +10 -0
  146. near_jsonrpc_models/json_rpc_request_for_experimental_light_client_proof.py +10 -0
  147. near_jsonrpc_models/json_rpc_request_for_experimental_maintenance_windows.py +10 -0
  148. near_jsonrpc_models/json_rpc_request_for_experimental_protocol_config.py +10 -0
  149. near_jsonrpc_models/json_rpc_request_for_experimental_receipt.py +10 -0
  150. near_jsonrpc_models/json_rpc_request_for_experimental_split_storage_info.py +10 -0
  151. near_jsonrpc_models/json_rpc_request_for_experimental_tx_status.py +10 -0
  152. near_jsonrpc_models/json_rpc_request_for_experimental_validators_ordered.py +10 -0
  153. near_jsonrpc_models/json_rpc_request_for_experimental_view_access_key.py +10 -0
  154. near_jsonrpc_models/json_rpc_request_for_experimental_view_access_key_list.py +10 -0
  155. near_jsonrpc_models/json_rpc_request_for_experimental_view_account.py +10 -0
  156. near_jsonrpc_models/json_rpc_request_for_experimental_view_code.py +10 -0
  157. near_jsonrpc_models/json_rpc_request_for_experimental_view_gas_key.py +10 -0
  158. near_jsonrpc_models/json_rpc_request_for_experimental_view_gas_key_list.py +10 -0
  159. near_jsonrpc_models/json_rpc_request_for_experimental_view_state.py +10 -0
  160. near_jsonrpc_models/json_rpc_request_for_gas_price.py +10 -0
  161. near_jsonrpc_models/json_rpc_request_for_genesis_config.py +10 -0
  162. near_jsonrpc_models/json_rpc_request_for_health.py +10 -0
  163. near_jsonrpc_models/json_rpc_request_for_light_client_proof.py +10 -0
  164. near_jsonrpc_models/json_rpc_request_for_maintenance_windows.py +10 -0
  165. near_jsonrpc_models/json_rpc_request_for_network_info.py +10 -0
  166. near_jsonrpc_models/json_rpc_request_for_next_light_client_block.py +10 -0
  167. near_jsonrpc_models/json_rpc_request_for_query.py +10 -0
  168. near_jsonrpc_models/json_rpc_request_for_send_tx.py +10 -0
  169. near_jsonrpc_models/json_rpc_request_for_status.py +10 -0
  170. near_jsonrpc_models/json_rpc_request_for_tx.py +10 -0
  171. near_jsonrpc_models/json_rpc_request_for_validators.py +10 -0
  172. near_jsonrpc_models/json_rpc_response_for_array_of_range_of_uint64_and_rpc_maintenance_windows_error.py +21 -0
  173. near_jsonrpc_models/json_rpc_response_for_array_of_validator_stake_view_and_rpc_validator_error.py +21 -0
  174. near_jsonrpc_models/json_rpc_response_for_crypto_hash_and_rpc_transaction_error.py +20 -0
  175. near_jsonrpc_models/json_rpc_response_for_genesis_config_and_genesis_config_error.py +20 -0
  176. near_jsonrpc_models/json_rpc_response_for_nullable_rpc_health_response_and_rpc_status_error.py +20 -0
  177. near_jsonrpc_models/json_rpc_response_for_rpc_block_response_and_rpc_block_error.py +20 -0
  178. near_jsonrpc_models/json_rpc_response_for_rpc_call_function_response_and_rpc_call_function_error.py +20 -0
  179. near_jsonrpc_models/json_rpc_response_for_rpc_chunk_response_and_rpc_chunk_error.py +20 -0
  180. near_jsonrpc_models/json_rpc_response_for_rpc_client_config_response_and_rpc_client_config_error.py +20 -0
  181. near_jsonrpc_models/json_rpc_response_for_rpc_congestion_level_response_and_rpc_chunk_error.py +20 -0
  182. near_jsonrpc_models/json_rpc_response_for_rpc_gas_price_response_and_rpc_gas_price_error.py +20 -0
  183. near_jsonrpc_models/json_rpc_response_for_rpc_light_client_block_proof_response_and_rpc_light_client_proof_error.py +20 -0
  184. near_jsonrpc_models/json_rpc_response_for_rpc_light_client_execution_proof_response_and_rpc_light_client_proof_error.py +20 -0
  185. near_jsonrpc_models/json_rpc_response_for_rpc_light_client_next_block_response_and_rpc_light_client_next_block_error.py +20 -0
  186. near_jsonrpc_models/json_rpc_response_for_rpc_network_info_response_and_rpc_network_info_error.py +20 -0
  187. near_jsonrpc_models/json_rpc_response_for_rpc_protocol_config_response_and_rpc_protocol_config_error.py +20 -0
  188. near_jsonrpc_models/json_rpc_response_for_rpc_query_response_and_rpc_query_error.py +20 -0
  189. near_jsonrpc_models/json_rpc_response_for_rpc_receipt_response_and_rpc_receipt_error.py +20 -0
  190. near_jsonrpc_models/json_rpc_response_for_rpc_split_storage_info_response_and_rpc_split_storage_info_error.py +20 -0
  191. near_jsonrpc_models/json_rpc_response_for_rpc_state_changes_in_block_by_type_response_and_rpc_state_changes_error.py +20 -0
  192. near_jsonrpc_models/json_rpc_response_for_rpc_state_changes_in_block_response_and_rpc_state_changes_error.py +20 -0
  193. near_jsonrpc_models/json_rpc_response_for_rpc_status_response_and_rpc_status_error.py +20 -0
  194. near_jsonrpc_models/json_rpc_response_for_rpc_transaction_response_and_rpc_transaction_error.py +20 -0
  195. near_jsonrpc_models/json_rpc_response_for_rpc_validator_response_and_rpc_validator_error.py +20 -0
  196. near_jsonrpc_models/json_rpc_response_for_rpc_view_access_key_list_response_and_rpc_view_access_key_list_error.py +20 -0
  197. near_jsonrpc_models/json_rpc_response_for_rpc_view_access_key_response_and_rpc_view_access_key_error.py +20 -0
  198. near_jsonrpc_models/json_rpc_response_for_rpc_view_account_response_and_rpc_view_account_error.py +20 -0
  199. near_jsonrpc_models/json_rpc_response_for_rpc_view_code_response_and_rpc_view_code_error.py +20 -0
  200. near_jsonrpc_models/json_rpc_response_for_rpc_view_gas_key_list_response_and_rpc_view_gas_key_list_error.py +20 -0
  201. near_jsonrpc_models/json_rpc_response_for_rpc_view_gas_key_response_and_rpc_view_gas_key_error.py +20 -0
  202. near_jsonrpc_models/json_rpc_response_for_rpc_view_state_response_and_rpc_view_state_error.py +20 -0
  203. near_jsonrpc_models/known_producer_view.py +13 -0
  204. near_jsonrpc_models/light_client_block_lite_view.py +9 -0
  205. near_jsonrpc_models/limit_config.py +81 -0
  206. near_jsonrpc_models/log_summary_style.py +7 -0
  207. near_jsonrpc_models/merkle_path_item.py +8 -0
  208. near_jsonrpc_models/method_resolve_error.py +7 -0
  209. near_jsonrpc_models/missing_trie_value.py +8 -0
  210. near_jsonrpc_models/missing_trie_value_context.py +9 -0
  211. near_jsonrpc_models/mutable_config_value.py +7 -0
  212. near_jsonrpc_models/near_gas.py +8 -0
  213. near_jsonrpc_models/near_token.py +7 -0
  214. near_jsonrpc_models/network_info_view.py +17 -0
  215. near_jsonrpc_models/next_epoch_validator_info.py +13 -0
  216. near_jsonrpc_models/non_delegate_action.py +71 -0
  217. near_jsonrpc_models/peer_id.py +6 -0
  218. near_jsonrpc_models/peer_info_view.py +26 -0
  219. near_jsonrpc_models/prepare_error.py +16 -0
  220. near_jsonrpc_models/protocol_version_check_config.py +9 -0
  221. near_jsonrpc_models/public_key.py +7 -0
  222. near_jsonrpc_models/range_of_uint64.py +7 -0
  223. near_jsonrpc_models/receipt_enum_view.py +48 -0
  224. near_jsonrpc_models/receipt_validation_error.py +76 -0
  225. near_jsonrpc_models/receipt_view.py +13 -0
  226. near_jsonrpc_models/rpc_block_error.py +25 -0
  227. near_jsonrpc_models/rpc_block_request.py +20 -0
  228. near_jsonrpc_models/rpc_block_response.py +12 -0
  229. near_jsonrpc_models/rpc_call_function_error.py +64 -0
  230. near_jsonrpc_models/rpc_call_function_request.py +31 -0
  231. near_jsonrpc_models/rpc_call_function_response.py +13 -0
  232. near_jsonrpc_models/rpc_chunk_error.py +38 -0
  233. near_jsonrpc_models/rpc_chunk_request.py +18 -0
  234. near_jsonrpc_models/rpc_chunk_response.py +13 -0
  235. near_jsonrpc_models/rpc_client_config_error.py +16 -0
  236. near_jsonrpc_models/rpc_client_config_request.py +7 -0
  237. near_jsonrpc_models/rpc_client_config_response.py +185 -0
  238. near_jsonrpc_models/rpc_congestion_level_request.py +18 -0
  239. near_jsonrpc_models/rpc_congestion_level_response.py +5 -0
  240. near_jsonrpc_models/rpc_gas_price_error.py +22 -0
  241. near_jsonrpc_models/rpc_gas_price_request.py +6 -0
  242. near_jsonrpc_models/rpc_gas_price_response.py +6 -0
  243. near_jsonrpc_models/rpc_health_request.py +7 -0
  244. near_jsonrpc_models/rpc_health_response.py +7 -0
  245. near_jsonrpc_models/rpc_known_producer.py +9 -0
  246. near_jsonrpc_models/rpc_light_client_block_proof_request.py +7 -0
  247. near_jsonrpc_models/rpc_light_client_block_proof_response.py +9 -0
  248. near_jsonrpc_models/rpc_light_client_execution_proof_request.py +23 -0
  249. near_jsonrpc_models/rpc_light_client_execution_proof_response.py +12 -0
  250. near_jsonrpc_models/rpc_light_client_next_block_error.py +30 -0
  251. near_jsonrpc_models/rpc_light_client_next_block_request.py +6 -0
  252. near_jsonrpc_models/rpc_light_client_next_block_response.py +19 -0
  253. near_jsonrpc_models/rpc_light_client_proof_error.py +55 -0
  254. near_jsonrpc_models/rpc_maintenance_windows_error.py +16 -0
  255. near_jsonrpc_models/rpc_maintenance_windows_request.py +6 -0
  256. near_jsonrpc_models/rpc_network_info_error.py +16 -0
  257. near_jsonrpc_models/rpc_network_info_request.py +7 -0
  258. near_jsonrpc_models/rpc_network_info_response.py +15 -0
  259. near_jsonrpc_models/rpc_peer_info.py +9 -0
  260. near_jsonrpc_models/rpc_protocol_config_error.py +22 -0
  261. near_jsonrpc_models/rpc_protocol_config_request.py +20 -0
  262. near_jsonrpc_models/rpc_protocol_config_response.py +103 -0
  263. near_jsonrpc_models/rpc_query_error.py +122 -0
  264. near_jsonrpc_models/rpc_query_request.py +185 -0
  265. near_jsonrpc_models/rpc_query_response.py +50 -0
  266. near_jsonrpc_models/rpc_receipt_error.py +24 -0
  267. near_jsonrpc_models/rpc_receipt_request.py +6 -0
  268. near_jsonrpc_models/rpc_receipt_response.py +13 -0
  269. near_jsonrpc_models/rpc_request_validation_error_kind.py +23 -0
  270. near_jsonrpc_models/rpc_send_transaction_request.py +9 -0
  271. near_jsonrpc_models/rpc_split_storage_info_error.py +16 -0
  272. near_jsonrpc_models/rpc_split_storage_info_request.py +5 -0
  273. near_jsonrpc_models/rpc_split_storage_info_response.py +11 -0
  274. near_jsonrpc_models/rpc_state_changes_error.py +25 -0
  275. near_jsonrpc_models/rpc_state_changes_in_block_by_type_request.py +129 -0
  276. near_jsonrpc_models/rpc_state_changes_in_block_by_type_response.py +9 -0
  277. near_jsonrpc_models/rpc_state_changes_in_block_request.py +20 -0
  278. near_jsonrpc_models/rpc_state_changes_in_block_response.py +9 -0
  279. near_jsonrpc_models/rpc_status_error.py +37 -0
  280. near_jsonrpc_models/rpc_status_request.py +7 -0
  281. near_jsonrpc_models/rpc_status_response.py +41 -0
  282. near_jsonrpc_models/rpc_transaction_error.py +43 -0
  283. near_jsonrpc_models/rpc_transaction_response.py +17 -0
  284. near_jsonrpc_models/rpc_transaction_status_request.py +21 -0
  285. near_jsonrpc_models/rpc_validator_error.py +22 -0
  286. near_jsonrpc_models/rpc_validator_request.py +20 -0
  287. near_jsonrpc_models/rpc_validator_response.py +28 -0
  288. near_jsonrpc_models/rpc_validators_ordered_request.py +6 -0
  289. near_jsonrpc_models/rpc_view_access_key_error.py +55 -0
  290. near_jsonrpc_models/rpc_view_access_key_list_error.py +45 -0
  291. near_jsonrpc_models/rpc_view_access_key_list_request.py +24 -0
  292. near_jsonrpc_models/rpc_view_access_key_list_response.py +13 -0
  293. near_jsonrpc_models/rpc_view_access_key_request.py +28 -0
  294. near_jsonrpc_models/rpc_view_access_key_response.py +13 -0
  295. near_jsonrpc_models/rpc_view_account_error.py +45 -0
  296. near_jsonrpc_models/rpc_view_account_request.py +24 -0
  297. near_jsonrpc_models/rpc_view_account_response.py +20 -0
  298. near_jsonrpc_models/rpc_view_code_error.py +54 -0
  299. near_jsonrpc_models/rpc_view_code_request.py +24 -0
  300. near_jsonrpc_models/rpc_view_code_response.py +12 -0
  301. near_jsonrpc_models/rpc_view_gas_key_error.py +55 -0
  302. near_jsonrpc_models/rpc_view_gas_key_list_error.py +45 -0
  303. near_jsonrpc_models/rpc_view_gas_key_list_request.py +24 -0
  304. near_jsonrpc_models/rpc_view_gas_key_list_response.py +11 -0
  305. near_jsonrpc_models/rpc_view_gas_key_request.py +28 -0
  306. near_jsonrpc_models/rpc_view_gas_key_response.py +15 -0
  307. near_jsonrpc_models/rpc_view_state_error.py +54 -0
  308. near_jsonrpc_models/rpc_view_state_request.py +31 -0
  309. near_jsonrpc_models/rpc_view_state_response.py +14 -0
  310. near_jsonrpc_models/runtime_config_view.py +30 -0
  311. near_jsonrpc_models/runtime_fees_config_view.py +29 -0
  312. near_jsonrpc_models/shard_id.py +16 -0
  313. near_jsonrpc_models/shard_layout.py +34 -0
  314. near_jsonrpc_models/shard_layout_v0.py +15 -0
  315. near_jsonrpc_models/shard_layout_v1.py +22 -0
  316. near_jsonrpc_models/shard_layout_v2.py +19 -0
  317. near_jsonrpc_models/shard_layout_v3.py +17 -0
  318. near_jsonrpc_models/shard_uid.py +17 -0
  319. near_jsonrpc_models/signature.py +7 -0
  320. near_jsonrpc_models/signed_delegate_action.py +8 -0
  321. near_jsonrpc_models/signed_transaction.py +7 -0
  322. near_jsonrpc_models/signed_transaction_view.py +19 -0
  323. near_jsonrpc_models/slashed_validator.py +7 -0
  324. near_jsonrpc_models/stake_action.py +12 -0
  325. near_jsonrpc_models/state_change_cause_view.py +50 -0
  326. near_jsonrpc_models/state_change_kind_view.py +31 -0
  327. near_jsonrpc_models/state_change_with_cause_view.py +129 -0
  328. near_jsonrpc_models/state_item.py +10 -0
  329. near_jsonrpc_models/state_sync_config.py +14 -0
  330. near_jsonrpc_models/status_sync_info.py +17 -0
  331. near_jsonrpc_models/storage_error.py +46 -0
  332. near_jsonrpc_models/storage_get_mode.py +9 -0
  333. near_jsonrpc_models/storage_usage_config_view.py +11 -0
  334. near_jsonrpc_models/store_key.py +12 -0
  335. near_jsonrpc_models/store_value.py +12 -0
  336. near_jsonrpc_models/strict_model.py +5 -0
  337. near_jsonrpc_models/sync_checkpoint.py +7 -0
  338. near_jsonrpc_models/sync_concurrency.py +19 -0
  339. near_jsonrpc_models/sync_config.py +23 -0
  340. near_jsonrpc_models/tier1proxy_view.py +7 -0
  341. near_jsonrpc_models/tracked_shards_config.py +42 -0
  342. near_jsonrpc_models/transfer_action.py +6 -0
  343. near_jsonrpc_models/transfer_to_gas_key_action.py +8 -0
  344. near_jsonrpc_models/tx_execution_error.py +21 -0
  345. near_jsonrpc_models/tx_execution_status.py +14 -0
  346. near_jsonrpc_models/use_global_contract_action.py +8 -0
  347. near_jsonrpc_models/validator_info.py +6 -0
  348. near_jsonrpc_models/validator_kickout_reason.py +67 -0
  349. near_jsonrpc_models/validator_kickout_view.py +8 -0
  350. near_jsonrpc_models/validator_stake_view.py +13 -0
  351. near_jsonrpc_models/validator_stake_view_v1.py +10 -0
  352. near_jsonrpc_models/version.py +10 -0
  353. near_jsonrpc_models/view_state_result.py +10 -0
  354. near_jsonrpc_models/vmconfig_view.py +44 -0
  355. near_jsonrpc_models/vmkind.py +9 -0
  356. near_jsonrpc_models/wasm_trap.py +9 -0
  357. near_jsonrpc_models/witness_config_view.py +17 -0
@@ -0,0 +1,150 @@
1
+ """Describes the error for validating a list of actions."""
2
+
3
+ from near_jsonrpc_models.access_key_permission import AccessKeyPermission
4
+ from near_jsonrpc_models.account_id import AccountId
5
+ from near_jsonrpc_models.near_gas import NearGas
6
+ from near_jsonrpc_models.public_key import PublicKey
7
+ from near_jsonrpc_models.strict_model import StrictBaseModel
8
+ from pydantic import BaseModel
9
+ from pydantic import RootModel
10
+ from pydantic import conint
11
+ from typing import Literal
12
+ from typing import Union
13
+
14
+
15
+ """The delete action must be a final action in transaction"""
16
+ class ActionsValidationErrorDeleteActionMustBeFinal(RootModel[Literal['DeleteActionMustBeFinal']]):
17
+ pass
18
+
19
+ class ActionsValidationErrorTotalPrepaidGasExceededPayload(BaseModel):
20
+ limit: NearGas
21
+ total_prepaid_gas: NearGas
22
+
23
+ class ActionsValidationErrorTotalPrepaidGasExceeded(StrictBaseModel):
24
+ """The total prepaid gas (for all given actions) exceeded the limit."""
25
+ TotalPrepaidGasExceeded: ActionsValidationErrorTotalPrepaidGasExceededPayload
26
+
27
+ class ActionsValidationErrorTotalNumberOfActionsExceededPayload(BaseModel):
28
+ limit: conint(ge=0, le=18446744073709551615)
29
+ total_number_of_actions: conint(ge=0, le=18446744073709551615)
30
+
31
+ class ActionsValidationErrorTotalNumberOfActionsExceeded(StrictBaseModel):
32
+ """The number of actions exceeded the given limit."""
33
+ TotalNumberOfActionsExceeded: ActionsValidationErrorTotalNumberOfActionsExceededPayload
34
+
35
+ class ActionsValidationErrorAddKeyMethodNamesNumberOfBytesExceededPayload(BaseModel):
36
+ limit: conint(ge=0, le=18446744073709551615)
37
+ total_number_of_bytes: conint(ge=0, le=18446744073709551615)
38
+
39
+ class ActionsValidationErrorAddKeyMethodNamesNumberOfBytesExceeded(StrictBaseModel):
40
+ """The total number of bytes of the method names exceeded the limit in a Add Key action."""
41
+ AddKeyMethodNamesNumberOfBytesExceeded: ActionsValidationErrorAddKeyMethodNamesNumberOfBytesExceededPayload
42
+
43
+ class ActionsValidationErrorAddKeyMethodNameLengthExceededPayload(BaseModel):
44
+ length: conint(ge=0, le=18446744073709551615)
45
+ limit: conint(ge=0, le=18446744073709551615)
46
+
47
+ class ActionsValidationErrorAddKeyMethodNameLengthExceeded(StrictBaseModel):
48
+ """The length of some method name exceeded the limit in a Add Key action."""
49
+ AddKeyMethodNameLengthExceeded: ActionsValidationErrorAddKeyMethodNameLengthExceededPayload
50
+
51
+ """Integer overflow during a compute."""
52
+ class ActionsValidationErrorIntegerOverflow(RootModel[Literal['IntegerOverflow']]):
53
+ pass
54
+
55
+ class ActionsValidationErrorInvalidAccountIdPayload(BaseModel):
56
+ account_id: str
57
+
58
+ class ActionsValidationErrorInvalidAccountId(StrictBaseModel):
59
+ """Invalid account ID."""
60
+ InvalidAccountId: ActionsValidationErrorInvalidAccountIdPayload
61
+
62
+ class ActionsValidationErrorContractSizeExceededPayload(BaseModel):
63
+ limit: conint(ge=0, le=18446744073709551615)
64
+ size: conint(ge=0, le=18446744073709551615)
65
+
66
+ class ActionsValidationErrorContractSizeExceeded(StrictBaseModel):
67
+ """The size of the contract code exceeded the limit in a DeployContract action."""
68
+ ContractSizeExceeded: ActionsValidationErrorContractSizeExceededPayload
69
+
70
+ class ActionsValidationErrorFunctionCallMethodNameLengthExceededPayload(BaseModel):
71
+ length: conint(ge=0, le=18446744073709551615)
72
+ limit: conint(ge=0, le=18446744073709551615)
73
+
74
+ class ActionsValidationErrorFunctionCallMethodNameLengthExceeded(StrictBaseModel):
75
+ """The length of the method name exceeded the limit in a Function Call action."""
76
+ FunctionCallMethodNameLengthExceeded: ActionsValidationErrorFunctionCallMethodNameLengthExceededPayload
77
+
78
+ class ActionsValidationErrorFunctionCallArgumentsLengthExceededPayload(BaseModel):
79
+ length: conint(ge=0, le=18446744073709551615)
80
+ limit: conint(ge=0, le=18446744073709551615)
81
+
82
+ class ActionsValidationErrorFunctionCallArgumentsLengthExceeded(StrictBaseModel):
83
+ """The length of the arguments exceeded the limit in a Function Call action."""
84
+ FunctionCallArgumentsLengthExceeded: ActionsValidationErrorFunctionCallArgumentsLengthExceededPayload
85
+
86
+ class ActionsValidationErrorUnsuitableStakingKeyPayload(BaseModel):
87
+ public_key: PublicKey
88
+
89
+ class ActionsValidationErrorUnsuitableStakingKey(StrictBaseModel):
90
+ """An attempt to stake with a public key that is not convertible to ristretto."""
91
+ UnsuitableStakingKey: ActionsValidationErrorUnsuitableStakingKeyPayload
92
+
93
+ """The attached amount of gas in a FunctionCall action has to be a positive number."""
94
+ class ActionsValidationErrorFunctionCallZeroAttachedGas(RootModel[Literal['FunctionCallZeroAttachedGas']]):
95
+ pass
96
+
97
+ """There should be the only one DelegateAction"""
98
+ class ActionsValidationErrorDelegateActionMustBeOnlyOne(RootModel[Literal['DelegateActionMustBeOnlyOne']]):
99
+ pass
100
+
101
+ class ActionsValidationErrorUnsupportedProtocolFeaturePayload(BaseModel):
102
+ protocol_feature: str
103
+ version: conint(ge=0, le=4294967295)
104
+
105
+ class ActionsValidationErrorUnsupportedProtocolFeature(StrictBaseModel):
106
+ """The transaction includes a feature that the current protocol version
107
+ does not support.
108
+
109
+ Note: we stringify the protocol feature name instead of using
110
+ `ProtocolFeature` here because we don't want to leak the internals of
111
+ that type into observable borsh serialization."""
112
+ UnsupportedProtocolFeature: ActionsValidationErrorUnsupportedProtocolFeaturePayload
113
+
114
+ class ActionsValidationErrorInvalidDeterministicStateInitReceiverPayload(BaseModel):
115
+ derived_id: AccountId
116
+ receiver_id: AccountId
117
+
118
+ class ActionsValidationErrorInvalidDeterministicStateInitReceiver(StrictBaseModel):
119
+ InvalidDeterministicStateInitReceiver: ActionsValidationErrorInvalidDeterministicStateInitReceiverPayload
120
+
121
+ class ActionsValidationErrorDeterministicStateInitKeyLengthExceededPayload(BaseModel):
122
+ length: conint(ge=0, le=18446744073709551615)
123
+ limit: conint(ge=0, le=18446744073709551615)
124
+
125
+ class ActionsValidationErrorDeterministicStateInitKeyLengthExceeded(StrictBaseModel):
126
+ DeterministicStateInitKeyLengthExceeded: ActionsValidationErrorDeterministicStateInitKeyLengthExceededPayload
127
+
128
+ class ActionsValidationErrorDeterministicStateInitValueLengthExceededPayload(BaseModel):
129
+ length: conint(ge=0, le=18446744073709551615)
130
+ limit: conint(ge=0, le=18446744073709551615)
131
+
132
+ class ActionsValidationErrorDeterministicStateInitValueLengthExceeded(StrictBaseModel):
133
+ DeterministicStateInitValueLengthExceeded: ActionsValidationErrorDeterministicStateInitValueLengthExceededPayload
134
+
135
+ class ActionsValidationErrorGasKeyPermissionInvalidPayload(BaseModel):
136
+ permission: AccessKeyPermission
137
+
138
+ class ActionsValidationErrorGasKeyPermissionInvalid(StrictBaseModel):
139
+ GasKeyPermissionInvalid: ActionsValidationErrorGasKeyPermissionInvalidPayload
140
+
141
+ class ActionsValidationErrorGasKeyTooManyNoncesRequestedPayload(BaseModel):
142
+ limit: conint(ge=0, le=4294967295)
143
+ requested_nonces: conint(ge=0, le=4294967295)
144
+
145
+ class ActionsValidationErrorGasKeyTooManyNoncesRequested(StrictBaseModel):
146
+ GasKeyTooManyNoncesRequested: ActionsValidationErrorGasKeyTooManyNoncesRequestedPayload
147
+
148
+ class ActionsValidationError(RootModel[Union[ActionsValidationErrorDeleteActionMustBeFinal, ActionsValidationErrorTotalPrepaidGasExceeded, ActionsValidationErrorTotalNumberOfActionsExceeded, ActionsValidationErrorAddKeyMethodNamesNumberOfBytesExceeded, ActionsValidationErrorAddKeyMethodNameLengthExceeded, ActionsValidationErrorIntegerOverflow, ActionsValidationErrorInvalidAccountId, ActionsValidationErrorContractSizeExceeded, ActionsValidationErrorFunctionCallMethodNameLengthExceeded, ActionsValidationErrorFunctionCallArgumentsLengthExceeded, ActionsValidationErrorUnsuitableStakingKey, ActionsValidationErrorFunctionCallZeroAttachedGas, ActionsValidationErrorDelegateActionMustBeOnlyOne, ActionsValidationErrorUnsupportedProtocolFeature, ActionsValidationErrorInvalidDeterministicStateInitReceiver, ActionsValidationErrorDeterministicStateInitKeyLengthExceeded, ActionsValidationErrorDeterministicStateInitValueLengthExceeded, ActionsValidationErrorGasKeyPermissionInvalid, ActionsValidationErrorGasKeyTooManyNoncesRequested]]):
149
+ pass
150
+
@@ -0,0 +1,10 @@
1
+ from near_jsonrpc_models.access_key_permission import AccessKeyPermission
2
+ from near_jsonrpc_models.public_key import PublicKey
3
+ from pydantic import BaseModel
4
+ from pydantic import conint
5
+
6
+
7
+ class AddGasKeyAction(BaseModel):
8
+ num_nonces: conint(ge=0, le=4294967295)
9
+ permission: AccessKeyPermission
10
+ public_key: PublicKey
@@ -0,0 +1,12 @@
1
+ """An action that adds key with public key associated"""
2
+
3
+ from near_jsonrpc_models.access_key import AccessKey
4
+ from near_jsonrpc_models.public_key import PublicKey
5
+ from pydantic import BaseModel
6
+
7
+
8
+ class AddKeyAction(BaseModel):
9
+ # An access key with the permission
10
+ access_key: AccessKey
11
+ # A public key which will be associated with an access_key
12
+ public_key: PublicKey
@@ -0,0 +1,14 @@
1
+ """`BandwidthRequest` describes the size of receipts that a shard would like to send to another shard.
2
+ When a shard wants to send a lot of receipts to another shard, it needs to create a request and wait
3
+ for a bandwidth grant from the bandwidth scheduler."""
4
+
5
+ from near_jsonrpc_models.bandwidth_request_bitmap import BandwidthRequestBitmap
6
+ from pydantic import BaseModel
7
+ from pydantic import conint
8
+
9
+
10
+ class BandwidthRequest(BaseModel):
11
+ # Bitmap which describes what values of bandwidth are requested.
12
+ requested_values_bitmap: BandwidthRequestBitmap
13
+ # Requesting bandwidth to this shard.
14
+ to_shard: conint(ge=0, le=65535)
@@ -0,0 +1,11 @@
1
+ """Bitmap which describes which values from the predefined list are being requested.
2
+ The nth bit is set to 1 when the nth value from the list is being requested."""
3
+
4
+ from pydantic import BaseModel
5
+ from pydantic import conint
6
+ from pydantic import conlist
7
+ from typing import List
8
+
9
+
10
+ class BandwidthRequestBitmap(BaseModel):
11
+ data: conlist(conint(ge=0, le=255), min_length=5, max_length=5)
@@ -0,0 +1,16 @@
1
+ """A list of shard's bandwidth requests.
2
+ Describes how much the shard would like to send to other shards."""
3
+
4
+ from near_jsonrpc_models.bandwidth_requests_v1 import BandwidthRequestsV1
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 BandwidthRequestsV1Option(StrictBaseModel):
12
+ V1: BandwidthRequestsV1
13
+
14
+ class BandwidthRequests(RootModel[Union[BandwidthRequestsV1Option]]):
15
+ pass
16
+
@@ -0,0 +1,9 @@
1
+ """Version 1 of [`BandwidthRequest`]."""
2
+
3
+ from near_jsonrpc_models.bandwidth_request import BandwidthRequest
4
+ from pydantic import BaseModel
5
+ from typing import List
6
+
7
+
8
+ class BandwidthRequestsV1(BaseModel):
9
+ requests: List[BandwidthRequest]
@@ -0,0 +1,22 @@
1
+ """A part of a state for the current head of a light client. More info [here](https://nomicon.io/ChainSpec/LightClient)."""
2
+
3
+ from near_jsonrpc_models.crypto_hash import CryptoHash
4
+ from pydantic import BaseModel
5
+ from pydantic import conint
6
+
7
+
8
+ class BlockHeaderInnerLiteView(BaseModel):
9
+ # The merkle root of all the block hashes
10
+ block_merkle_root: CryptoHash
11
+ # The epoch to which the block that is the current known head belongs
12
+ epoch_id: CryptoHash
13
+ height: conint(ge=0, le=18446744073709551615)
14
+ # The hash of the block producers set for the next epoch
15
+ next_bp_hash: CryptoHash
16
+ # The epoch that will follow the current epoch
17
+ next_epoch_id: CryptoHash
18
+ outcome_root: CryptoHash
19
+ prev_state_root: CryptoHash
20
+ # Legacy json number. Should not be used.
21
+ timestamp: conint(ge=0, le=18446744073709551615)
22
+ timestamp_nanosec: str
@@ -0,0 +1,53 @@
1
+ """Contains main info about the block."""
2
+
3
+ from near_jsonrpc_models.crypto_hash import CryptoHash
4
+ from near_jsonrpc_models.near_token import NearToken
5
+ from near_jsonrpc_models.signature import Signature
6
+ from near_jsonrpc_models.slashed_validator import SlashedValidator
7
+ from near_jsonrpc_models.validator_stake_view import ValidatorStakeView
8
+ from pydantic import BaseModel
9
+ from pydantic import Field
10
+ from pydantic import conint
11
+ from typing import List
12
+
13
+
14
+ class BlockHeaderView(BaseModel):
15
+ approvals: List[Signature | None]
16
+ block_body_hash: CryptoHash | None = None
17
+ block_merkle_root: CryptoHash
18
+ block_ordinal: conint(ge=0, le=18446744073709551615) | None = None
19
+ challenges_result: List[SlashedValidator]
20
+ challenges_root: CryptoHash
21
+ chunk_endorsements: List[List[conint(ge=0, le=255)]] | None = None
22
+ chunk_headers_root: CryptoHash
23
+ chunk_mask: List[bool]
24
+ chunk_receipts_root: CryptoHash
25
+ chunk_tx_root: CryptoHash
26
+ chunks_included: conint(ge=0, le=18446744073709551615)
27
+ epoch_id: CryptoHash
28
+ epoch_sync_data_hash: CryptoHash | None = None
29
+ gas_price: NearToken
30
+ hash: CryptoHash
31
+ height: conint(ge=0, le=18446744073709551615)
32
+ last_ds_final_block: CryptoHash
33
+ last_final_block: CryptoHash
34
+ latest_protocol_version: conint(ge=0, le=4294967295)
35
+ next_bp_hash: CryptoHash
36
+ next_epoch_id: CryptoHash
37
+ outcome_root: CryptoHash
38
+ # The hash of the previous Block
39
+ prev_hash: CryptoHash
40
+ prev_height: conint(ge=0, le=18446744073709551615) | None = None
41
+ prev_state_root: CryptoHash
42
+ random_value: CryptoHash
43
+ # TODO(2271): deprecated.
44
+ rent_paid: NearToken = Field(default_factory=lambda: NearToken('0'))
45
+ # Signature of the block producer.
46
+ signature: Signature
47
+ # Legacy json number. Should not be used.
48
+ timestamp: conint(ge=0, le=18446744073709551615)
49
+ timestamp_nanosec: str
50
+ total_supply: NearToken
51
+ validator_proposals: List[ValidatorStakeView]
52
+ # TODO(2271): deprecated.
53
+ validator_reward: NearToken = Field(default_factory=lambda: NearToken('0'))
@@ -0,0 +1,16 @@
1
+ from near_jsonrpc_models.crypto_hash import CryptoHash
2
+ from pydantic import BaseModel
3
+ from pydantic import RootModel
4
+ from pydantic import conint
5
+ from typing import Union
6
+
7
+
8
+ class BlockIdBlockHeight(RootModel[conint(ge=0, le=18446744073709551615)]):
9
+ pass
10
+
11
+ class BlockIdCryptoHash(CryptoHash):
12
+ pass
13
+
14
+ class BlockId(RootModel[Union[BlockIdBlockHeight, BlockIdCryptoHash]]):
15
+ pass
16
+
@@ -0,0 +1,21 @@
1
+ from near_jsonrpc_models.block_id import BlockId
2
+ from near_jsonrpc_models.finality import Finality
3
+ from near_jsonrpc_models.strict_model import StrictBaseModel
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 BlockReferenceBlockId(StrictBaseModel):
11
+ block_id: BlockId
12
+
13
+ class BlockReferenceFinality(StrictBaseModel):
14
+ finality: Finality
15
+
16
+ class BlockReferenceSyncCheckpoint(StrictBaseModel):
17
+ sync_checkpoint: SyncCheckpoint
18
+
19
+ class BlockReference(RootModel[Union[BlockReferenceBlockId, BlockReferenceFinality, BlockReferenceSyncCheckpoint]]):
20
+ pass
21
+
@@ -0,0 +1,10 @@
1
+ """Height and hash of a block"""
2
+
3
+ from near_jsonrpc_models.crypto_hash import CryptoHash
4
+ from pydantic import BaseModel
5
+ from pydantic import conint
6
+
7
+
8
+ class BlockStatusView(BaseModel):
9
+ hash: CryptoHash
10
+ height: conint(ge=0, le=18446744073709551615)
@@ -0,0 +1,10 @@
1
+ """A result returned by contract method"""
2
+
3
+ from pydantic import BaseModel
4
+ from pydantic import conint
5
+ from typing import List
6
+
7
+
8
+ class CallResult(BaseModel):
9
+ logs: List[str]
10
+ result: List[conint(ge=0, le=255)]
@@ -0,0 +1,28 @@
1
+ """Status of the [catchup](https://near.github.io/nearcore/architecture/how/sync.html#catchup) process"""
2
+
3
+ from near_jsonrpc_models.block_status_view import BlockStatusView
4
+ from near_jsonrpc_models.crypto_hash import CryptoHash
5
+ from pydantic import BaseModel
6
+ from pydantic import conint
7
+ from pydantic import field_validator
8
+ from typing import Dict
9
+ from typing import List
10
+
11
+
12
+ class CatchupStatusView(BaseModel):
13
+ blocks_to_catchup: List[BlockStatusView]
14
+ shard_sync_status: Dict[str, str]
15
+ sync_block_hash: CryptoHash
16
+ sync_block_height: conint(ge=0, le=18446744073709551615)
17
+
18
+ @field_validator('shard_sync_status')
19
+ def validate_shard_sync_status_keys(cls, v):
20
+ import re
21
+ pattern = re.compile(r"^\d+$")
22
+ if not isinstance(v, dict):
23
+ raise TypeError('shard_sync_status must be a dict')
24
+ for key in v.keys():
25
+ if not pattern.match(key):
26
+ raise ValueError(f"Invalid key '{key}' in shard_sync_status. Must match '^\\d+$'")
27
+ return v
28
+
@@ -0,0 +1,12 @@
1
+ """Config for the Chunk Distribution Network feature.
2
+ This allows nodes to push and pull chunks from a central stream.
3
+ The two benefits of this approach are: (1) less request/response traffic
4
+ on the peer-to-peer network and (2) lower latency for RPC nodes indexing the chain."""
5
+
6
+ from near_jsonrpc_models.chunk_distribution_uris import ChunkDistributionUris
7
+ from pydantic import BaseModel
8
+
9
+
10
+ class ChunkDistributionNetworkConfig(BaseModel):
11
+ enabled: bool = None
12
+ uris: ChunkDistributionUris = None
@@ -0,0 +1,10 @@
1
+ """URIs for the Chunk Distribution Network feature."""
2
+
3
+ from pydantic import BaseModel
4
+
5
+
6
+ class ChunkDistributionUris(BaseModel):
7
+ # URI for pulling chunks from the stream.
8
+ get: str = None
9
+ # URI for publishing chunks to the stream.
10
+ set: str = None
@@ -0,0 +1,4 @@
1
+ from near_jsonrpc_models.crypto_hash import CryptoHash
2
+
3
+
4
+ ChunkHash = CryptoHash
@@ -0,0 +1,39 @@
1
+ """Contains main info about the chunk."""
2
+
3
+ from near_jsonrpc_models.bandwidth_requests import BandwidthRequests
4
+ from near_jsonrpc_models.congestion_info_view import CongestionInfoView
5
+ from near_jsonrpc_models.crypto_hash import CryptoHash
6
+ from near_jsonrpc_models.near_gas import NearGas
7
+ from near_jsonrpc_models.near_token import NearToken
8
+ from near_jsonrpc_models.shard_id import ShardId
9
+ from near_jsonrpc_models.signature import Signature
10
+ from near_jsonrpc_models.validator_stake_view import ValidatorStakeView
11
+ from pydantic import BaseModel
12
+ from pydantic import Field
13
+ from pydantic import conint
14
+ from typing import List
15
+
16
+
17
+ class ChunkHeaderView(BaseModel):
18
+ balance_burnt: NearToken
19
+ bandwidth_requests: BandwidthRequests | None = None
20
+ chunk_hash: CryptoHash
21
+ congestion_info: CongestionInfoView | None = None
22
+ encoded_length: conint(ge=0, le=18446744073709551615)
23
+ encoded_merkle_root: CryptoHash
24
+ gas_limit: NearGas
25
+ gas_used: NearGas
26
+ height_created: conint(ge=0, le=18446744073709551615)
27
+ height_included: conint(ge=0, le=18446744073709551615)
28
+ outcome_root: CryptoHash
29
+ outgoing_receipts_root: CryptoHash
30
+ prev_block_hash: CryptoHash
31
+ prev_state_root: CryptoHash
32
+ # TODO(2271): deprecated.
33
+ rent_paid: NearToken = Field(default_factory=lambda: NearToken('0'))
34
+ shard_id: ShardId
35
+ signature: Signature
36
+ tx_root: CryptoHash
37
+ validator_proposals: List[ValidatorStakeView]
38
+ # TODO(2271): deprecated.
39
+ validator_reward: NearToken = Field(default_factory=lambda: NearToken('0'))
@@ -0,0 +1,14 @@
1
+ """Configuration for a cloud-based archival writer. If this config is present, the writer is enabled and
2
+ writes chunk-related data based on the tracked shards. This config also controls additional archival
3
+ behavior such as block data and polling interval."""
4
+
5
+ from near_jsonrpc_models.duration_as_std_schema_provider import DurationAsStdSchemaProvider
6
+ from pydantic import BaseModel
7
+ from pydantic import Field
8
+
9
+
10
+ class CloudArchivalWriterConfig(BaseModel):
11
+ # Determines whether block-related data should be written to cloud storage.
12
+ archive_block_data: bool = False
13
+ # Interval at which the system checks for new blocks or chunks to archive.
14
+ polling_interval: DurationAsStdSchemaProvider = Field(default_factory=lambda: DurationAsStdSchemaProvider(**{'nanos': 0, 'secs': 1}))
@@ -0,0 +1,29 @@
1
+ from near_jsonrpc_models.account_id import AccountId
2
+ from near_jsonrpc_models.prepare_error import PrepareError
3
+ from near_jsonrpc_models.strict_model import StrictBaseModel
4
+ from pydantic import BaseModel
5
+ from pydantic import RootModel
6
+ from typing import Union
7
+
8
+
9
+ class CompilationErrorCodeDoesNotExistPayload(BaseModel):
10
+ account_id: AccountId
11
+
12
+ class CompilationErrorCodeDoesNotExist(StrictBaseModel):
13
+ CodeDoesNotExist: CompilationErrorCodeDoesNotExistPayload
14
+
15
+ class CompilationErrorPrepareError(StrictBaseModel):
16
+ PrepareError: PrepareError
17
+
18
+ class CompilationErrorWasmerCompileErrorPayload(BaseModel):
19
+ msg: str
20
+
21
+ class CompilationErrorWasmerCompileError(StrictBaseModel):
22
+ """This is for defense in depth.
23
+ We expect our runtime-independent preparation code to fully catch all invalid wasms,
24
+ but, if it ever misses something we’ll emit this error"""
25
+ WasmerCompileError: CompilationErrorWasmerCompileErrorPayload
26
+
27
+ class CompilationError(RootModel[Union[CompilationErrorCodeDoesNotExist, CompilationErrorPrepareError, CompilationErrorWasmerCompileError]]):
28
+ pass
29
+
@@ -0,0 +1,58 @@
1
+ """The configuration for congestion control. More info about congestion [here](https://near.github.io/nearcore/architecture/how/receipt-congestion.html?highlight=congestion#receipt-congestion)"""
2
+
3
+ from near_jsonrpc_models.near_gas import NearGas
4
+ from pydantic import BaseModel
5
+ from pydantic import conint
6
+
7
+
8
+ class CongestionControlConfigView(BaseModel):
9
+ # How much gas the chosen allowed shard can send to a 100% congested shard.
10
+ #
11
+ # See [`CongestionControlConfig`] for more details.
12
+ allowed_shard_outgoing_gas: NearGas = None
13
+ # How much gas in delayed receipts of a shard is 100% incoming congestion.
14
+ #
15
+ # See [`CongestionControlConfig`] for more details.
16
+ max_congestion_incoming_gas: NearGas = None
17
+ # How much memory space of all delayed and buffered receipts in a shard is
18
+ # considered 100% congested.
19
+ #
20
+ # See [`CongestionControlConfig`] for more details.
21
+ max_congestion_memory_consumption: conint(ge=0, le=18446744073709551615) = None
22
+ # How many missed chunks in a row in a shard is considered 100% congested.
23
+ max_congestion_missed_chunks: conint(ge=0, le=18446744073709551615) = None
24
+ # How much gas in outgoing buffered receipts of a shard is 100% congested.
25
+ #
26
+ # Outgoing congestion contributes to overall congestion, which reduces how
27
+ # much other shards are allowed to forward to this shard.
28
+ max_congestion_outgoing_gas: NearGas = None
29
+ # The maximum amount of gas attached to receipts a shard can forward to
30
+ # another shard per chunk.
31
+ #
32
+ # See [`CongestionControlConfig`] for more details.
33
+ max_outgoing_gas: NearGas = None
34
+ # The maximum amount of gas in a chunk spent on converting new transactions to
35
+ # receipts.
36
+ #
37
+ # See [`CongestionControlConfig`] for more details.
38
+ max_tx_gas: NearGas = None
39
+ # The minimum gas each shard can send to a shard that is not fully congested.
40
+ #
41
+ # See [`CongestionControlConfig`] for more details.
42
+ min_outgoing_gas: NearGas = None
43
+ # The minimum amount of gas in a chunk spent on converting new transactions
44
+ # to receipts, as long as the receiving shard is not congested.
45
+ #
46
+ # See [`CongestionControlConfig`] for more details.
47
+ min_tx_gas: NearGas = None
48
+ # Large size limit for outgoing receipts to a shard, used when it's safe
49
+ # to send a lot of receipts without making the state witness too large.
50
+ # It limits the total sum of outgoing receipts, not individual receipts.
51
+ outgoing_receipts_big_size_limit: conint(ge=0, le=18446744073709551615) = None
52
+ # The standard size limit for outgoing receipts aimed at a single shard.
53
+ # This limit is pretty small to keep the size of source_receipt_proofs under control.
54
+ # It limits the total sum of outgoing receipts, not individual receipts.
55
+ outgoing_receipts_usual_size_limit: conint(ge=0, le=18446744073709551615) = None
56
+ # How much congestion a shard can tolerate before it stops all shards from
57
+ # accepting new transactions with the receiver set to the congested shard.
58
+ reject_tx_congestion_threshold: float = None
@@ -0,0 +1,11 @@
1
+ """Stores the congestion level of a shard. More info about congestion [here](https://near.github.io/nearcore/architecture/how/receipt-congestion.html?highlight=congestion#receipt-congestion)"""
2
+
3
+ from pydantic import BaseModel
4
+ from pydantic import conint
5
+
6
+
7
+ class CongestionInfoView(BaseModel):
8
+ allowed_shard: conint(ge=0, le=65535)
9
+ buffered_receipts_gas: str
10
+ delayed_receipts_gas: str
11
+ receipt_bytes: conint(ge=0, le=18446744073709551615)
@@ -0,0 +1,9 @@
1
+ """A view of the contract code."""
2
+
3
+ from near_jsonrpc_models.crypto_hash import CryptoHash
4
+ from pydantic import BaseModel
5
+
6
+
7
+ class ContractCodeView(BaseModel):
8
+ code_base64: str
9
+ hash: CryptoHash
@@ -0,0 +1,10 @@
1
+ """Shows gas profile. More info [here](https://near.github.io/nearcore/architecture/gas/gas_profile.html?highlight=WASM_HOST_COST#example-transaction-gas-profile)."""
2
+
3
+ from pydantic import BaseModel
4
+
5
+
6
+ class CostGasUsed(BaseModel):
7
+ cost: str
8
+ # Either ACTION_COST or WASM_HOST_COST.
9
+ cost_category: str
10
+ gas_used: str
@@ -0,0 +1,7 @@
1
+ """Create account action"""
2
+
3
+ from pydantic import BaseModel
4
+
5
+
6
+ class CreateAccountAction(BaseModel):
7
+ pass
@@ -0,0 +1,7 @@
1
+ from pydantic import BaseModel
2
+ from pydantic import RootModel
3
+
4
+
5
+ class CryptoHash(RootModel[str]):
6
+ pass
7
+