algokit_utils.applications.app_spec.arc32
Attributes
Section titled “Attributes”AppSpecStateDict | Type defining Application Specification state entries |
|---|---|
OnCompleteActionName | String literals representing on completion transaction types |
MethodConfigDict | Dictionary of dict[OnCompletionActionName, CallConfig] representing allowed actions for each on completion type |
DefaultArgumentType | Literal values describing the types of default argument sources |
StateDict |
Classes
Section titled “Classes”CallConfig | Describes the type of calls a method can be used for based on {py:class}`algosdk.transaction.OnComplete` type |
|---|---|
StructArgDict | dict() -> new empty dictionary |
DefaultArgumentDict | DefaultArgument is a container for any arguments that may |
MethodHints | MethodHints provides hints to the caller about how to call the method |
Arc32Contract | ARC-0032 application specification |
Module Contents
Section titled “Module Contents”type AppSpecStateDict = dict[str, dict[str, dict]]
Section titled “type AppSpecStateDict = dict[str, dict[str, dict]]”Type defining Application Specification state entries
class CallConfig
Section titled “class CallConfig”Bases: enum.IntFlag
Describes the type of calls a method can be used for based on {py:class}`algosdk.transaction.OnComplete` type
NEVER = 0
Section titled “NEVER = 0”Never handle the specified on completion type
CALL = 1
Section titled “CALL = 1”Only handle the specified on completion type for application calls
CREATE = 2
Section titled “CREATE = 2”Only handle the specified on completion type for application create calls
ALL = 3
Section titled “ALL = 3”Handle the specified on completion type for both create and normal application calls
class StructArgDict
Section titled “class StructArgDict”Bases: TypedDict
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
dict(iterable) -> new dictionary initialized as if via:
: d = {}
for k, v in iterable:
d[k] = v
dict(
**kwargs) -> new dictionary initialized with the name=value pairs : in the keyword argument list. For example: dict(one=1, two=2)
name : str
Section titled “name : str”elements : list[list[str]]
Section titled “elements : list[list[str]]”type OnCompleteActionName = Literal[‘no_op’, ‘opt_in’, ‘close_out’, ‘clear_state’, ‘update_application’, ‘delete_application’]
Section titled “type OnCompleteActionName = Literal[‘no_op’, ‘opt_in’, ‘close_out’, ‘clear_state’, ‘update_application’, ‘delete_application’]”String literals representing on completion transaction types
type MethodConfigDict = dict[OnCompleteActionName, CallConfig]
Section titled “type MethodConfigDict = dict[OnCompleteActionName, CallConfig]”Dictionary of dict[OnCompletionActionName, CallConfig] representing allowed actions for each on completion type
type DefaultArgumentType = Literal[‘abi-method’, ‘local-state’, ‘global-state’, ‘constant’]
Section titled “type DefaultArgumentType = Literal[‘abi-method’, ‘local-state’, ‘global-state’, ‘constant’]”Literal values describing the types of default argument sources
class DefaultArgumentDict
Section titled “class DefaultArgumentDict”Bases: TypedDict
DefaultArgument is a container for any arguments that may be resolved prior to calling some target method
source : DefaultArgumentType
Section titled “source : DefaultArgumentType”data : int | str | bytes | algosdk.abi.method.MethodDict
Section titled “data : int | str | bytes | algosdk.abi.method.MethodDict”StateDict
Section titled “StateDict”class MethodHints
Section titled “class MethodHints”MethodHints provides hints to the caller about how to call the method
read_only : bool = False
Section titled “read_only : bool = False”structs : dict[str, StructArgDict]
Section titled “structs : dict[str, StructArgDict]”default_arguments : dict[str, DefaultArgumentDict]
Section titled “default_arguments : dict[str, DefaultArgumentDict]”call_config : MethodConfigDict
Section titled “call_config : MethodConfigDict”empty() → bool
Section titled “empty() → bool”dictify() → dict[str, Any]
Section titled “dictify() → dict[str, Any]”static undictify(data: dict[str, Any]) → MethodHints
Section titled “static undictify(data: dict[str, Any]) → MethodHints”class Arc32Contract
Section titled “class Arc32Contract”ARC-0032 application specification
See <https://github.com/algorandfoundation/ARCs/pull/150>
approval_program : str
Section titled “approval_program : str”clear_program : str
Section titled “clear_program : str”contract : algosdk.abi.Contract
Section titled “contract : algosdk.abi.Contract”hints : dict[str, MethodHints]
Section titled “hints : dict[str, MethodHints]”schema : StateDict
Section titled “schema : StateDict”global_state_schema : algosdk.transaction.StateSchema
Section titled “global_state_schema : algosdk.transaction.StateSchema”local_state_schema : algosdk.transaction.StateSchema
Section titled “local_state_schema : algosdk.transaction.StateSchema”bare_call_config : MethodConfigDict
Section titled “bare_call_config : MethodConfigDict”dictify() → dict
Section titled “dictify() → dict”to_json(indent: int | None = None) → str
Section titled “to_json(indent: int | None = None) → str”static from_json(application_spec: str) → Arc32Contract
Section titled “static from_json(application_spec: str) → Arc32Contract”export(directory: pathlib.Path | str | None = None) → None
Section titled “export(directory: pathlib.Path | str | None = None) → None”Write out the artifacts generated by the application to disk.
Writes the approval program, clear program, contract specification and application specification to files in the specified directory.
- Parameters: directory – Path to the directory where the artifacts should be written. If not specified, uses the current working directory