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,27 @@
1
+ from near_jsonrpc_models.strict_model import StrictBaseModel
2
+ from near_jsonrpc_models.tx_execution_error import TxExecutionError
3
+ from pydantic import BaseModel
4
+ from pydantic import RootModel
5
+ from typing import Literal
6
+ from typing import Union
7
+
8
+
9
+ """The execution has not yet started."""
10
+ class FinalExecutionStatusNotStarted(RootModel[Literal['NotStarted']]):
11
+ pass
12
+
13
+ """The execution has started and still going."""
14
+ class FinalExecutionStatusStarted(RootModel[Literal['Started']]):
15
+ pass
16
+
17
+ class FinalExecutionStatusFailure(StrictBaseModel):
18
+ """The execution has failed with the given error."""
19
+ Failure: TxExecutionError
20
+
21
+ class FinalExecutionStatusSuccessValue(StrictBaseModel):
22
+ """The execution has succeeded and returned some value or an empty vec encoded in base64."""
23
+ SuccessValue: str
24
+
25
+ class FinalExecutionStatus(RootModel[Union[FinalExecutionStatusNotStarted, FinalExecutionStatusStarted, FinalExecutionStatusFailure, FinalExecutionStatusSuccessValue]]):
26
+ pass
27
+
@@ -0,0 +1,9 @@
1
+ """Different types of finality."""
2
+
3
+ from pydantic import RootModel
4
+ from typing import Literal
5
+
6
+
7
+ class Finality(RootModel[Literal['optimistic', 'near-final', 'final']]):
8
+ pass
9
+
@@ -0,0 +1,13 @@
1
+ """This type is used to mark function arguments.
2
+
3
+ NOTE: The main reason for this to exist (except the type-safety) is that the value is
4
+ transparently serialized and deserialized as a base64-encoded string when serde is used
5
+ (serde_json)."""
6
+
7
+ from pydantic import BaseModel
8
+ from pydantic import RootModel
9
+
10
+
11
+ class FunctionArgs(RootModel[str]):
12
+ pass
13
+
@@ -0,0 +1,10 @@
1
+ from near_jsonrpc_models.near_gas import NearGas
2
+ from near_jsonrpc_models.near_token import NearToken
3
+ from pydantic import BaseModel
4
+
5
+
6
+ class FunctionCallAction(BaseModel):
7
+ args: str
8
+ deposit: NearToken
9
+ gas: NearGas
10
+ method_name: str
@@ -0,0 +1,52 @@
1
+ """Serializable version of `near-vm-runner::FunctionCallError`.
2
+
3
+ Must never reorder/remove elements, can only add new variants at the end (but do that very
4
+ carefully). It describes stable serialization format, and only used by serialization logic."""
5
+
6
+ from near_jsonrpc_models.compilation_error import CompilationError
7
+ from near_jsonrpc_models.host_error import HostError
8
+ from near_jsonrpc_models.method_resolve_error import MethodResolveError
9
+ from near_jsonrpc_models.strict_model import StrictBaseModel
10
+ from near_jsonrpc_models.wasm_trap import WasmTrap
11
+ from pydantic import BaseModel
12
+ from pydantic import RootModel
13
+ from typing import Literal
14
+ from typing import Union
15
+
16
+
17
+ class FunctionCallErrorWasmUnknownError(RootModel[Literal['WasmUnknownError', '_EVMError']]):
18
+ pass
19
+
20
+ class FunctionCallErrorCompilationError(StrictBaseModel):
21
+ """Wasm compilation error"""
22
+ CompilationError: CompilationError
23
+
24
+ class FunctionCallErrorLinkErrorPayload(BaseModel):
25
+ msg: str
26
+
27
+ class FunctionCallErrorLinkError(StrictBaseModel):
28
+ """Wasm binary env link error
29
+
30
+ Note: this is only to deserialize old data, use execution error for new data"""
31
+ LinkError: FunctionCallErrorLinkErrorPayload
32
+
33
+ class FunctionCallErrorMethodResolveError(StrictBaseModel):
34
+ """Import/export resolve error"""
35
+ MethodResolveError: MethodResolveError
36
+
37
+ class FunctionCallErrorWasmTrap(StrictBaseModel):
38
+ """A trap happened during execution of a binary
39
+
40
+ Note: this is only to deserialize old data, use execution error for new data"""
41
+ WasmTrap: WasmTrap
42
+
43
+ class FunctionCallErrorHostError(StrictBaseModel):
44
+ """Note: this is only to deserialize old data, use execution error for new data"""
45
+ HostError: HostError
46
+
47
+ class FunctionCallErrorExecutionError(StrictBaseModel):
48
+ ExecutionError: str
49
+
50
+ class FunctionCallError(RootModel[Union[FunctionCallErrorWasmUnknownError, FunctionCallErrorCompilationError, FunctionCallErrorLinkError, FunctionCallErrorMethodResolveError, FunctionCallErrorWasmTrap, FunctionCallErrorHostError, FunctionCallErrorExecutionError]]):
51
+ pass
52
+
@@ -0,0 +1,24 @@
1
+ """Grants limited permission to make transactions with FunctionCallActions
2
+ The permission can limit the allowed balance to be spent on the prepaid gas.
3
+ It also restrict the account ID of the receiver for this function call.
4
+ It also can restrict the method name for the allowed function calls."""
5
+
6
+ from near_jsonrpc_models.near_token import NearToken
7
+ from pydantic import BaseModel
8
+ from typing import List
9
+
10
+
11
+ class FunctionCallPermission(BaseModel):
12
+ # Allowance is a balance limit to use by this access key to pay for function call gas and
13
+ # transaction fees. When this access key is used, both account balance and the allowance is
14
+ # decreased by the same value.
15
+ # `None` means unlimited allowance.
16
+ # NOTE: To change or increase the allowance, the old access key needs to be deleted and a new
17
+ # access key should be created.
18
+ allowance: NearToken | None = None
19
+ # A list of method names that can be used. The access key only allows transactions with the
20
+ # function call of one of the given method names.
21
+ # Empty list means any method name can be used.
22
+ method_names: List[str]
23
+ # The access key only allows transactions with the given receiver's account id.
24
+ receiver_id: str
@@ -0,0 +1,17 @@
1
+ """Gas key is like an access key, except it stores a balance separately, and transactions signed
2
+ with it deduct their cost from the gas key balance instead of the account balance."""
3
+
4
+ from near_jsonrpc_models.access_key_permission import AccessKeyPermission
5
+ from near_jsonrpc_models.near_token import NearToken
6
+ from pydantic import BaseModel
7
+ from pydantic import conint
8
+
9
+
10
+ class GasKey(BaseModel):
11
+ # The balance of the gas key.
12
+ balance: NearToken
13
+ # The number of nonces this gas key has.
14
+ num_nonces: conint(ge=0, le=4294967295)
15
+ # Defines the permissions for this gas key.
16
+ # If this is a `FunctionCallPermission`, the allowance must be None (unlimited).
17
+ permission: AccessKeyPermission
@@ -0,0 +1,8 @@
1
+ from near_jsonrpc_models.gas_key_view import GasKeyView
2
+ from near_jsonrpc_models.public_key import PublicKey
3
+ from pydantic import BaseModel
4
+
5
+
6
+ class GasKeyInfoView(BaseModel):
7
+ gas_key: GasKeyView
8
+ public_key: PublicKey
@@ -0,0 +1,7 @@
1
+ from near_jsonrpc_models.gas_key_info_view import GasKeyInfoView
2
+ from pydantic import BaseModel
3
+ from typing import List
4
+
5
+
6
+ class GasKeyList(BaseModel):
7
+ keys: List[GasKeyInfoView]
@@ -0,0 +1,12 @@
1
+ from near_jsonrpc_models.access_key_permission_view import AccessKeyPermissionView
2
+ from near_jsonrpc_models.near_token import NearToken
3
+ from pydantic import BaseModel
4
+ from pydantic import conint
5
+ from typing import List
6
+
7
+
8
+ class GasKeyView(BaseModel):
9
+ balance: NearToken
10
+ nonces: List[conint(ge=0, le=18446744073709551615)]
11
+ num_nonces: conint(ge=0, le=4294967295)
12
+ permission: AccessKeyPermissionView
@@ -0,0 +1,19 @@
1
+ """Configuration for garbage collection."""
2
+
3
+ from near_jsonrpc_models.duration_as_std_schema_provider import DurationAsStdSchemaProvider
4
+ from pydantic import BaseModel
5
+ from pydantic import Field
6
+ from pydantic import conint
7
+
8
+
9
+ class GCConfig(BaseModel):
10
+ # Maximum number of blocks to garbage collect at every garbage collection
11
+ # call.
12
+ gc_blocks_limit: conint(ge=0, le=18446744073709551615) = 2
13
+ # Maximum number of height to go through at each garbage collection step
14
+ # when cleaning forks during garbage collection.
15
+ gc_fork_clean_step: conint(ge=0, le=18446744073709551615) = 100
16
+ # Number of epochs for which we keep store data.
17
+ gc_num_epochs_to_keep: conint(ge=0, le=18446744073709551615) = 5
18
+ # How often gc should be run
19
+ gc_step_period: DurationAsStdSchemaProvider = Field(default_factory=lambda: DurationAsStdSchemaProvider(**{'nanos': 500000000, 'secs': 0}))
@@ -0,0 +1,121 @@
1
+ from datetime import datetime
2
+ from near_jsonrpc_models.account_id import AccountId
3
+ from near_jsonrpc_models.account_info import AccountInfo
4
+ from near_jsonrpc_models.near_gas import NearGas
5
+ from near_jsonrpc_models.near_token import NearToken
6
+ from near_jsonrpc_models.shard_layout import ShardLayout
7
+ from pydantic import BaseModel
8
+ from pydantic import Field
9
+ from pydantic import conint
10
+ from pydantic import conlist
11
+ from pydantic import field_validator
12
+ from typing import List
13
+
14
+
15
+ class GenesisConfig(BaseModel):
16
+ # Expected number of hidden validators per shard.
17
+ avg_hidden_validator_seats_per_shard: List[conint(ge=0, le=18446744073709551615)]
18
+ # Threshold for kicking out block producers, between 0 and 100.
19
+ block_producer_kickout_threshold: conint(ge=0, le=255)
20
+ # ID of the blockchain. This must be unique for every blockchain.
21
+ # If your testnet blockchains do not have unique chain IDs, you will have a bad time.
22
+ chain_id: str
23
+ # Limits the number of shard changes in chunk producer assignments,
24
+ # if algorithm is able to choose assignment with better balance of
25
+ # number of chunk producers for shards.
26
+ chunk_producer_assignment_changes_limit: conint(ge=0, le=18446744073709551615) = 5
27
+ # Threshold for kicking out chunk producers, between 0 and 100.
28
+ chunk_producer_kickout_threshold: conint(ge=0, le=255)
29
+ # Threshold for kicking out nodes which are only chunk validators, between 0 and 100.
30
+ chunk_validator_only_kickout_threshold: conint(ge=0, le=255) = 80
31
+ # Enable dynamic re-sharding.
32
+ dynamic_resharding: bool
33
+ # Epoch length counted in block heights.
34
+ epoch_length: conint(ge=0, le=18446744073709551615)
35
+ # Fishermen stake threshold.
36
+ fishermen_threshold: NearToken
37
+ # Initial gas limit.
38
+ gas_limit: NearGas
39
+ # Gas price adjustment rate
40
+ gas_price_adjustment_rate: conlist(conint(ge=-2147483648, le=2147483647), min_length=2, max_length=2)
41
+ # Height of genesis block.
42
+ genesis_height: conint(ge=0, le=18446744073709551615)
43
+ # Official time of blockchain start.
44
+ genesis_time: datetime
45
+ max_gas_price: NearToken
46
+ # Maximum inflation on the total supply every epoch.
47
+ max_inflation_rate: conlist(conint(ge=-2147483648, le=2147483647), min_length=2, max_length=2)
48
+ # Max stake percentage of the validators we will kick out.
49
+ max_kickout_stake_perc: conint(ge=0, le=255) = 100
50
+ # Minimum gas price. It is also the initial gas price.
51
+ min_gas_price: NearToken
52
+ # The minimum stake required for staking is last seat price divided by this number.
53
+ minimum_stake_divisor: conint(ge=0, le=18446744073709551615) = 10
54
+ # The lowest ratio s/s_total any block producer can have.
55
+ # See <https://github.com/near/NEPs/pull/167> for details
56
+ minimum_stake_ratio: conlist(conint(ge=-2147483648, le=2147483647), min_length=2, max_length=2) = Field(default_factory=lambda: [1, 6250])
57
+ # The minimum number of validators each shard must have
58
+ minimum_validators_per_shard: conint(ge=0, le=18446744073709551615) = 1
59
+ # Number of block producer seats at genesis.
60
+ num_block_producer_seats: conint(ge=0, le=18446744073709551615)
61
+ # Defines number of shards and number of block producer seats per each shard at genesis.
62
+ # Note: not used with protocol_feature_chunk_only_producers -- replaced by minimum_validators_per_shard
63
+ # Note: not used before as all block producers produce chunks for all shards
64
+ num_block_producer_seats_per_shard: List[conint(ge=0, le=18446744073709551615)]
65
+ # Expected number of blocks per year
66
+ num_blocks_per_year: conint(ge=0, le=18446744073709551615)
67
+ # Deprecated.
68
+ num_chunk_only_producer_seats: conint(ge=0, le=18446744073709551615) = 300
69
+ # Number of chunk producers.
70
+ # Don't mess it up with chunk-only producers feature which is deprecated.
71
+ num_chunk_producer_seats: conint(ge=0, le=18446744073709551615) = 100
72
+ num_chunk_validator_seats: conint(ge=0, le=18446744073709551615) = 300
73
+ # Online maximum threshold above which validator gets full reward.
74
+ online_max_threshold: conlist(conint(ge=-2147483648, le=2147483647), min_length=2, max_length=2) = Field(default_factory=lambda: [99, 100])
75
+ # Online minimum threshold below which validator doesn't receive reward.
76
+ online_min_threshold: conlist(conint(ge=-2147483648, le=2147483647), min_length=2, max_length=2) = Field(default_factory=lambda: [9, 10])
77
+ # Protocol treasury rate
78
+ protocol_reward_rate: conlist(conint(ge=-2147483648, le=2147483647), min_length=2, max_length=2)
79
+ # Protocol treasury account
80
+ protocol_treasury_account: AccountId
81
+ # Threshold of stake that needs to indicate that they ready for upgrade.
82
+ protocol_upgrade_stake_threshold: conlist(conint(ge=-2147483648, le=2147483647), min_length=2, max_length=2) = Field(default_factory=lambda: [4, 5])
83
+ # Protocol version that this genesis works with.
84
+ protocol_version: conint(ge=0, le=4294967295)
85
+ # Layout information regarding how to split accounts to shards
86
+ shard_layout: ShardLayout = Field(default_factory=lambda: ShardLayout(**{'V2': {'boundary_accounts': [], 'id_to_index_map': {'0': 0}, 'index_to_id_map': {'0': 0}, 'shard_ids': [0], 'version': 0}}))
87
+ # If true, shuffle the chunk producers across shards. In other words, if
88
+ # the shard assignments were `[S_0, S_1, S_2, S_3]` where `S_i` represents
89
+ # the set of chunk producers for shard `i`, if this flag were true, the
90
+ # shard assignments might become, for example, `[S_2, S_0, S_3, S_1]`.
91
+ shuffle_shard_assignment_for_chunk_producers: bool = False
92
+ # Number of target chunk validator mandates for each shard.
93
+ target_validator_mandates_per_shard: conint(ge=0, le=18446744073709551615) = 68
94
+ # Total supply of tokens at genesis.
95
+ total_supply: NearToken
96
+ # Number of blocks for which a given transaction is valid
97
+ transaction_validity_period: conint(ge=0, le=18446744073709551615)
98
+ # This is only for test purposes. We hard code some configs for mainnet and testnet
99
+ # in AllEpochConfig, and we want to have a way to test that code path. This flag is for that.
100
+ # If set to true, the node will use the same config override path as mainnet and testnet.
101
+ use_production_config: bool = False
102
+ # List of initial validators.
103
+ validators: List[AccountInfo]
104
+
105
+ @field_validator('genesis_time', mode='before')
106
+ def parse_genesis_time_to_datetime(cls, v):
107
+ from datetime import datetime
108
+ if v is None:
109
+ return v
110
+ if isinstance(v, datetime):
111
+ return v
112
+ if isinstance(v, str):
113
+ s = v
114
+ if s.endswith('Z'):
115
+ s = s[:-1] + '+00:00'
116
+ try:
117
+ return datetime.fromisoformat(s)
118
+ except Exception as e:
119
+ raise ValueError(f"genesis_time must be an ISO-8601 datetime string: {e}")
120
+ raise TypeError('genesis_time must be a datetime or ISO-8601 string')
121
+
@@ -0,0 +1,7 @@
1
+ from pydantic import RootModel
2
+ from types import NoneType
3
+
4
+
5
+ class GenesisConfigError(RootModel[NoneType]):
6
+ pass
7
+
@@ -0,0 +1,7 @@
1
+ from pydantic import RootModel
2
+ from types import NoneType
3
+
4
+
5
+ class GenesisConfigRequest(RootModel[NoneType]):
6
+ pass
7
+
@@ -0,0 +1,13 @@
1
+ """CodeHash: Contract is deployed under its code hash.
2
+ Users will be able reference it by that hash.
3
+ This effectively makes the contract immutable.AccountId: Contract is deployed under the owner account id.
4
+ Users will be able reference it by that account id.
5
+ This allows the owner to update the contract for all its users."""
6
+
7
+ from pydantic import RootModel
8
+ from typing import Literal
9
+
10
+
11
+ class GlobalContractDeployMode(RootModel[Literal['CodeHash', 'AccountId']]):
12
+ pass
13
+
@@ -0,0 +1,17 @@
1
+ from near_jsonrpc_models.account_id import AccountId
2
+ from near_jsonrpc_models.crypto_hash import CryptoHash
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 GlobalContractIdentifierCodeHash(StrictBaseModel):
10
+ CodeHash: CryptoHash
11
+
12
+ class GlobalContractIdentifierAccountId(StrictBaseModel):
13
+ AccountId: AccountId
14
+
15
+ class GlobalContractIdentifier(RootModel[Union[GlobalContractIdentifierCodeHash, GlobalContractIdentifierAccountId]]):
16
+ pass
17
+
@@ -0,0 +1,17 @@
1
+ from near_jsonrpc_models.account_id import AccountId
2
+ from near_jsonrpc_models.crypto_hash import CryptoHash
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 GlobalContractIdentifierViewHash(StrictBaseModel):
10
+ hash: CryptoHash
11
+
12
+ class GlobalContractIdentifierViewAccountId(StrictBaseModel):
13
+ account_id: AccountId
14
+
15
+ class GlobalContractIdentifierView(RootModel[Union[GlobalContractIdentifierViewHash, GlobalContractIdentifierViewAccountId]]):
16
+ pass
17
+
@@ -0,0 +1,212 @@
1
+ from near_jsonrpc_models.strict_model import StrictBaseModel
2
+ from pydantic import BaseModel
3
+ from pydantic import RootModel
4
+ from pydantic import conint
5
+ from typing import Literal
6
+ from typing import Union
7
+
8
+
9
+ """String encoding is bad UTF-16 sequence"""
10
+ class HostErrorBadUTF16(RootModel[Literal['BadUTF16']]):
11
+ pass
12
+
13
+ """String encoding is bad UTF-8 sequence"""
14
+ class HostErrorBadUTF8(RootModel[Literal['BadUTF8']]):
15
+ pass
16
+
17
+ """Exceeded the prepaid gas"""
18
+ class HostErrorGasExceeded(RootModel[Literal['GasExceeded']]):
19
+ pass
20
+
21
+ """Exceeded the maximum amount of gas allowed to burn per contract"""
22
+ class HostErrorGasLimitExceeded(RootModel[Literal['GasLimitExceeded']]):
23
+ pass
24
+
25
+ """Exceeded the account balance"""
26
+ class HostErrorBalanceExceeded(RootModel[Literal['BalanceExceeded']]):
27
+ pass
28
+
29
+ """Tried to call an empty method name"""
30
+ class HostErrorEmptyMethodName(RootModel[Literal['EmptyMethodName']]):
31
+ pass
32
+
33
+ class HostErrorGuestPanicPayload(BaseModel):
34
+ panic_msg: str
35
+
36
+ class HostErrorGuestPanic(StrictBaseModel):
37
+ """Smart contract panicked"""
38
+ GuestPanic: HostErrorGuestPanicPayload
39
+
40
+ """IntegerOverflow happened during a contract execution"""
41
+ class HostErrorIntegerOverflow(RootModel[Literal['IntegerOverflow']]):
42
+ pass
43
+
44
+ class HostErrorInvalidPromiseIndexPayload(BaseModel):
45
+ promise_idx: conint(ge=0, le=18446744073709551615)
46
+
47
+ class HostErrorInvalidPromiseIndex(StrictBaseModel):
48
+ """`promise_idx` does not correspond to existing promises"""
49
+ InvalidPromiseIndex: HostErrorInvalidPromiseIndexPayload
50
+
51
+ """Actions can only be appended to non-joint promise."""
52
+ class HostErrorCannotAppendActionToJointPromise(RootModel[Literal['CannotAppendActionToJointPromise']]):
53
+ pass
54
+
55
+ """Returning joint promise is currently prohibited"""
56
+ class HostErrorCannotReturnJointPromise(RootModel[Literal['CannotReturnJointPromise']]):
57
+ pass
58
+
59
+ class HostErrorInvalidPromiseResultIndexPayload(BaseModel):
60
+ result_idx: conint(ge=0, le=18446744073709551615)
61
+
62
+ class HostErrorInvalidPromiseResultIndex(StrictBaseModel):
63
+ """Accessed invalid promise result index"""
64
+ InvalidPromiseResultIndex: HostErrorInvalidPromiseResultIndexPayload
65
+
66
+ class HostErrorInvalidRegisterIdPayload(BaseModel):
67
+ register_id: conint(ge=0, le=18446744073709551615)
68
+
69
+ class HostErrorInvalidRegisterId(StrictBaseModel):
70
+ """Accessed invalid register id"""
71
+ InvalidRegisterId: HostErrorInvalidRegisterIdPayload
72
+
73
+ class HostErrorIteratorWasInvalidatedPayload(BaseModel):
74
+ iterator_index: conint(ge=0, le=18446744073709551615)
75
+
76
+ class HostErrorIteratorWasInvalidated(StrictBaseModel):
77
+ """Iterator `iterator_index` was invalidated after its creation by performing a mutable operation on trie"""
78
+ IteratorWasInvalidated: HostErrorIteratorWasInvalidatedPayload
79
+
80
+ """Accessed memory outside the bounds"""
81
+ class HostErrorMemoryAccessViolation(RootModel[Literal['MemoryAccessViolation']]):
82
+ pass
83
+
84
+ class HostErrorInvalidReceiptIndexPayload(BaseModel):
85
+ receipt_index: conint(ge=0, le=18446744073709551615)
86
+
87
+ class HostErrorInvalidReceiptIndex(StrictBaseModel):
88
+ """VM Logic returned an invalid receipt index"""
89
+ InvalidReceiptIndex: HostErrorInvalidReceiptIndexPayload
90
+
91
+ class HostErrorInvalidIteratorIndexPayload(BaseModel):
92
+ iterator_index: conint(ge=0, le=18446744073709551615)
93
+
94
+ class HostErrorInvalidIteratorIndex(StrictBaseModel):
95
+ """Iterator index `iterator_index` does not exist"""
96
+ InvalidIteratorIndex: HostErrorInvalidIteratorIndexPayload
97
+
98
+ """VM Logic returned an invalid account id"""
99
+ class HostErrorInvalidAccountId(RootModel[Literal['InvalidAccountId']]):
100
+ pass
101
+
102
+ """VM Logic returned an invalid method name"""
103
+ class HostErrorInvalidMethodName(RootModel[Literal['InvalidMethodName']]):
104
+ pass
105
+
106
+ """VM Logic provided an invalid public key"""
107
+ class HostErrorInvalidPublicKey(RootModel[Literal['InvalidPublicKey']]):
108
+ pass
109
+
110
+ class HostErrorProhibitedInViewPayload(BaseModel):
111
+ method_name: str
112
+
113
+ class HostErrorProhibitedInView(StrictBaseModel):
114
+ """`method_name` is not allowed in view calls"""
115
+ ProhibitedInView: HostErrorProhibitedInViewPayload
116
+
117
+ class HostErrorNumberOfLogsExceededPayload(BaseModel):
118
+ limit: conint(ge=0, le=18446744073709551615)
119
+
120
+ class HostErrorNumberOfLogsExceeded(StrictBaseModel):
121
+ """The total number of logs will exceed the limit."""
122
+ NumberOfLogsExceeded: HostErrorNumberOfLogsExceededPayload
123
+
124
+ class HostErrorKeyLengthExceededPayload(BaseModel):
125
+ length: conint(ge=0, le=18446744073709551615)
126
+ limit: conint(ge=0, le=18446744073709551615)
127
+
128
+ class HostErrorKeyLengthExceeded(StrictBaseModel):
129
+ """The storage key length exceeded the limit."""
130
+ KeyLengthExceeded: HostErrorKeyLengthExceededPayload
131
+
132
+ class HostErrorValueLengthExceededPayload(BaseModel):
133
+ length: conint(ge=0, le=18446744073709551615)
134
+ limit: conint(ge=0, le=18446744073709551615)
135
+
136
+ class HostErrorValueLengthExceeded(StrictBaseModel):
137
+ """The storage value length exceeded the limit."""
138
+ ValueLengthExceeded: HostErrorValueLengthExceededPayload
139
+
140
+ class HostErrorTotalLogLengthExceededPayload(BaseModel):
141
+ length: conint(ge=0, le=18446744073709551615)
142
+ limit: conint(ge=0, le=18446744073709551615)
143
+
144
+ class HostErrorTotalLogLengthExceeded(StrictBaseModel):
145
+ """The total log length exceeded the limit."""
146
+ TotalLogLengthExceeded: HostErrorTotalLogLengthExceededPayload
147
+
148
+ class HostErrorNumberPromisesExceededPayload(BaseModel):
149
+ limit: conint(ge=0, le=18446744073709551615)
150
+ number_of_promises: conint(ge=0, le=18446744073709551615)
151
+
152
+ class HostErrorNumberPromisesExceeded(StrictBaseModel):
153
+ """The maximum number of promises within a FunctionCall exceeded the limit."""
154
+ NumberPromisesExceeded: HostErrorNumberPromisesExceededPayload
155
+
156
+ class HostErrorNumberInputDataDependenciesExceededPayload(BaseModel):
157
+ limit: conint(ge=0, le=18446744073709551615)
158
+ number_of_input_data_dependencies: conint(ge=0, le=18446744073709551615)
159
+
160
+ class HostErrorNumberInputDataDependenciesExceeded(StrictBaseModel):
161
+ """The maximum number of input data dependencies exceeded the limit."""
162
+ NumberInputDataDependenciesExceeded: HostErrorNumberInputDataDependenciesExceededPayload
163
+
164
+ class HostErrorReturnedValueLengthExceededPayload(BaseModel):
165
+ length: conint(ge=0, le=18446744073709551615)
166
+ limit: conint(ge=0, le=18446744073709551615)
167
+
168
+ class HostErrorReturnedValueLengthExceeded(StrictBaseModel):
169
+ """The returned value length exceeded the limit."""
170
+ ReturnedValueLengthExceeded: HostErrorReturnedValueLengthExceededPayload
171
+
172
+ class HostErrorContractSizeExceededPayload(BaseModel):
173
+ limit: conint(ge=0, le=18446744073709551615)
174
+ size: conint(ge=0, le=18446744073709551615)
175
+
176
+ class HostErrorContractSizeExceeded(StrictBaseModel):
177
+ """The contract size for DeployContract action exceeded the limit."""
178
+ ContractSizeExceeded: HostErrorContractSizeExceededPayload
179
+
180
+ class HostErrorDeprecatedPayload(BaseModel):
181
+ method_name: str
182
+
183
+ class HostErrorDeprecated(StrictBaseModel):
184
+ """The host function was deprecated."""
185
+ Deprecated: HostErrorDeprecatedPayload
186
+
187
+ class HostErrorECRecoverErrorPayload(BaseModel):
188
+ msg: str
189
+
190
+ class HostErrorECRecoverError(StrictBaseModel):
191
+ """General errors for ECDSA recover."""
192
+ ECRecoverError: HostErrorECRecoverErrorPayload
193
+
194
+ class HostErrorAltBn128InvalidInputPayload(BaseModel):
195
+ msg: str
196
+
197
+ class HostErrorAltBn128InvalidInput(StrictBaseModel):
198
+ """Invalid input to alt_bn128 family of functions (e.g., point which isn't
199
+ on the curve)."""
200
+ AltBn128InvalidInput: HostErrorAltBn128InvalidInputPayload
201
+
202
+ class HostErrorEd25519VerifyInvalidInputPayload(BaseModel):
203
+ msg: str
204
+
205
+ class HostErrorEd25519VerifyInvalidInput(StrictBaseModel):
206
+ """Invalid input to ed25519 signature verification function (e.g. signature cannot be
207
+ derived from bytes)."""
208
+ Ed25519VerifyInvalidInput: HostErrorEd25519VerifyInvalidInputPayload
209
+
210
+ class HostError(RootModel[Union[HostErrorBadUTF16, HostErrorBadUTF8, HostErrorGasExceeded, HostErrorGasLimitExceeded, HostErrorBalanceExceeded, HostErrorEmptyMethodName, HostErrorGuestPanic, HostErrorIntegerOverflow, HostErrorInvalidPromiseIndex, HostErrorCannotAppendActionToJointPromise, HostErrorCannotReturnJointPromise, HostErrorInvalidPromiseResultIndex, HostErrorInvalidRegisterId, HostErrorIteratorWasInvalidated, HostErrorMemoryAccessViolation, HostErrorInvalidReceiptIndex, HostErrorInvalidIteratorIndex, HostErrorInvalidAccountId, HostErrorInvalidMethodName, HostErrorInvalidPublicKey, HostErrorProhibitedInView, HostErrorNumberOfLogsExceeded, HostErrorKeyLengthExceeded, HostErrorValueLengthExceeded, HostErrorTotalLogLengthExceeded, HostErrorNumberPromisesExceeded, HostErrorNumberInputDataDependenciesExceeded, HostErrorReturnedValueLengthExceeded, HostErrorContractSizeExceeded, HostErrorDeprecated, HostErrorECRecoverError, HostErrorAltBn128InvalidInput, HostErrorEd25519VerifyInvalidInput]]):
211
+ pass
212
+
@@ -0,0 +1,16 @@
1
+ from pydantic import BaseModel
2
+ from pydantic import RootModel
3
+ from typing import Literal
4
+ from typing import Union
5
+
6
+
7
+ class InternalErrorInternalErrorInfo(BaseModel):
8
+ error_message: str
9
+
10
+ class InternalErrorInternalError(BaseModel):
11
+ info: InternalErrorInternalErrorInfo
12
+ name: Literal['INTERNAL_ERROR']
13
+
14
+ class InternalError(RootModel[Union[InternalErrorInternalError]]):
15
+ pass
16
+