-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathapplication.py
91 lines (75 loc) · 2.32 KB
/
application.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
from dataclasses import dataclass
from typing import TYPE_CHECKING
import algosdk
from algosdk.source_map import SourceMap
if TYPE_CHECKING:
pass
__all__ = [
"AppCompilationResult",
"AppInformation",
"AppSourceMaps",
"AppState",
"CompiledTeal",
]
@dataclass(kw_only=True, frozen=True)
class AppState:
key_raw: bytes
"""The key of the state as raw bytes"""
key_base64: str
"""The key of the state"""
value_raw: bytes | None
"""The value of the state as raw bytes"""
value_base64: str | None
"""The value of the state as base64 encoded string"""
value: str | int
"""The value of the state as a string or integer"""
@dataclass(kw_only=True, frozen=True)
class AppInformation:
app_id: int
"""The ID of the application"""
app_address: str
"""The address of the application"""
approval_program: bytes
"""The approval program"""
clear_state_program: bytes
"""The clear state program"""
creator: str
"""The creator of the application"""
global_state: dict[str, AppState]
"""The global state of the application"""
local_ints: int
"""The number of local ints"""
local_byte_slices: int
"""The number of local byte slices"""
global_ints: int
"""The number of global ints"""
global_byte_slices: int
"""The number of global byte slices"""
extra_program_pages: int | None
"""The number of extra program pages"""
@dataclass(kw_only=True, frozen=True)
class CompiledTeal:
"""The compiled teal code"""
teal: str
"""The teal code"""
compiled: str
"""The compiled teal code"""
compiled_hash: str
"""The compiled hash"""
compiled_base64_to_bytes: bytes
"""The compiled base64 to bytes"""
source_map: algosdk.source_map.SourceMap | None
@dataclass(kw_only=True, frozen=True)
class AppCompilationResult:
"""The compiled teal code"""
compiled_approval: CompiledTeal
"""The compiled approval program"""
compiled_clear: CompiledTeal
"""The compiled clear state program"""
@dataclass(kw_only=True, frozen=True)
class AppSourceMaps:
"""The source maps for the application"""
approval_source_map: SourceMap | None = None
"""The source map for the approval program"""
clear_source_map: SourceMap | None = None
"""The source map for the clear state program"""