algokit-utils 5.0.0a3__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 (337) hide show
  1. algokit_abi/__init__.py +9 -0
  2. algokit_abi/_arc32_to_arc56.py +242 -0
  3. algokit_abi/_arc56_serde.py +161 -0
  4. algokit_abi/abi.py +667 -0
  5. algokit_abi/arc32.py +210 -0
  6. algokit_abi/arc56.py +821 -0
  7. algokit_abi/py.typed +0 -0
  8. algokit_algo25/__init__.py +38 -0
  9. algokit_algo25/_encoding.py +46 -0
  10. algokit_algo25/_wordlist.py +2065 -0
  11. algokit_algo25/exceptions.py +29 -0
  12. algokit_algo25/mnemonic.py +128 -0
  13. algokit_algo25/py.typed +0 -0
  14. algokit_algod_client/__init__.py +10 -0
  15. algokit_algod_client/client.py +1585 -0
  16. algokit_algod_client/config.py +36 -0
  17. algokit_algod_client/exceptions.py +59 -0
  18. algokit_algod_client/models/__init__.py +229 -0
  19. algokit_algod_client/models/_account.py +150 -0
  20. algokit_algod_client/models/_account_application_response.py +25 -0
  21. algokit_algod_client/models/_account_asset_response.py +25 -0
  22. algokit_algod_client/models/_account_participation.py +53 -0
  23. algokit_algod_client/models/_account_state_delta.py +30 -0
  24. algokit_algod_client/models/_allocations_for_genesis_file.py +23 -0
  25. algokit_algod_client/models/_allocations_for_genesis_file_state_model.py +42 -0
  26. algokit_algod_client/models/_application.py +23 -0
  27. algokit_algod_client/models/_application_initial_states.py +37 -0
  28. algokit_algod_client/models/_application_kvstorage.py +29 -0
  29. algokit_algod_client/models/_application_local_state.py +33 -0
  30. algokit_algod_client/models/_application_params.py +63 -0
  31. algokit_algod_client/models/_application_state_operation.py +41 -0
  32. algokit_algod_client/models/_application_state_schema.py +22 -0
  33. algokit_algod_client/models/_asset.py +23 -0
  34. algokit_algod_client/models/_asset_holding.py +29 -0
  35. algokit_algod_client/models/_asset_params.py +102 -0
  36. algokit_algod_client/models/_avm_key_value.py +28 -0
  37. algokit_algod_client/models/_avm_value.py +32 -0
  38. algokit_algod_client/models/_block.py +363 -0
  39. algokit_algod_client/models/_block_hash_response.py +14 -0
  40. algokit_algod_client/models/_block_txids_response.py +14 -0
  41. algokit_algod_client/models/_box.py +36 -0
  42. algokit_algod_client/models/_box_descriptor.py +24 -0
  43. algokit_algod_client/models/_boxes_response.py +21 -0
  44. algokit_algod_client/models/_build_version_contains_the_current_algod_build_version_information.py +34 -0
  45. algokit_algod_client/models/_compile_response.py +24 -0
  46. algokit_algod_client/models/_disassemble_response.py +14 -0
  47. algokit_algod_client/models/_error_response.py +22 -0
  48. algokit_algod_client/models/_eval_delta.py +32 -0
  49. algokit_algod_client/models/_eval_delta_key_value.py +28 -0
  50. algokit_algod_client/models/_genesis_file_in_json.py +53 -0
  51. algokit_algod_client/models/_get_block_time_stamp_offset_response.py +14 -0
  52. algokit_algod_client/models/_get_sync_round_response.py +14 -0
  53. algokit_algod_client/models/_ledger_state_delta.py +389 -0
  54. algokit_algod_client/models/_light_block_header_proof.py +32 -0
  55. algokit_algod_client/models/_node_status_response.py +118 -0
  56. algokit_algod_client/models/_pending_transaction_response.py +91 -0
  57. algokit_algod_client/models/_pending_transactions_response.py +29 -0
  58. algokit_algod_client/models/_post_transactions_response.py +14 -0
  59. algokit_algod_client/models/_scratch_change.py +23 -0
  60. algokit_algod_client/models/_serde_helpers.py +241 -0
  61. algokit_algod_client/models/_simulate_initial_states.py +25 -0
  62. algokit_algod_client/models/_simulate_request.py +54 -0
  63. algokit_algod_client/models/_simulate_request_transaction_group.py +25 -0
  64. algokit_algod_client/models/_simulate_response.py +44 -0
  65. algokit_algod_client/models/_simulate_trace_config.py +30 -0
  66. algokit_algod_client/models/_simulate_transaction_group_result.py +46 -0
  67. algokit_algod_client/models/_simulate_transaction_result.py +41 -0
  68. algokit_algod_client/models/_simulate_unnamed_resources_accessed.py +64 -0
  69. algokit_algod_client/models/_simulation_eval_overrides.py +40 -0
  70. algokit_algod_client/models/_simulation_opcode_trace_unit.py +55 -0
  71. algokit_algod_client/models/_simulation_transaction_exec_trace.py +82 -0
  72. algokit_algod_client/models/_source_map.py +30 -0
  73. algokit_algod_client/models/_state_delta.py +6 -0
  74. algokit_algod_client/models/_state_proof.py +28 -0
  75. algokit_algod_client/models/_state_proof_message.py +44 -0
  76. algokit_algod_client/models/_supply_response.py +26 -0
  77. algokit_algod_client/models/_teal_key_value.py +28 -0
  78. algokit_algod_client/models/_teal_key_value_store.py +6 -0
  79. algokit_algod_client/models/_teal_value.py +32 -0
  80. algokit_algod_client/models/_transaction_group_ledger_state_deltas_for_round_response.py +21 -0
  81. algokit_algod_client/models/_transaction_parameters_response.py +45 -0
  82. algokit_algod_client/models/_transaction_proof.py +44 -0
  83. algokit_algod_client/models/_version_contains_the_current_algod_version.py +38 -0
  84. algokit_algod_client/models/suggested_params.py +42 -0
  85. algokit_algod_client/py.typed +1 -0
  86. algokit_algod_client/types.py +7 -0
  87. algokit_algosdk/__init__.py +38 -0
  88. algokit_algosdk/account.py +32 -0
  89. algokit_algosdk/app_access.py +228 -0
  90. algokit_algosdk/box_reference.py +100 -0
  91. algokit_algosdk/constants.py +147 -0
  92. algokit_algosdk/encoding.py +89 -0
  93. algokit_algosdk/error.py +180 -0
  94. algokit_algosdk/logic.py +61 -0
  95. algokit_algosdk/logicsig.py +218 -0
  96. algokit_algosdk/mnemonic.py +216 -0
  97. algokit_algosdk/multisig.py +161 -0
  98. algokit_algosdk/py.typed +0 -0
  99. algokit_algosdk/transaction.py +596 -0
  100. algokit_algosdk/wordlist.py +2054 -0
  101. algokit_common/__init__.py +50 -0
  102. algokit_common/address.py +34 -0
  103. algokit_common/constants.py +47 -0
  104. algokit_common/hashing.py +25 -0
  105. algokit_common/py.typed +0 -0
  106. algokit_common/serde/__init__.py +40 -0
  107. algokit_common/serde/_core.py +610 -0
  108. algokit_common/serde/_primitives.py +135 -0
  109. algokit_common/source_map.py +158 -0
  110. algokit_indexer_client/__init__.py +10 -0
  111. algokit_indexer_client/client.py +1456 -0
  112. algokit_indexer_client/config.py +36 -0
  113. algokit_indexer_client/exceptions.py +59 -0
  114. algokit_indexer_client/models/__init__.py +148 -0
  115. algokit_indexer_client/models/_account.py +161 -0
  116. algokit_indexer_client/models/_account_participation.py +53 -0
  117. algokit_indexer_client/models/_account_response.py +19 -0
  118. algokit_indexer_client/models/_account_state_delta.py +29 -0
  119. algokit_indexer_client/models/_accounts_response.py +29 -0
  120. algokit_indexer_client/models/_application.py +35 -0
  121. algokit_indexer_client/models/_application_local_state.py +45 -0
  122. algokit_indexer_client/models/_application_local_states_response.py +29 -0
  123. algokit_indexer_client/models/_application_log_data.py +28 -0
  124. algokit_indexer_client/models/_application_logs_response.py +33 -0
  125. algokit_indexer_client/models/_application_params.py +62 -0
  126. algokit_indexer_client/models/_application_response.py +20 -0
  127. algokit_indexer_client/models/_application_state_schema.py +22 -0
  128. algokit_indexer_client/models/_applications_response.py +29 -0
  129. algokit_indexer_client/models/_asset.py +35 -0
  130. algokit_indexer_client/models/_asset_balances_response.py +29 -0
  131. algokit_indexer_client/models/_asset_holding.py +41 -0
  132. algokit_indexer_client/models/_asset_holdings_response.py +29 -0
  133. algokit_indexer_client/models/_asset_params.py +102 -0
  134. algokit_indexer_client/models/_asset_response.py +19 -0
  135. algokit_indexer_client/models/_assets_response.py +29 -0
  136. algokit_indexer_client/models/_block.py +150 -0
  137. algokit_indexer_client/models/_block_headers_response.py +29 -0
  138. algokit_indexer_client/models/_block_rewards.py +38 -0
  139. algokit_indexer_client/models/_block_upgrade_state.py +34 -0
  140. algokit_indexer_client/models/_block_upgrade_vote.py +26 -0
  141. algokit_indexer_client/models/_box.py +36 -0
  142. algokit_indexer_client/models/_box_descriptor.py +24 -0
  143. algokit_indexer_client/models/_box_reference.py +28 -0
  144. algokit_indexer_client/models/_boxes_response.py +29 -0
  145. algokit_indexer_client/models/_error_response.py +18 -0
  146. algokit_indexer_client/models/_eval_delta.py +32 -0
  147. algokit_indexer_client/models/_eval_delta_key_value.py +28 -0
  148. algokit_indexer_client/models/_hash_factory.py +14 -0
  149. algokit_indexer_client/models/_hb_proof_fields.py +57 -0
  150. algokit_indexer_client/models/_health_check.py +42 -0
  151. algokit_indexer_client/models/_holding_ref.py +23 -0
  152. algokit_indexer_client/models/_indexer_state_proof_message.py +40 -0
  153. algokit_indexer_client/models/_locals_ref.py +23 -0
  154. algokit_indexer_client/models/_merkle_array_proof.py +29 -0
  155. algokit_indexer_client/models/_mini_asset_holding.py +38 -0
  156. algokit_indexer_client/models/_on_completion.py +25 -0
  157. algokit_indexer_client/models/_participation_updates.py +22 -0
  158. algokit_indexer_client/models/_resource_ref.py +42 -0
  159. algokit_indexer_client/models/_serde_helpers.py +241 -0
  160. algokit_indexer_client/models/_state_delta.py +6 -0
  161. algokit_indexer_client/models/_state_proof_fields.py +57 -0
  162. algokit_indexer_client/models/_state_proof_participant.py +20 -0
  163. algokit_indexer_client/models/_state_proof_reveal.py +25 -0
  164. algokit_indexer_client/models/_state_proof_sig_slot.py +20 -0
  165. algokit_indexer_client/models/_state_proof_signature.py +37 -0
  166. algokit_indexer_client/models/_state_proof_tracking.py +32 -0
  167. algokit_indexer_client/models/_state_proof_verifier.py +24 -0
  168. algokit_indexer_client/models/_state_schema.py +25 -0
  169. algokit_indexer_client/models/_teal_key_value.py +28 -0
  170. algokit_indexer_client/models/_teal_key_value_store.py +6 -0
  171. algokit_indexer_client/models/_teal_value.py +32 -0
  172. algokit_indexer_client/models/_transaction.py +213 -0
  173. algokit_indexer_client/models/_transaction_application.py +105 -0
  174. algokit_indexer_client/models/_transaction_asset_config.py +31 -0
  175. algokit_indexer_client/models/_transaction_asset_freeze.py +29 -0
  176. algokit_indexer_client/models/_transaction_asset_transfer.py +41 -0
  177. algokit_indexer_client/models/_transaction_heartbeat.py +52 -0
  178. algokit_indexer_client/models/_transaction_keyreg.py +59 -0
  179. algokit_indexer_client/models/_transaction_payment.py +33 -0
  180. algokit_indexer_client/models/_transaction_response.py +19 -0
  181. algokit_indexer_client/models/_transaction_signature.py +35 -0
  182. algokit_indexer_client/models/_transaction_signature_logicsig.py +59 -0
  183. algokit_indexer_client/models/_transaction_signature_multisig.py +36 -0
  184. algokit_indexer_client/models/_transaction_signature_multisig_subsignature.py +28 -0
  185. algokit_indexer_client/models/_transaction_state_proof.py +32 -0
  186. algokit_indexer_client/models/_transactions_response.py +29 -0
  187. algokit_indexer_client/py.typed +1 -0
  188. algokit_indexer_client/types.py +7 -0
  189. algokit_kmd_client/__init__.py +10 -0
  190. algokit_kmd_client/client.py +1240 -0
  191. algokit_kmd_client/config.py +36 -0
  192. algokit_kmd_client/exceptions.py +59 -0
  193. algokit_kmd_client/models/__init__.py +112 -0
  194. algokit_kmd_client/models/_classical_signatures.py +4 -0
  195. algokit_kmd_client/models/_create_wallet_request.py +30 -0
  196. algokit_kmd_client/models/_create_wallet_response.py +19 -0
  197. algokit_kmd_client/models/_delete_key_request.py +27 -0
  198. algokit_kmd_client/models/_delete_multisig_request.py +27 -0
  199. algokit_kmd_client/models/_digest_represents_a32_byte_value_holding_the256_bit_hash_digest.py +4 -0
  200. algokit_kmd_client/models/_ed25519_public_key.py +4 -0
  201. algokit_kmd_client/models/_export_key_request.py +27 -0
  202. algokit_kmd_client/models/_export_key_response.py +24 -0
  203. algokit_kmd_client/models/_export_master_key_request.py +22 -0
  204. algokit_kmd_client/models/_export_master_key_response.py +18 -0
  205. algokit_kmd_client/models/_export_multisig_request.py +23 -0
  206. algokit_kmd_client/models/_export_multisig_response.py +26 -0
  207. algokit_kmd_client/models/_generate_key_request.py +18 -0
  208. algokit_kmd_client/models/_generate_key_response.py +19 -0
  209. algokit_kmd_client/models/_import_key_request.py +28 -0
  210. algokit_kmd_client/models/_import_key_response.py +19 -0
  211. algokit_kmd_client/models/_import_multisig_request.py +30 -0
  212. algokit_kmd_client/models/_import_multisig_response.py +19 -0
  213. algokit_kmd_client/models/_init_wallet_handle_token_request.py +22 -0
  214. algokit_kmd_client/models/_init_wallet_handle_token_response.py +18 -0
  215. algokit_kmd_client/models/_list_keys_request.py +18 -0
  216. algokit_kmd_client/models/_list_keys_response.py +18 -0
  217. algokit_kmd_client/models/_list_multisig_request.py +18 -0
  218. algokit_kmd_client/models/_list_multisig_response.py +18 -0
  219. algokit_kmd_client/models/_list_wallets_request.py +11 -0
  220. algokit_kmd_client/models/_list_wallets_response.py +25 -0
  221. algokit_kmd_client/models/_master_derivation_key.py +4 -0
  222. algokit_kmd_client/models/_multisig_sig.py +33 -0
  223. algokit_kmd_client/models/_multisig_subsig.py +23 -0
  224. algokit_kmd_client/models/_public_key.py +4 -0
  225. algokit_kmd_client/models/_release_wallet_handle_token_request.py +18 -0
  226. algokit_kmd_client/models/_rename_wallet_request.py +26 -0
  227. algokit_kmd_client/models/_rename_wallet_response.py +19 -0
  228. algokit_kmd_client/models/_renew_wallet_handle_token_request.py +18 -0
  229. algokit_kmd_client/models/_renew_wallet_handle_token_response.py +19 -0
  230. algokit_kmd_client/models/_serde_helpers.py +241 -0
  231. algokit_kmd_client/models/_sign_multisig_response.py +24 -0
  232. algokit_kmd_client/models/_sign_multisig_txn_request.py +45 -0
  233. algokit_kmd_client/models/_sign_program_multisig_request.py +50 -0
  234. algokit_kmd_client/models/_sign_program_multisig_response.py +24 -0
  235. algokit_kmd_client/models/_sign_program_request.py +37 -0
  236. algokit_kmd_client/models/_sign_program_response.py +24 -0
  237. algokit_kmd_client/models/_sign_transaction_response.py +24 -0
  238. algokit_kmd_client/models/_sign_txn_request.py +36 -0
  239. algokit_kmd_client/models/_signature.py +4 -0
  240. algokit_kmd_client/models/_tx_type.py +4 -0
  241. algokit_kmd_client/models/_versions_request.py +11 -0
  242. algokit_kmd_client/models/_versions_response.py +19 -0
  243. algokit_kmd_client/models/_wallet.py +38 -0
  244. algokit_kmd_client/models/_wallet_handle.py +24 -0
  245. algokit_kmd_client/models/_wallet_info_request.py +18 -0
  246. algokit_kmd_client/models/_wallet_info_response.py +19 -0
  247. algokit_kmd_client/py.typed +1 -0
  248. algokit_kmd_client/types.py +7 -0
  249. algokit_transact/__init__.py +190 -0
  250. algokit_transact/codec/__init__.py +0 -0
  251. algokit_transact/codec/msgpack.py +11 -0
  252. algokit_transact/codec/serde.py +7 -0
  253. algokit_transact/codec/signed.py +57 -0
  254. algokit_transact/codec/transaction.py +65 -0
  255. algokit_transact/exceptions.py +17 -0
  256. algokit_transact/logicsig.py +220 -0
  257. algokit_transact/models/__init__.py +0 -0
  258. algokit_transact/models/app_call.py +447 -0
  259. algokit_transact/models/asset_config.py +19 -0
  260. algokit_transact/models/asset_freeze.py +11 -0
  261. algokit_transact/models/asset_transfer.py +13 -0
  262. algokit_transact/models/common.py +17 -0
  263. algokit_transact/models/heartbeat.py +21 -0
  264. algokit_transact/models/key_registration.py +14 -0
  265. algokit_transact/models/payment.py +14 -0
  266. algokit_transact/models/signed_transaction.py +21 -0
  267. algokit_transact/models/state_proof.py +150 -0
  268. algokit_transact/models/transaction.py +88 -0
  269. algokit_transact/multisig.py +93 -0
  270. algokit_transact/ops/__init__.py +0 -0
  271. algokit_transact/ops/fees.py +47 -0
  272. algokit_transact/ops/group.py +28 -0
  273. algokit_transact/ops/ids.py +14 -0
  274. algokit_transact/ops/validate.py +503 -0
  275. algokit_transact/py.typed +0 -0
  276. algokit_transact/signer.py +195 -0
  277. algokit_transact/signing/__init__.py +0 -0
  278. algokit_transact/signing/logic_signature.py +19 -0
  279. algokit_transact/signing/multisig.py +84 -0
  280. algokit_transact/signing/types.py +39 -0
  281. algokit_transact/signing/validation.py +63 -0
  282. algokit_utils/__init__.py +23 -0
  283. algokit_utils/_debugging.py +304 -0
  284. algokit_utils/accounts/__init__.py +2 -0
  285. algokit_utils/accounts/account_manager.py +1051 -0
  286. algokit_utils/accounts/kmd_account_manager.py +206 -0
  287. algokit_utils/algo25.py +46 -0
  288. algokit_utils/algorand.py +383 -0
  289. algokit_utils/applications/__init__.py +7 -0
  290. algokit_utils/applications/abi.py +280 -0
  291. algokit_utils/applications/app_client.py +2193 -0
  292. algokit_utils/applications/app_deployer.py +788 -0
  293. algokit_utils/applications/app_factory.py +1140 -0
  294. algokit_utils/applications/app_manager.py +575 -0
  295. algokit_utils/applications/app_spec/__init__.py +6 -0
  296. algokit_utils/applications/enums.py +40 -0
  297. algokit_utils/assets/__init__.py +1 -0
  298. algokit_utils/assets/asset_manager.py +344 -0
  299. algokit_utils/clients/__init__.py +41 -0
  300. algokit_utils/clients/client_manager.py +756 -0
  301. algokit_utils/clients/dispenser_api_client.py +212 -0
  302. algokit_utils/common.py +40 -0
  303. algokit_utils/config.py +159 -0
  304. algokit_utils/errors/__init__.py +1 -0
  305. algokit_utils/errors/logic_error.py +160 -0
  306. algokit_utils/models/__init__.py +7 -0
  307. algokit_utils/models/account.py +12 -0
  308. algokit_utils/models/amount.py +198 -0
  309. algokit_utils/models/application.py +90 -0
  310. algokit_utils/models/network.py +29 -0
  311. algokit_utils/models/simulate.py +7 -0
  312. algokit_utils/models/state.py +53 -0
  313. algokit_utils/models/transaction.py +49 -0
  314. algokit_utils/protocols/__init__.py +3 -0
  315. algokit_utils/protocols/account.py +11 -0
  316. algokit_utils/protocols/signer.py +17 -0
  317. algokit_utils/protocols/typed_clients.py +110 -0
  318. algokit_utils/py.typed +0 -0
  319. algokit_utils/transact.py +195 -0
  320. algokit_utils/transactions/__init__.py +3 -0
  321. algokit_utils/transactions/builders/__init__.py +67 -0
  322. algokit_utils/transactions/builders/app.py +248 -0
  323. algokit_utils/transactions/builders/asset.py +256 -0
  324. algokit_utils/transactions/builders/common.py +263 -0
  325. algokit_utils/transactions/builders/keyreg.py +103 -0
  326. algokit_utils/transactions/builders/method_call.py +380 -0
  327. algokit_utils/transactions/builders/payment.py +43 -0
  328. algokit_utils/transactions/composer_resources.py +409 -0
  329. algokit_utils/transactions/fee_coverage.py +79 -0
  330. algokit_utils/transactions/helpers.py +9 -0
  331. algokit_utils/transactions/transaction_composer.py +1574 -0
  332. algokit_utils/transactions/transaction_creator.py +699 -0
  333. algokit_utils/transactions/transaction_sender.py +1240 -0
  334. algokit_utils/transactions/types.py +262 -0
  335. algokit_utils-5.0.0a3.dist-info/METADATA +105 -0
  336. algokit_utils-5.0.0a3.dist-info/RECORD +337 -0
  337. algokit_utils-5.0.0a3.dist-info/WHEEL +4 -0
