algokit_utils.applications.app_spec.arc56 ========================================= .. py:module:: algokit_utils.applications.app_spec.arc56 Classes ------- .. autoapisummary:: algokit_utils.applications.app_spec.arc56.StructField algokit_utils.applications.app_spec.arc56.CallEnum algokit_utils.applications.app_spec.arc56.CreateEnum algokit_utils.applications.app_spec.arc56.BareActions algokit_utils.applications.app_spec.arc56.ByteCode algokit_utils.applications.app_spec.arc56.Compiler algokit_utils.applications.app_spec.arc56.CompilerVersion algokit_utils.applications.app_spec.arc56.CompilerInfo algokit_utils.applications.app_spec.arc56.Network algokit_utils.applications.app_spec.arc56.ScratchVariables algokit_utils.applications.app_spec.arc56.Source algokit_utils.applications.app_spec.arc56.Global algokit_utils.applications.app_spec.arc56.Local algokit_utils.applications.app_spec.arc56.Schema algokit_utils.applications.app_spec.arc56.TemplateVariables algokit_utils.applications.app_spec.arc56.EventArg algokit_utils.applications.app_spec.arc56.Event algokit_utils.applications.app_spec.arc56.Actions algokit_utils.applications.app_spec.arc56.DefaultValue algokit_utils.applications.app_spec.arc56.MethodArg algokit_utils.applications.app_spec.arc56.Boxes algokit_utils.applications.app_spec.arc56.Recommendations algokit_utils.applications.app_spec.arc56.Returns algokit_utils.applications.app_spec.arc56.Method algokit_utils.applications.app_spec.arc56.PcOffsetMethod algokit_utils.applications.app_spec.arc56.SourceInfo algokit_utils.applications.app_spec.arc56.StorageKey algokit_utils.applications.app_spec.arc56.StorageMap algokit_utils.applications.app_spec.arc56.Keys algokit_utils.applications.app_spec.arc56.Maps algokit_utils.applications.app_spec.arc56.State algokit_utils.applications.app_spec.arc56.ProgramSourceInfo algokit_utils.applications.app_spec.arc56.SourceInfoModel algokit_utils.applications.app_spec.arc56.Arc56Contract Module Contents --------------- .. py:class:: StructField Represents a field in a struct type. .. py:attribute:: name :type: str The name of the struct field .. py:attribute:: type :type: list[StructField] | str The type of the struct field, either a string or list of StructFields .. py:method:: from_dict(data: dict[str, Any]) -> StructField :staticmethod: .. py:class:: CallEnum Bases: :py:obj:`str`, :py:obj:`enum.Enum` Enum representing different call types for application transactions. .. py:attribute:: CLEAR_STATE :value: 'ClearState' .. py:attribute:: CLOSE_OUT :value: 'CloseOut' .. py:attribute:: DELETE_APPLICATION :value: 'DeleteApplication' .. py:attribute:: NO_OP :value: 'NoOp' .. py:attribute:: OPT_IN :value: 'OptIn' .. py:attribute:: UPDATE_APPLICATION :value: 'UpdateApplication' .. py:class:: CreateEnum Bases: :py:obj:`str`, :py:obj:`enum.Enum` Enum representing different create types for application transactions. .. py:attribute:: DELETE_APPLICATION :value: 'DeleteApplication' .. py:attribute:: NO_OP :value: 'NoOp' .. py:attribute:: OPT_IN :value: 'OptIn' .. py:class:: BareActions Represents bare call and create actions for an application. .. py:attribute:: call :type: list[CallEnum] The list of allowed call actions .. py:attribute:: create :type: list[CreateEnum] The list of allowed create actions .. py:method:: from_dict(data: dict[str, Any]) -> BareActions :staticmethod: .. py:class:: ByteCode Represents the approval and clear program bytecode. .. py:attribute:: approval :type: str The base64 encoded approval program bytecode .. py:attribute:: clear :type: str The base64 encoded clear program bytecode .. py:method:: from_dict(data: dict[str, Any]) -> ByteCode :staticmethod: .. py:class:: Compiler Bases: :py:obj:`str`, :py:obj:`enum.Enum` Enum representing different compiler types. .. py:attribute:: ALGOD :value: 'algod' .. py:attribute:: PUYA :value: 'puya' .. py:class:: CompilerVersion Represents compiler version information. .. py:attribute:: commit_hash :type: str | None :value: None The git commit hash of the compiler .. py:attribute:: major :type: int | None :value: None The major version number .. py:attribute:: minor :type: int | None :value: None The minor version number .. py:attribute:: patch :type: int | None :value: None The patch version number .. py:method:: from_dict(data: dict[str, Any]) -> CompilerVersion :staticmethod: .. py:class:: CompilerInfo Information about the compiler used. .. py:attribute:: compiler :type: Compiler The type of compiler used .. py:attribute:: compiler_version :type: CompilerVersion Version information for the compiler .. py:method:: from_dict(data: dict[str, Any]) -> CompilerInfo :staticmethod: .. py:class:: Network Network-specific application information. .. py:attribute:: app_id :type: int The application ID on the network .. py:method:: from_dict(data: dict[str, Any]) -> Network :staticmethod: .. py:class:: ScratchVariables Information about scratch space variables. .. py:attribute:: slot :type: int The scratch slot number .. py:attribute:: type :type: str The type of the scratch variable .. py:method:: from_dict(data: dict[str, Any]) -> ScratchVariables :staticmethod: .. py:class:: Source Source code for approval and clear programs. .. py:attribute:: approval :type: str The base64 encoded approval program source .. py:attribute:: clear :type: str The base64 encoded clear program source .. py:method:: from_dict(data: dict[str, Any]) -> Source :staticmethod: .. py:method:: get_decoded_approval() -> str Get decoded approval program source. :return: Decoded approval program source code .. py:method:: get_decoded_clear() -> str Get decoded clear program source. :return: Decoded clear program source code .. py:class:: Global Global state schema. .. py:attribute:: bytes :type: int The number of byte slices in global state .. py:attribute:: ints :type: int The number of integers in global state .. py:method:: from_dict(data: dict[str, Any]) -> Global :staticmethod: .. py:class:: Local Local state schema. .. py:attribute:: bytes :type: int The number of byte slices in local state .. py:attribute:: ints :type: int The number of integers in local state .. py:method:: from_dict(data: dict[str, Any]) -> Local :staticmethod: .. py:class:: Schema Application state schema. .. py:attribute:: global_state :type: Global The global state schema .. py:attribute:: local_state :type: Local The local state schema .. py:method:: from_dict(data: dict[str, Any]) -> Schema :staticmethod: .. py:class:: TemplateVariables Template variable information. .. py:attribute:: type :type: str The type of the template variable .. py:attribute:: value :type: str | None :value: None The optional value of the template variable .. py:method:: from_dict(data: dict[str, Any]) -> TemplateVariables :staticmethod: .. py:class:: EventArg Event argument information. .. py:attribute:: type :type: str The type of the event argument .. py:attribute:: desc :type: str | None :value: None The optional description of the argument .. py:attribute:: name :type: str | None :value: None The optional name of the argument .. py:attribute:: struct :type: str | None :value: None The optional struct type name .. py:method:: from_dict(data: dict[str, Any]) -> EventArg :staticmethod: .. py:class:: Event Event information. .. py:attribute:: args :type: list[EventArg] The list of event arguments .. py:attribute:: name :type: str The name of the event .. py:attribute:: desc :type: str | None :value: None The optional description of the event .. py:method:: from_dict(data: dict[str, Any]) -> Event :staticmethod: .. py:class:: Actions Method actions information. .. py:attribute:: call :type: list[CallEnum] | None :value: None The optional list of allowed call actions .. py:attribute:: create :type: list[CreateEnum] | None :value: None The optional list of allowed create actions .. py:method:: from_dict(data: dict[str, Any]) -> Actions :staticmethod: .. py:class:: DefaultValue Default value information for method arguments. .. py:attribute:: data :type: str The default value data .. py:attribute:: source :type: Literal['box', 'global', 'local', 'literal', 'method'] The source of the default value .. py:attribute:: type :type: str | None :value: None The optional type of the default value .. py:method:: from_dict(data: dict[str, Any]) -> DefaultValue :staticmethod: .. py:class:: MethodArg Method argument information. .. py:attribute:: type :type: str The type of the argument .. py:attribute:: default_value :type: DefaultValue | None :value: None The optional default value .. py:attribute:: desc :type: str | None :value: None The optional description .. py:attribute:: name :type: str | None :value: None The optional name .. py:attribute:: struct :type: str | None :value: None The optional struct type name .. py:method:: from_dict(data: dict[str, Any]) -> MethodArg :staticmethod: .. py:class:: Boxes Box storage requirements. .. py:attribute:: key :type: str The box key .. py:attribute:: read_bytes :type: int The number of bytes to read .. py:attribute:: write_bytes :type: int The number of bytes to write .. py:attribute:: app :type: int | None :value: None The optional application ID .. py:method:: from_dict(data: dict[str, Any]) -> Boxes :staticmethod: .. py:class:: Recommendations Method execution recommendations. .. py:attribute:: accounts :type: list[str] | None :value: None The optional list of accounts .. py:attribute:: apps :type: list[int] | None :value: None The optional list of applications .. py:attribute:: assets :type: list[int] | None :value: None The optional list of assets .. py:attribute:: boxes :type: Boxes | None :value: None The optional box storage requirements .. py:attribute:: inner_transaction_count :type: int | None :value: None The optional inner transaction count .. py:method:: from_dict(data: dict[str, Any]) -> Recommendations :staticmethod: .. py:class:: Returns Method return information. .. py:attribute:: type :type: str The type of the return value .. py:attribute:: desc :type: str | None :value: None The optional description .. py:attribute:: struct :type: str | None :value: None The optional struct type name .. py:method:: from_dict(data: dict[str, Any]) -> Returns :staticmethod: .. py:class:: Method Method information. .. py:attribute:: actions :type: Actions The allowed actions .. py:attribute:: args :type: list[MethodArg] The method arguments .. py:attribute:: name :type: str The method name .. py:attribute:: returns :type: Returns The return information .. py:attribute:: desc :type: str | None :value: None The optional description .. py:attribute:: events :type: list[Event] | None :value: None The optional list of events .. py:attribute:: readonly :type: bool | None :value: None The optional readonly flag .. py:attribute:: recommendations :type: Recommendations | None :value: None The optional execution recommendations .. py:method:: to_abi_method() -> algosdk.abi.Method Convert to ABI method. :raises ValueError: If underlying ABI method is not initialized :return: ABI method .. py:method:: from_dict(data: dict[str, Any]) -> Method :staticmethod: .. py:class:: PcOffsetMethod Bases: :py:obj:`str`, :py:obj:`enum.Enum` PC offset method types. .. py:attribute:: CBLOCKS :value: 'cblocks' .. py:attribute:: NONE :value: 'none' .. py:class:: SourceInfo Source code location information. .. py:attribute:: pc :type: list[int] The list of program counter values .. py:attribute:: error_message :type: str | None :value: None The optional error message .. py:attribute:: source :type: str | None :value: None The optional source code .. py:attribute:: teal :type: int | None :value: None The optional TEAL version .. py:method:: from_dict(data: dict[str, Any]) -> SourceInfo :staticmethod: .. py:class:: StorageKey Storage key information. .. py:attribute:: key :type: str The storage key .. py:attribute:: key_type :type: str The type of the key .. py:attribute:: value_type :type: str The type of the value .. py:attribute:: desc :type: str | None :value: None The optional description .. py:method:: from_dict(data: dict[str, Any]) -> StorageKey :staticmethod: .. py:class:: StorageMap Storage map information. .. py:attribute:: key_type :type: str The type of the map keys .. py:attribute:: value_type :type: str The type of the map values .. py:attribute:: desc :type: str | None :value: None The optional description .. py:attribute:: prefix :type: str | None :value: None The optional key prefix .. py:method:: from_dict(data: dict[str, Any]) -> StorageMap :staticmethod: .. py:class:: Keys Storage keys for different storage types. .. py:attribute:: box :type: dict[str, StorageKey] The box storage keys .. py:attribute:: global_state :type: dict[str, StorageKey] The global state storage keys .. py:attribute:: local_state :type: dict[str, StorageKey] The local state storage keys .. py:method:: from_dict(data: dict[str, Any]) -> Keys :staticmethod: .. py:class:: Maps Storage maps for different storage types. .. py:attribute:: box :type: dict[str, StorageMap] The box storage maps .. py:attribute:: global_state :type: dict[str, StorageMap] The global state storage maps .. py:attribute:: local_state :type: dict[str, StorageMap] The local state storage maps .. py:method:: from_dict(data: dict[str, Any]) -> Maps :staticmethod: .. py:class:: State Application state information. .. py:attribute:: keys :type: Keys The storage keys .. py:attribute:: maps :type: Maps The storage maps .. py:attribute:: schema :type: Schema The state schema .. py:method:: from_dict(data: dict[str, Any]) -> State :staticmethod: .. py:class:: ProgramSourceInfo Program source information. .. py:attribute:: pc_offset_method :type: PcOffsetMethod The PC offset method .. py:attribute:: source_info :type: list[SourceInfo] The list of source info entries .. py:method:: from_dict(data: dict[str, Any]) -> ProgramSourceInfo :staticmethod: .. py:class:: SourceInfoModel Source information for approval and clear programs. .. py:attribute:: approval :type: ProgramSourceInfo The approval program source info .. py:attribute:: clear :type: ProgramSourceInfo The clear program source info .. py:method:: from_dict(data: dict[str, Any]) -> SourceInfoModel :staticmethod: .. py:class:: Arc56Contract ARC-0056 application specification. See https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0056.md .. py:attribute:: arcs :type: list[int] The list of supported ARC version numbers .. py:attribute:: bare_actions :type: BareActions The bare call and create actions .. py:attribute:: methods :type: list[Method] The list of contract methods .. py:attribute:: name :type: str The contract name .. py:attribute:: state :type: State The contract state information .. py:attribute:: structs :type: dict[str, list[StructField]] The contract struct definitions .. py:attribute:: byte_code :type: ByteCode | None :value: None The optional bytecode for approval and clear programs .. py:attribute:: compiler_info :type: CompilerInfo | None :value: None The optional compiler information .. py:attribute:: desc :type: str | None :value: None The optional contract description .. py:attribute:: events :type: list[Event] | None :value: None The optional list of contract events .. py:attribute:: networks :type: dict[str, Network] | None :value: None The optional network deployment information .. py:attribute:: scratch_variables :type: dict[str, ScratchVariables] | None :value: None The optional scratch variable information .. py:attribute:: source :type: Source | None :value: None The optional source code .. py:attribute:: source_info :type: SourceInfoModel | None :value: None The optional source code information .. py:attribute:: template_variables :type: dict[str, TemplateVariables] | None :value: None The optional template variable information .. py:method:: from_dict(application_spec: dict) -> Arc56Contract :staticmethod: Create Arc56Contract from dictionary. :param application_spec: Dictionary containing contract specification :return: Arc56Contract instance .. py:method:: from_json(application_spec: str) -> Arc56Contract :staticmethod: .. py:method:: from_arc32(arc32_application_spec: str | algokit_utils.applications.app_spec.arc32.Arc32Contract) -> Arc56Contract :staticmethod: .. py:method:: get_abi_struct_from_abi_tuple(decoded_tuple: Any, struct_fields: list[StructField], structs: dict[str, list[StructField]]) -> dict[str, Any] :staticmethod: .. py:method:: to_json(indent: int | None = None) -> str .. py:method:: dictify() -> dict .. py:method:: get_arc56_method(method_name_or_signature: str) -> Method