@@ -0,0 +1,36 @@
1
+ # AUTO-GENERATED: oas_generator
2
+
3
+
4
+ from dataclasses import dataclass, field
5
+
6
+
7
+ @dataclass(slots=True)
8
+ class ClientConfig:
9
+ """Runtime configuration for AlgodClient.
10
+
11
+ Attributes:
12
+ base_url: Base URL for the API endpoint.
13
+ token: Optional authentication token.
14
+ token_header: Header name for the authentication token.
15
+ timeout: Request timeout in seconds. Set to None for no timeout.
16
+ verify: SSL certificate verification. Can be a boolean or path to CA bundle.
17
+ extra_headers: Additional headers to include in all requests.
18
+ max_retries: Maximum number of retry attempts for transient failures.
19
+ Set to 0 to disable retries. Default is 4 (5 total attempts).
20
+ Note: Retries are automatically disabled when a custom http_client
21
+ is provided to avoid conflicts with the client's own retry mechanism.
22
+ """
23
+
24
+ base_url: str = "http://localhost:4001"
25
+ token: str | None = None
26
+ token_header: str = "X-Algo-API-Token"
27
+ timeout: float | None = 30.0
28
+ verify: bool | str = True
29
+ extra_headers: dict[str, str] = field(default_factory=dict)
30
+ max_retries: int = 4
31
+
32
+ def resolve_headers(self) -> dict[str, str]:
33
+ headers = dict(self.extra_headers)
34
+ if self.token:
35
+ headers[self.token_header] = self.token
36
+ return headers
@@ -0,0 +1,59 @@
1
+ # AUTO-GENERATED: oas_generator
2
+
3
+ from http import HTTPStatus
4
+ from json import JSONDecodeError, loads
5
+
6
+
7
+ class ApiError(RuntimeError):
8
+ """Base exception for errors raised by generated clients."""
9
+
10
+
11
+ def _format_payload(payload: object) -> str | None: # noqa: C901, PLR0912
12
+ """Extract a human-friendly message from a payload."""
13
+ if payload is None:
14
+ return None
15
+
16
+ text: str | None = None
17
+ if isinstance(payload, (bytes | bytearray | memoryview)):
18
+ try:
19
+ text = bytes(payload).decode("utf-8", errors="ignore")
20
+ except Exception:
21
+ text = None
22
+ if text is None:
23
+ text = str(payload)
24
+
25
+ result = text.strip()
26
+ if not result:
27
+ return None
28
+
29
+ try:
30
+ decoded = loads(result)
31
+ except (JSONDecodeError, TypeError):
32
+ return result
33
+
34
+ if isinstance(decoded, dict):
35
+ for key in ("message", "msg", "error", "detail", "description", "data"):
36
+ value = decoded.get(key)
37
+ if isinstance(value, str):
38
+ candidate = value.strip()
39
+ if candidate:
40
+ result = candidate
41
+ break
42
+
43
+ if isinstance(decoded, list) and decoded:
44
+ first = decoded[0]
45
+ if isinstance(first, str):
46
+ candidate = first.strip()
47
+ if candidate:
48
+ result = candidate
49
+
50
+ return result
51
+
52
+
53
+ class UnexpectedStatusError(ApiError):
54
+ def __init__(self, status_code: int, payload: object) -> None:
55
+ message = _format_payload(payload)
56
+ description = f" {message}" if message else ""
57
+ super().__init__(f"Unexpected status code {status_code}{description}")
58
+ self.status_code = HTTPStatus(status_code)
59
+ self.payload = payload
@@ -0,0 +1,229 @@
1
+ # AUTO-GENERATED: oas_generator
2
+
3
+
4
+ from algokit_transact.models.app_call import BoxReference, HoldingReference, LocalsReference
5
+ from algokit_transact.models.signed_transaction import SignedTransaction
6
+
7
+ from ._account import Account
8
+ from ._account_application_response import AccountApplicationResponse
9
+ from ._account_asset_response import AccountAssetResponse
10
+ from ._account_participation import AccountParticipation
11
+ from ._account_state_delta import AccountStateDelta
12
+ from ._allocations_for_genesis_file import AllocationsForGenesisFile
13
+ from ._allocations_for_genesis_file_state_model import AllocationsForGenesisFileStateModel
14
+ from ._application import Application
15
+ from ._application_initial_states import ApplicationInitialStates
16
+ from ._application_kvstorage import ApplicationKvstorage
17
+ from ._application_local_state import ApplicationLocalState
18
+ from ._application_params import ApplicationParams
19
+ from ._application_state_operation import ApplicationStateOperation
20
+ from ._application_state_schema import ApplicationStateSchema
21
+ from ._asset import Asset
22
+ from ._asset_holding import AssetHolding
23
+ from ._asset_params import AssetParams
24
+ from ._avm_key_value import AvmKeyValue
25
+ from ._avm_value import AvmValue
26
+ from ._block import (
27
+ ApplyData,
28
+ Block,
29
+ BlockAccountStateDelta,
30
+ BlockAppEvalDelta,
31
+ BlockEvalDelta,
32
+ BlockHeader,
33
+ BlockResponse,
34
+ BlockStateDelta,
35
+ BlockStateProofTracking,
36
+ BlockStateProofTrackingData,
37
+ ParticipationUpdates,
38
+ RewardState,
39
+ SignedTxnInBlock,
40
+ SignedTxnWithAD,
41
+ TxnCommitments,
42
+ UpgradeState,
43
+ UpgradeVote,
44
+ )
45
+ from ._block_hash_response import BlockHashResponse
46
+ from ._block_txids_response import BlockTxidsResponse
47
+ from ._box import Box
48
+ from ._box_descriptor import BoxDescriptor
49
+ from ._boxes_response import BoxesResponse
50
+ from ._build_version_contains_the_current_algod_build_version_information import (
51
+ BuildVersionContainsTheCurrentAlgodBuildVersionInformation,
52
+ )
53
+ from ._compile_response import CompileResponse
54
+ from ._disassemble_response import DisassembleResponse
55
+ from ._error_response import ErrorResponse
56
+ from ._eval_delta import EvalDelta
57
+ from ._eval_delta_key_value import EvalDeltaKeyValue
58
+ from ._genesis_file_in_json import GenesisFileInJson
59
+ from ._get_block_time_stamp_offset_response import GetBlockTimeStampOffsetResponse
60
+ from ._get_sync_round_response import GetSyncRoundResponse
61
+ from ._ledger_state_delta import (
62
+ GetTransactionGroupLedgerStateDeltasForRound,
63
+ LedgerAccountBaseData,
64
+ LedgerAccountData,
65
+ LedgerAccountDeltas,
66
+ LedgerAccountTotals,
67
+ LedgerAlgoCount,
68
+ LedgerAppLocalState,
69
+ LedgerAppLocalStateDelta,
70
+ LedgerAppParams,
71
+ LedgerAppParamsDelta,
72
+ LedgerAppResourceRecord,
73
+ LedgerAssetHolding,
74
+ LedgerAssetHoldingDelta,
75
+ LedgerAssetParams,
76
+ LedgerAssetParamsDelta,
77
+ LedgerAssetResourceRecord,
78
+ LedgerBalanceRecord,
79
+ LedgerIncludedTransactions,
80
+ LedgerKvValueDelta,
81
+ LedgerModifiedCreatable,
82
+ LedgerStateDelta,
83
+ LedgerStateDeltaForTransactionGroup,
84
+ LedgerStateSchema,
85
+ LedgerTealValue,
86
+ LedgerVotingData,
87
+ )
88
+ from ._light_block_header_proof import LightBlockHeaderProof
89
+ from ._node_status_response import NodeStatusResponse
90
+ from ._pending_transaction_response import PendingTransactionResponse
91
+ from ._pending_transactions_response import PendingTransactionsResponse
92
+ from ._post_transactions_response import PostTransactionsResponse
93
+ from ._scratch_change import ScratchChange
94
+ from ._simulate_initial_states import SimulateInitialStates
95
+ from ._simulate_request import SimulateRequest
96
+ from ._simulate_request_transaction_group import SimulateRequestTransactionGroup
97
+ from ._simulate_response import SimulateResponse
98
+ from ._simulate_trace_config import SimulateTraceConfig
99
+ from ._simulate_transaction_group_result import SimulateTransactionGroupResult
100
+ from ._simulate_transaction_result import SimulateTransactionResult
101
+ from ._simulate_unnamed_resources_accessed import SimulateUnnamedResourcesAccessed
102
+ from ._simulation_eval_overrides import SimulationEvalOverrides
103
+ from ._simulation_opcode_trace_unit import SimulationOpcodeTraceUnit
104
+ from ._simulation_transaction_exec_trace import SimulationTransactionExecTrace
105
+ from ._source_map import SourceMap
106
+ from ._state_delta import StateDelta
107
+ from ._state_proof import StateProof
108
+ from ._state_proof_message import StateProofMessage
109
+ from ._supply_response import SupplyResponse
110
+ from ._teal_key_value import TealKeyValue
111
+ from ._teal_key_value_store import TealKeyValueStore
112
+ from ._teal_value import TealValue
113
+ from ._transaction_group_ledger_state_deltas_for_round_response import TransactionGroupLedgerStateDeltasForRoundResponse
114
+ from ._transaction_parameters_response import TransactionParametersResponse
115
+ from ._transaction_proof import TransactionProof
116
+ from ._version_contains_the_current_algod_version import VersionContainsTheCurrentAlgodVersion
117
+ from .suggested_params import SuggestedParams
118
+
119
+ __all__ = [
120
+ "Account",
121
+ "AccountApplicationResponse",
122
+ "AccountAssetResponse",
123
+ "AccountParticipation",
124
+ "AccountStateDelta",
125
+ "AllocationsForGenesisFile",
126
+ "AllocationsForGenesisFileStateModel",
127
+ "Application",
128
+ "ApplicationInitialStates",
129
+ "ApplicationKvstorage",
130
+ "ApplicationLocalState",
131
+ "ApplicationParams",
132
+ "ApplicationStateOperation",
133
+ "ApplicationStateSchema",
134
+ "ApplyData",
135
+ "Asset",
136
+ "AssetHolding",
137
+ "AssetParams",
138
+ "AvmKeyValue",
139
+ "AvmValue",
140
+ "Block",
141
+ "BlockAccountStateDelta",
142
+ "BlockAppEvalDelta",
143
+ "BlockEvalDelta",
144
+ "BlockHashResponse",
145
+ "BlockHeader",
146
+ "BlockResponse",
147
+ "BlockStateDelta",
148
+ "BlockStateProofTracking",
149
+ "BlockStateProofTrackingData",
150
+ "BlockTxidsResponse",
151
+ "Box",
152
+ "BoxDescriptor",
153
+ "BoxReference",
154
+ "BoxesResponse",
155
+ "BuildVersionContainsTheCurrentAlgodBuildVersionInformation",
156
+ "CompileResponse",
157
+ "DisassembleResponse",
158
+ "ErrorResponse",
159
+ "EvalDelta",
160
+ "EvalDeltaKeyValue",
161
+ "GenesisFileInJson",
162
+ "GetBlockTimeStampOffsetResponse",
163
+ "GetSyncRoundResponse",
164
+ "GetTransactionGroupLedgerStateDeltasForRound",
165
+ "HoldingReference",
166
+ "LedgerAccountBaseData",
167
+ "LedgerAccountData",
168
+ "LedgerAccountDeltas",
169
+ "LedgerAccountTotals",
170
+ "LedgerAlgoCount",
171
+ "LedgerAppLocalState",
172
+ "LedgerAppLocalStateDelta",
173
+ "LedgerAppParams",
174
+ "LedgerAppParamsDelta",
175
+ "LedgerAppResourceRecord",
176
+ "LedgerAssetHolding",
177
+ "LedgerAssetHoldingDelta",
178
+ "LedgerAssetParams",
179
+ "LedgerAssetParamsDelta",
180
+ "LedgerAssetResourceRecord",
181
+ "LedgerBalanceRecord",
182
+ "LedgerIncludedTransactions",
183
+ "LedgerKvValueDelta",
184
+ "LedgerModifiedCreatable",
185
+ "LedgerStateDelta",
186
+ "LedgerStateDeltaForTransactionGroup",
187
+ "LedgerStateSchema",
188
+ "LedgerTealValue",
189
+ "LedgerVotingData",
190
+ "LightBlockHeaderProof",
191
+ "LocalsReference",
192
+ "NodeStatusResponse",
193
+ "ParticipationUpdates",
194
+ "PendingTransactionResponse",
195
+ "PendingTransactionsResponse",
196
+ "PostTransactionsResponse",
197
+ "RewardState",
198
+ "ScratchChange",
199
+ "SignedTransaction",
200
+ "SignedTxnInBlock",
201
+ "SignedTxnWithAD",
202
+ "SimulateInitialStates",
203
+ "SimulateRequest",
204
+ "SimulateRequestTransactionGroup",
205
+ "SimulateResponse",
206
+ "SimulateTraceConfig",
207
+ "SimulateTransactionGroupResult",
208
+ "SimulateTransactionResult",
209
+ "SimulateUnnamedResourcesAccessed",
210
+ "SimulationEvalOverrides",
211
+ "SimulationOpcodeTraceUnit",
212
+ "SimulationTransactionExecTrace",
213
+ "SourceMap",
214
+ "StateDelta",
215
+ "StateProof",
216
+ "StateProofMessage",
217
+ "SuggestedParams",
218
+ "SupplyResponse",
219
+ "TealKeyValue",
220
+ "TealKeyValueStore",
221
+ "TealValue",
222
+ "TransactionGroupLedgerStateDeltasForRoundResponse",
223
+ "TransactionParametersResponse",
224
+ "TransactionProof",
225
+ "TxnCommitments",
226
+ "UpgradeState",
227
+ "UpgradeVote",
228
+ "VersionContainsTheCurrentAlgodVersion",
229
+ ]
@@ -0,0 +1,150 @@
1
+ # AUTO-GENERATED: oas_generator
2
+
3
+
4
+ from dataclasses import dataclass, field
5
+
6
+ from algokit_common.constants import ZERO_ADDRESS
7
+ from algokit_common.serde import nested, wire
8
+
9
+ from ._account_participation import AccountParticipation
10
+ from ._application import Application
11
+ from ._application_local_state import ApplicationLocalState
12
+ from ._application_state_schema import ApplicationStateSchema
13
+ from ._asset import Asset
14
+ from ._asset_holding import AssetHolding
15
+ from ._serde_helpers import decode_model_sequence, encode_model_sequence
16
+
17
+
18
+ @dataclass(slots=True)
19
+ class Account:
20
+ """
21
+ Account information at a given round.
22
+
23
+ Definition:
24
+ data/basics/userBalance.go : AccountData
25
+ """
26
+
27
+ address: str = field(
28
+ default=ZERO_ADDRESS,
29
+ metadata=wire("address"),
30
+ )
31
+ amount: int = field(
32
+ default=0,
33
+ metadata=wire("amount"),
34
+ )
35
+ amount_without_pending_rewards: int = field(
36
+ default=0,
37
+ metadata=wire("amount-without-pending-rewards"),
38
+ )
39
+ min_balance: int = field(
40
+ default=0,
41
+ metadata=wire("min-balance"),
42
+ )
43
+ pending_rewards: int = field(
44
+ default=0,
45
+ metadata=wire("pending-rewards"),
46
+ )
47
+ rewards: int = field(
48
+ default=0,
49
+ metadata=wire("rewards"),
50
+ )
51
+ round_: int = field(
52
+ default=0,
53
+ metadata=wire("round"),
54
+ )
55
+ status: str = field(
56
+ default="",
57
+ metadata=wire("status"),
58
+ )
59
+ total_apps_opted_in: int = field(
60
+ default=0,
61
+ metadata=wire("total-apps-opted-in"),
62
+ )
63
+ total_assets_opted_in: int = field(
64
+ default=0,
65
+ metadata=wire("total-assets-opted-in"),
66
+ )
67
+ total_created_apps: int = field(
68
+ default=0,
69
+ metadata=wire("total-created-apps"),
70
+ )
71
+ total_created_assets: int = field(
72
+ default=0,
73
+ metadata=wire("total-created-assets"),
74
+ )
75
+ apps_local_state: list[ApplicationLocalState] | None = field(
76
+ default=None,
77
+ metadata=wire(
78
+ "apps-local-state",
79
+ encode=encode_model_sequence,
80
+ decode=lambda raw: decode_model_sequence(lambda: ApplicationLocalState, raw),
81
+ ),
82
+ )
83
+ apps_total_extra_pages: int | None = field(
84
+ default=None,
85
+ metadata=wire("apps-total-extra-pages"),
86
+ )
87
+ apps_total_schema: ApplicationStateSchema | None = field(
88
+ default=None,
89
+ metadata=nested("apps-total-schema", lambda: ApplicationStateSchema),
90
+ )
91
+ assets: list[AssetHolding] | None = field(
92
+ default=None,
93
+ metadata=wire(
94
+ "assets",
95
+ encode=encode_model_sequence,
96
+ decode=lambda raw: decode_model_sequence(lambda: AssetHolding, raw),
97
+ ),
98
+ )
99
+ auth_addr: str | None = field(
100
+ default=None,
101
+ metadata=wire("auth-addr"),
102
+ )
103
+ created_apps: list[Application] | None = field(
104
+ default=None,
105
+ metadata=wire(
106
+ "created-apps",
107
+ encode=encode_model_sequence,
108
+ decode=lambda raw: decode_model_sequence(lambda: Application, raw),
109
+ ),
110
+ )
111
+ created_assets: list[Asset] | None = field(
112
+ default=None,
113
+ metadata=wire(
114
+ "created-assets",
115
+ encode=encode_model_sequence,
116
+ decode=lambda raw: decode_model_sequence(lambda: Asset, raw),
117
+ ),
118
+ )
119
+ incentive_eligible: bool | None = field(
120
+ default=None,
121
+ metadata=wire("incentive-eligible"),
122
+ )
123
+ last_heartbeat: int | None = field(
124
+ default=None,
125
+ metadata=wire("last-heartbeat"),
126
+ )
127
+ last_proposed: int | None = field(
128
+ default=None,
129
+ metadata=wire("last-proposed"),
130
+ )
131
+ participation: AccountParticipation | None = field(
132
+ default=None,
133
+ metadata=nested("participation", lambda: AccountParticipation),
134
+ )
135
+ reward_base: int | None = field(
136
+ default=None,
137
+ metadata=wire("reward-base"),
138
+ )
139
+ sig_type: str | None = field(
140
+ default=None,
141
+ metadata=wire("sig-type"),
142
+ )
143
+ total_box_bytes: int | None = field(
144
+ default=None,
145
+ metadata=wire("total-box-bytes"),
146
+ )
147
+ total_boxes: int | None = field(
148
+ default=None,
149
+ metadata=wire("total-boxes"),
150
+ )
@@ -0,0 +1,25 @@
1
+ # AUTO-GENERATED: oas_generator
2
+
3
+
4
+ from dataclasses import dataclass, field
5
+
6
+ from algokit_common.serde import nested, wire
7
+
8
+ from ._application_local_state import ApplicationLocalState
9
+ from ._application_params import ApplicationParams
10
+
11
+
12
+ @dataclass(slots=True)
13
+ class AccountApplicationResponse:
14
+ round_: int = field(
15
+ default=0,
16
+ metadata=wire("round"),
17
+ )
18
+ app_local_state: ApplicationLocalState | None = field(
19
+ default=None,
20
+ metadata=nested("app-local-state", lambda: ApplicationLocalState),
21
+ )
22
+ created_app: ApplicationParams | None = field(
23
+ default=None,
24
+ metadata=nested("created-app", lambda: ApplicationParams),
25
+ )
@@ -0,0 +1,25 @@
1
+ # AUTO-GENERATED: oas_generator
2
+
3
+
4
+ from dataclasses import dataclass, field
5
+
6
+ from algokit_common.serde import nested, wire
7
+
8
+ from ._asset_holding import AssetHolding
9
+ from ._asset_params import AssetParams
10
+
11
+
12
+ @dataclass(slots=True)
13
+ class AccountAssetResponse:
14
+ round_: int = field(
15
+ default=0,
16
+ metadata=wire("round"),
17
+ )
18
+ asset_holding: AssetHolding | None = field(
19
+ default=None,
20
+ metadata=nested("asset-holding", lambda: AssetHolding),
21
+ )
22
+ created_asset: AssetParams | None = field(
23
+ default=None,
24
+ metadata=nested("created-asset", lambda: AssetParams),
25
+ )
@@ -0,0 +1,53 @@
1
+ # AUTO-GENERATED: oas_generator
2
+
3
+
4
+ from dataclasses import dataclass, field
5
+
6
+ from algokit_common.serde import wire
7
+
8
+ from ._serde_helpers import decode_fixed_bytes_base64, encode_fixed_bytes_base64
9
+
10
+
11
+ @dataclass(slots=True)
12
+ class AccountParticipation:
13
+ """
14
+ AccountParticipation describes the parameters used by this account in consensus
15
+ protocol.
16
+ """
17
+
18
+ selection_participation_key: bytes = field(
19
+ default=b"",
20
+ metadata=wire(
21
+ "selection-participation-key",
22
+ encode=lambda v: encode_fixed_bytes_base64(v, 32),
23
+ decode=lambda raw: decode_fixed_bytes_base64(raw, 32),
24
+ ),
25
+ )
26
+ vote_first_valid: int = field(
27
+ default=0,
28
+ metadata=wire("vote-first-valid"),
29
+ )
30
+ vote_key_dilution: int = field(
31
+ default=0,
32
+ metadata=wire("vote-key-dilution"),
33
+ )
34
+ vote_last_valid: int = field(
35
+ default=0,
36
+ metadata=wire("vote-last-valid"),
37
+ )
38
+ vote_participation_key: bytes = field(
39
+ default=b"",
40
+ metadata=wire(
41
+ "vote-participation-key",
42
+ encode=lambda v: encode_fixed_bytes_base64(v, 32),
43
+ decode=lambda raw: decode_fixed_bytes_base64(raw, 32),
44
+ ),
45
+ )
46
+ state_proof_key: bytes | None = field(
47
+ default=None,
48
+ metadata=wire(
49
+ "state-proof-key",
50
+ encode=lambda v: encode_fixed_bytes_base64(v, 64),
51
+ decode=lambda raw: decode_fixed_bytes_base64(raw, 64),
52
+ ),
53
+ )
@@ -0,0 +1,30 @@
1
+ # AUTO-GENERATED: oas_generator
2
+
3
+
4
+ from dataclasses import dataclass, field
5
+
6
+ from algokit_common.constants import ZERO_ADDRESS
7
+ from algokit_common.serde import wire
8
+
9
+ from ._eval_delta_key_value import EvalDeltaKeyValue
10
+ from ._serde_helpers import decode_model_sequence, encode_model_sequence
11
+
12
+
13
+ @dataclass(slots=True)
14
+ class AccountStateDelta:
15
+ """
16
+ Application state delta.
17
+ """
18
+
19
+ address: str = field(
20
+ default=ZERO_ADDRESS,
21
+ metadata=wire("address"),
22
+ )
23
+ delta: list[EvalDeltaKeyValue] = field(
24
+ default_factory=list,
25
+ metadata=wire(
26
+ "delta",
27
+ encode=encode_model_sequence,
28
+ decode=lambda raw: decode_model_sequence(lambda: EvalDeltaKeyValue, raw),
29
+ ),
30
+ )
@@ -0,0 +1,23 @@
1
+ # AUTO-GENERATED: oas_generator
2
+
3
+
4
+ from dataclasses import dataclass, field
5
+
6
+ from algokit_common.serde import nested, wire
7
+
8
+ from ._allocations_for_genesis_file_state_model import AllocationsForGenesisFileStateModel
9
+
10
+
11
+ @dataclass(slots=True)
12
+ class AllocationsForGenesisFile:
13
+ state: AllocationsForGenesisFileStateModel = field(
14
+ metadata=nested("state", lambda: AllocationsForGenesisFileStateModel, required=True),
15
+ )
16
+ addr: str = field(
17
+ default="",
18
+ metadata=wire("addr"),
19
+ )
20
+ comment: str = field(
21
+ default="",
22
+ metadata=wire("comment"),
23
+ )
@@ -0,0 +1,42 @@
1
+ # AUTO-GENERATED: oas_generator
2
+
3
+
4
+ from dataclasses import dataclass, field
5
+
6
+ from algokit_common.serde import wire
7
+
8
+
9
+ @dataclass(slots=True)
10
+ class AllocationsForGenesisFileStateModel:
11
+ algo: int = field(
12
+ default=0,
13
+ metadata=wire("algo"),
14
+ )
15
+ onl: int = field(
16
+ default=0,
17
+ metadata=wire("onl"),
18
+ )
19
+ sel: str | None = field(
20
+ default=None,
21
+ metadata=wire("sel"),
22
+ )
23
+ stprf: str | None = field(
24
+ default=None,
25
+ metadata=wire("stprf"),
26
+ )
27
+ vote: str | None = field(
28
+ default=None,
29
+ metadata=wire("vote"),
30
+ )
31
+ vote_fst: int | None = field(
32
+ default=None,
33
+ metadata=wire("voteFst"),
34
+ )
35
+ vote_kd: int | None = field(
36
+ default=None,
37
+ metadata=wire("voteKD"),
38
+ )
39
+ vote_lst: int | None = field(
40
+ default=None,
41
+ metadata=wire("voteLst"),
42
+ )