arc56-generated-d13co-ghostkit 1.2.2026072010__tar.gz

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.
@@ -0,0 +1,16 @@
1
+ # .NET build output
2
+ bin/
3
+ obj/
4
+ artifacts/
5
+
6
+ # npm/TypeScript build output
7
+ node_modules/
8
+ clients/*/*/npm/dist/
9
+
10
+ # Python
11
+ __pycache__/
12
+ *.pyc
13
+
14
+ # OS
15
+ .DS_Store
16
+ Thumbs.db
@@ -0,0 +1,73 @@
1
+ Metadata-Version: 2.5
2
+ Name: arc56-generated-d13co-ghostkit
3
+ Version: 1.2.2026072010
4
+ Summary: Generated ARC-56 Algorand smart-contract clients for d13co/ghostkit.
5
+ Project-URL: Homepage, https://github.com/scholtz/Arc56Registry
6
+ Project-URL: Repository, https://github.com/scholtz/Arc56Registry
7
+ Author: d13co
8
+ Keywords: algorand,arc56,avm,d13co,generated-client,ghostkit,smart-contract
9
+ Requires-Python: >=3.10
10
+ Requires-Dist: algokit-utils<5.0.0,>=4.2.3
11
+ Requires-Dist: py-algorand-sdk<3.0.0,>=2.11.1
12
+ Description-Content-Type: text/markdown
13
+
14
+ # arc56-generated-d13co-ghostkit
15
+
16
+ Auto-generated typed Algorand smart-contract clients for **[d13co/ghostkit](https://github.com/d13co/ghostkit)**,
17
+ built from the [ARC-56](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0056.md)
18
+ specs listed below.
19
+
20
+ Generated by the [Arc56Registry](https://github.com/scholtz/Arc56Registry) pipeline,
21
+ using the [algorandfoundation/algokit-client-generator-py](https://github.com/algorandfoundation/algokit-client-generator-py)
22
+ ARC-56 client generator. Do not edit these files by hand — they are regenerated
23
+ automatically whenever the source ARC-56 spec changes.
24
+
25
+ ## Install
26
+
27
+ ```bash
28
+ pip install arc56-generated-d13co-ghostkit
29
+ ```
30
+
31
+ ## Basic usage
32
+
33
+ Each contract in this package is a separate module (a hash of its source URL is
34
+ appended to its filename to keep multiple contracts in the same repository from
35
+ colliding), containing a typed `<Name>Client` for interacting with an already-deployed
36
+ instance of that contract, plus a `<Name>Factory` for deploying new instances.
37
+
38
+ ```python
39
+ from algokit_utils import AlgorandClient
40
+ from arc56_generated_d13co_ghostkit import Ghostofavm_a552bf7f
41
+
42
+ algorand = AlgorandClient.mainnet()
43
+ client = Ghostofavm_a552bf7f.GhostofavmClient(
44
+ algorand=algorand,
45
+ app_id=123456789,
46
+ )
47
+
48
+ # call a contract method, e.g.:
49
+ # result = client.send.some_method(args=(...))
50
+ ```
51
+
52
+ ### `full` vs `minimal` generator mode
53
+
54
+ Contracts in this package are generated with the client generator's `full` mode by
55
+ default, which emits both the typed `Client` and a deploy/create `Factory` class plus
56
+ deployment metadata (source code, bytecode, template variables). For the rare contract
57
+ whose `full`-mode output fails to generate or fails to byte-compile, this package falls
58
+ back to `minimal` mode (`Client` only, no `Factory`) for that contract instead of
59
+ failing outright. The contracts table below flags any contract generated this way;
60
+ every other contract includes a working `Factory`.
61
+
62
+ ## Contracts included in this package
63
+
64
+ | Module | Client class | Source ARC-56 spec |
65
+ | --- | --- | --- |
66
+ | `Ghostofavm_a552bf7f` | `GhostofavmClient` | [https://raw.githubusercontent.com/d13co/ghostkit/HEAD/examples/Ghostofavm.arc56.json](https://raw.githubusercontent.com/d13co/ghostkit/HEAD/examples/Ghostofavm.arc56.json) |
67
+
68
+ ## Versioning
69
+
70
+ This package uses `1.<increment>.<yyyyMMddHH>`-style versioning: a new version is
71
+ published whenever any of the contracts above change, or whenever the client generator
72
+ itself is updated. See [Arc56Registry](https://github.com/scholtz/Arc56Registry) for
73
+ the full generation pipeline and source ARC-56 registry.
@@ -0,0 +1,60 @@
1
+ # arc56-generated-d13co-ghostkit
2
+
3
+ Auto-generated typed Algorand smart-contract clients for **[d13co/ghostkit](https://github.com/d13co/ghostkit)**,
4
+ built from the [ARC-56](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0056.md)
5
+ specs listed below.
6
+
7
+ Generated by the [Arc56Registry](https://github.com/scholtz/Arc56Registry) pipeline,
8
+ using the [algorandfoundation/algokit-client-generator-py](https://github.com/algorandfoundation/algokit-client-generator-py)
9
+ ARC-56 client generator. Do not edit these files by hand — they are regenerated
10
+ automatically whenever the source ARC-56 spec changes.
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ pip install arc56-generated-d13co-ghostkit
16
+ ```
17
+
18
+ ## Basic usage
19
+
20
+ Each contract in this package is a separate module (a hash of its source URL is
21
+ appended to its filename to keep multiple contracts in the same repository from
22
+ colliding), containing a typed `<Name>Client` for interacting with an already-deployed
23
+ instance of that contract, plus a `<Name>Factory` for deploying new instances.
24
+
25
+ ```python
26
+ from algokit_utils import AlgorandClient
27
+ from arc56_generated_d13co_ghostkit import Ghostofavm_a552bf7f
28
+
29
+ algorand = AlgorandClient.mainnet()
30
+ client = Ghostofavm_a552bf7f.GhostofavmClient(
31
+ algorand=algorand,
32
+ app_id=123456789,
33
+ )
34
+
35
+ # call a contract method, e.g.:
36
+ # result = client.send.some_method(args=(...))
37
+ ```
38
+
39
+ ### `full` vs `minimal` generator mode
40
+
41
+ Contracts in this package are generated with the client generator's `full` mode by
42
+ default, which emits both the typed `Client` and a deploy/create `Factory` class plus
43
+ deployment metadata (source code, bytecode, template variables). For the rare contract
44
+ whose `full`-mode output fails to generate or fails to byte-compile, this package falls
45
+ back to `minimal` mode (`Client` only, no `Factory`) for that contract instead of
46
+ failing outright. The contracts table below flags any contract generated this way;
47
+ every other contract includes a working `Factory`.
48
+
49
+ ## Contracts included in this package
50
+
51
+ | Module | Client class | Source ARC-56 spec |
52
+ | --- | --- | --- |
53
+ | `Ghostofavm_a552bf7f` | `GhostofavmClient` | [https://raw.githubusercontent.com/d13co/ghostkit/HEAD/examples/Ghostofavm.arc56.json](https://raw.githubusercontent.com/d13co/ghostkit/HEAD/examples/Ghostofavm.arc56.json) |
54
+
55
+ ## Versioning
56
+
57
+ This package uses `1.<increment>.<yyyyMMddHH>`-style versioning: a new version is
58
+ published whenever any of the contracts above change, or whenever the client generator
59
+ itself is updated. See [Arc56Registry](https://github.com/scholtz/Arc56Registry) for
60
+ the full generation pipeline and source ARC-56 registry.
@@ -0,0 +1,23 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "arc56-generated-d13co-ghostkit"
7
+ version = "1.2.2026072010"
8
+ description = "Generated ARC-56 Algorand smart-contract clients for d13co/ghostkit."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ authors = [{ name = "d13co" }]
12
+ keywords = ["algorand", "arc56", "avm", "smart-contract", "generated-client", "d13co", "ghostkit"]
13
+ dependencies = [
14
+ "algokit-utils>=4.2.3,<5.0.0",
15
+ "py-algorand-sdk>=2.11.1,<3.0.0",
16
+ ]
17
+
18
+ [project.urls]
19
+ Homepage = "https://github.com/scholtz/Arc56Registry"
20
+ Repository = "https://github.com/scholtz/Arc56Registry"
21
+
22
+ [tool.hatch.build.targets.wheel]
23
+ packages = ["src/arc56_generated_d13co_ghostkit"]
@@ -0,0 +1,826 @@
1
+ # flake8: noqa
2
+ # fmt: off
3
+ # mypy: ignore-errors
4
+ # This file was automatically generated by algokit-client-generator.
5
+ # DO NOT MODIFY IT BY HAND.
6
+ # requires: algokit-utils@^3.0.0
7
+
8
+ # common
9
+ import dataclasses
10
+ import typing
11
+ # core algosdk
12
+ import algosdk
13
+ from algosdk.transaction import OnComplete
14
+ from algosdk.atomic_transaction_composer import TransactionSigner
15
+ from algosdk.source_map import SourceMap
16
+ from algosdk.transaction import Transaction
17
+ from algosdk.v2client.models import SimulateTraceConfig
18
+ # utils
19
+ import algokit_utils
20
+ from algokit_utils import AlgorandClient as _AlgoKitAlgorandClient
21
+
22
+ _APP_SPEC_JSON = r"""{"arcs": [22, 28], "bareActions": {"call": [], "create": []}, "methods": [{"actions": {"call": ["NoOp"], "create": ["NoOp"]}, "args": [{"type": "uint64", "name": "firstRound"}, {"type": "uint64", "name": "lastRound"}], "name": "blkTimestamp", "returns": {"type": "uint64"}, "events": [], "readonly": true, "recommendations": {}}, {"actions": {"call": ["NoOp"], "create": ["NoOp"]}, "args": [{"type": "uint64", "name": "firstRound"}, {"type": "uint64", "name": "lastRound"}], "name": "blkTxnCounter", "returns": {"type": "uint64"}, "events": [], "readonly": true, "recommendations": {}}, {"actions": {"call": ["NoOp"], "create": ["NoOp"]}, "args": [{"type": "uint64", "name": "firstRound"}, {"type": "uint64", "name": "lastRound"}], "name": "blkProposer", "returns": {"type": "address"}, "events": [], "readonly": true, "recommendations": {}}, {"actions": {"call": ["NoOp"], "create": ["NoOp"]}, "args": [{"type": "uint64", "name": "firstRound"}, {"type": "uint64", "name": "lastRound"}], "name": "blkData", "returns": {"type": "(uint64,uint64,uint64,address)", "struct": "BlkData"}, "events": [], "readonly": true, "recommendations": {}}, {"actions": {"call": ["NoOp"], "create": ["NoOp"]}, "args": [{"type": "address[]", "name": "accounts"}], "name": "acctBalanceData", "returns": {"type": "(address,uint64,uint64)", "struct": "AcctBalanceData"}, "events": [], "readonly": true, "recommendations": {}}], "name": "Ghostofavm", "state": {"keys": {"box": {}, "global": {}, "local": {}}, "maps": {"box": {}, "global": {}, "local": {}}, "schema": {"global": {"bytes": 0, "ints": 0}, "local": {"bytes": 0, "ints": 0}}}, "structs": {"AcctBalanceData": [{"name": "address", "type": "address"}, {"name": "balance", "type": "uint64"}, {"name": "minBalance", "type": "uint64"}], "BlkData": [{"name": "round", "type": "uint64"}, {"name": "timestamp", "type": "uint64"}, {"name": "txnCounter", "type": "uint64"}, {"name": "proposer", "type": "address"}]}, "events": [], "networks": {}, "sourceInfo": {"approval": {"pcOffsetMethod": "none", "sourceInfo": [{"pc": [24], "errorMessage": "OnCompletion must be NoOp"}, {"pc": [343], "errorMessage": "index access is out of bounds"}]}, "clear": {"pcOffsetMethod": "none", "sourceInfo": []}}}"""
23
+ APP_SPEC = algokit_utils.Arc56Contract.from_json(_APP_SPEC_JSON)
24
+
25
+ def _parse_abi_args(args: object | None = None) -> list[object] | None:
26
+ """Helper to parse ABI args into the format expected by underlying client"""
27
+ if args is None:
28
+ return None
29
+
30
+ def convert_dataclass(value: object) -> object:
31
+ if dataclasses.is_dataclass(value):
32
+ return tuple(convert_dataclass(getattr(value, field.name)) for field in dataclasses.fields(value))
33
+ elif isinstance(value, (list, tuple)):
34
+ return type(value)(convert_dataclass(item) for item in value)
35
+ return value
36
+
37
+ match args:
38
+ case tuple():
39
+ method_args = list(args)
40
+ case _ if dataclasses.is_dataclass(args):
41
+ method_args = [getattr(args, field.name) for field in dataclasses.fields(args)]
42
+ case _:
43
+ raise ValueError("Invalid 'args' type. Expected 'tuple' or 'TypedDict' for respective typed arguments.")
44
+
45
+ return [
46
+ convert_dataclass(arg) if not isinstance(arg, algokit_utils.AppMethodCallTransactionArgument) else arg
47
+ for arg in method_args
48
+ ] if method_args else None
49
+
50
+ def _init_dataclass(cls: type, data: dict) -> object:
51
+ """
52
+ Recursively instantiate a dataclass of type `cls` from `data`.
53
+
54
+ For each field on the dataclass, if the field type is also a dataclass
55
+ and the corresponding data is a dict, instantiate that field recursively.
56
+ """
57
+ field_values = {}
58
+ for field in dataclasses.fields(cls):
59
+ field_value = data.get(field.name)
60
+ # Check if the field expects another dataclass and the value is a dict.
61
+ if dataclasses.is_dataclass(field.type) and isinstance(field_value, dict):
62
+ field_values[field.name] = _init_dataclass(typing.cast(type, field.type), field_value)
63
+ else:
64
+ field_values[field.name] = field_value
65
+ return cls(**field_values)
66
+
67
+ @dataclasses.dataclass(frozen=True)
68
+ class AcctBalanceData:
69
+ """Struct for AcctBalanceData"""
70
+ address: str
71
+ balance: int
72
+ minBalance: int
73
+
74
+ @dataclasses.dataclass(frozen=True)
75
+ class BlkData:
76
+ """Struct for BlkData"""
77
+ round: int
78
+ timestamp: int
79
+ txnCounter: int
80
+ proposer: str
81
+
82
+
83
+ @dataclasses.dataclass(frozen=True, kw_only=True)
84
+ class BlkTimestampArgs:
85
+ """Dataclass for blk_timestamp arguments"""
86
+ firstRound: int
87
+ lastRound: int
88
+
89
+ @property
90
+ def abi_method_signature(self) -> str:
91
+ return "blkTimestamp(uint64,uint64)uint64"
92
+
93
+ @dataclasses.dataclass(frozen=True, kw_only=True)
94
+ class BlkTxnCounterArgs:
95
+ """Dataclass for blk_txn_counter arguments"""
96
+ firstRound: int
97
+ lastRound: int
98
+
99
+ @property
100
+ def abi_method_signature(self) -> str:
101
+ return "blkTxnCounter(uint64,uint64)uint64"
102
+
103
+ @dataclasses.dataclass(frozen=True, kw_only=True)
104
+ class BlkProposerArgs:
105
+ """Dataclass for blk_proposer arguments"""
106
+ firstRound: int
107
+ lastRound: int
108
+
109
+ @property
110
+ def abi_method_signature(self) -> str:
111
+ return "blkProposer(uint64,uint64)address"
112
+
113
+ @dataclasses.dataclass(frozen=True, kw_only=True)
114
+ class BlkDataArgs:
115
+ """Dataclass for blk_data arguments"""
116
+ firstRound: int
117
+ lastRound: int
118
+
119
+ @property
120
+ def abi_method_signature(self) -> str:
121
+ return "blkData(uint64,uint64)(uint64,uint64,uint64,address)"
122
+
123
+ @dataclasses.dataclass(frozen=True, kw_only=True)
124
+ class AcctBalanceDataArgs:
125
+ """Dataclass for acct_balance_data arguments"""
126
+ accounts: list[str]
127
+
128
+ @property
129
+ def abi_method_signature(self) -> str:
130
+ return "acctBalanceData(address[])(address,uint64,uint64)"
131
+
132
+ @dataclasses.dataclass(frozen=True, kw_only=True)
133
+ class BlkTimestampArgs:
134
+ """Dataclass for blk_timestamp arguments"""
135
+ firstRound: int
136
+ lastRound: int
137
+
138
+ @property
139
+ def abi_method_signature(self) -> str:
140
+ return "blkTimestamp(uint64,uint64)uint64"
141
+
142
+ @dataclasses.dataclass(frozen=True, kw_only=True)
143
+ class BlkTxnCounterArgs:
144
+ """Dataclass for blk_txn_counter arguments"""
145
+ firstRound: int
146
+ lastRound: int
147
+
148
+ @property
149
+ def abi_method_signature(self) -> str:
150
+ return "blkTxnCounter(uint64,uint64)uint64"
151
+
152
+ @dataclasses.dataclass(frozen=True, kw_only=True)
153
+ class BlkProposerArgs:
154
+ """Dataclass for blk_proposer arguments"""
155
+ firstRound: int
156
+ lastRound: int
157
+
158
+ @property
159
+ def abi_method_signature(self) -> str:
160
+ return "blkProposer(uint64,uint64)address"
161
+
162
+ @dataclasses.dataclass(frozen=True, kw_only=True)
163
+ class BlkDataArgs:
164
+ """Dataclass for blk_data arguments"""
165
+ firstRound: int
166
+ lastRound: int
167
+
168
+ @property
169
+ def abi_method_signature(self) -> str:
170
+ return "blkData(uint64,uint64)(uint64,uint64,uint64,address)"
171
+
172
+ @dataclasses.dataclass(frozen=True, kw_only=True)
173
+ class AcctBalanceDataArgs:
174
+ """Dataclass for acct_balance_data arguments"""
175
+ accounts: list[str]
176
+
177
+ @property
178
+ def abi_method_signature(self) -> str:
179
+ return "acctBalanceData(address[])(address,uint64,uint64)"
180
+
181
+
182
+ class GhostofavmParams:
183
+ def __init__(self, app_client: algokit_utils.AppClient):
184
+ self.app_client = app_client
185
+
186
+ def blk_timestamp(
187
+ self,
188
+ args: tuple[int, int] | BlkTimestampArgs,
189
+ params: algokit_utils.CommonAppCallParams | None = None
190
+ ) -> algokit_utils.AppCallMethodCallParams:
191
+ method_args = _parse_abi_args(args)
192
+ params = params or algokit_utils.CommonAppCallParams()
193
+ return self.app_client.params.call(algokit_utils.AppClientMethodCallParams(**{
194
+ **dataclasses.asdict(params),
195
+ "method": "blkTimestamp(uint64,uint64)uint64",
196
+ "args": method_args,
197
+ }))
198
+
199
+ def blk_txn_counter(
200
+ self,
201
+ args: tuple[int, int] | BlkTxnCounterArgs,
202
+ params: algokit_utils.CommonAppCallParams | None = None
203
+ ) -> algokit_utils.AppCallMethodCallParams:
204
+ method_args = _parse_abi_args(args)
205
+ params = params or algokit_utils.CommonAppCallParams()
206
+ return self.app_client.params.call(algokit_utils.AppClientMethodCallParams(**{
207
+ **dataclasses.asdict(params),
208
+ "method": "blkTxnCounter(uint64,uint64)uint64",
209
+ "args": method_args,
210
+ }))
211
+
212
+ def blk_proposer(
213
+ self,
214
+ args: tuple[int, int] | BlkProposerArgs,
215
+ params: algokit_utils.CommonAppCallParams | None = None
216
+ ) -> algokit_utils.AppCallMethodCallParams:
217
+ method_args = _parse_abi_args(args)
218
+ params = params or algokit_utils.CommonAppCallParams()
219
+ return self.app_client.params.call(algokit_utils.AppClientMethodCallParams(**{
220
+ **dataclasses.asdict(params),
221
+ "method": "blkProposer(uint64,uint64)address",
222
+ "args": method_args,
223
+ }))
224
+
225
+ def blk_data(
226
+ self,
227
+ args: tuple[int, int] | BlkDataArgs,
228
+ params: algokit_utils.CommonAppCallParams | None = None
229
+ ) -> algokit_utils.AppCallMethodCallParams:
230
+ method_args = _parse_abi_args(args)
231
+ params = params or algokit_utils.CommonAppCallParams()
232
+ return self.app_client.params.call(algokit_utils.AppClientMethodCallParams(**{
233
+ **dataclasses.asdict(params),
234
+ "method": "blkData(uint64,uint64)(uint64,uint64,uint64,address)",
235
+ "args": method_args,
236
+ }))
237
+
238
+ def acct_balance_data(
239
+ self,
240
+ args: tuple[list[str]] | AcctBalanceDataArgs,
241
+ params: algokit_utils.CommonAppCallParams | None = None
242
+ ) -> algokit_utils.AppCallMethodCallParams:
243
+ method_args = _parse_abi_args(args)
244
+ params = params or algokit_utils.CommonAppCallParams()
245
+ return self.app_client.params.call(algokit_utils.AppClientMethodCallParams(**{
246
+ **dataclasses.asdict(params),
247
+ "method": "acctBalanceData(address[])(address,uint64,uint64)",
248
+ "args": method_args,
249
+ }))
250
+
251
+ def clear_state(
252
+ self,
253
+ params: algokit_utils.AppClientBareCallParams | None = None,
254
+
255
+ ) -> algokit_utils.AppCallParams:
256
+ return self.app_client.params.bare.clear_state(
257
+ params,
258
+
259
+ )
260
+
261
+
262
+ class GhostofavmCreateTransactionParams:
263
+ def __init__(self, app_client: algokit_utils.AppClient):
264
+ self.app_client = app_client
265
+
266
+ def blk_timestamp(
267
+ self,
268
+ args: tuple[int, int] | BlkTimestampArgs,
269
+ params: algokit_utils.CommonAppCallParams | None = None
270
+ ) -> algokit_utils.BuiltTransactions:
271
+ method_args = _parse_abi_args(args)
272
+ params = params or algokit_utils.CommonAppCallParams()
273
+ return self.app_client.create_transaction.call(algokit_utils.AppClientMethodCallParams(**{
274
+ **dataclasses.asdict(params),
275
+ "method": "blkTimestamp(uint64,uint64)uint64",
276
+ "args": method_args,
277
+ }))
278
+
279
+ def blk_txn_counter(
280
+ self,
281
+ args: tuple[int, int] | BlkTxnCounterArgs,
282
+ params: algokit_utils.CommonAppCallParams | None = None
283
+ ) -> algokit_utils.BuiltTransactions:
284
+ method_args = _parse_abi_args(args)
285
+ params = params or algokit_utils.CommonAppCallParams()
286
+ return self.app_client.create_transaction.call(algokit_utils.AppClientMethodCallParams(**{
287
+ **dataclasses.asdict(params),
288
+ "method": "blkTxnCounter(uint64,uint64)uint64",
289
+ "args": method_args,
290
+ }))
291
+
292
+ def blk_proposer(
293
+ self,
294
+ args: tuple[int, int] | BlkProposerArgs,
295
+ params: algokit_utils.CommonAppCallParams | None = None
296
+ ) -> algokit_utils.BuiltTransactions:
297
+ method_args = _parse_abi_args(args)
298
+ params = params or algokit_utils.CommonAppCallParams()
299
+ return self.app_client.create_transaction.call(algokit_utils.AppClientMethodCallParams(**{
300
+ **dataclasses.asdict(params),
301
+ "method": "blkProposer(uint64,uint64)address",
302
+ "args": method_args,
303
+ }))
304
+
305
+ def blk_data(
306
+ self,
307
+ args: tuple[int, int] | BlkDataArgs,
308
+ params: algokit_utils.CommonAppCallParams | None = None
309
+ ) -> algokit_utils.BuiltTransactions:
310
+ method_args = _parse_abi_args(args)
311
+ params = params or algokit_utils.CommonAppCallParams()
312
+ return self.app_client.create_transaction.call(algokit_utils.AppClientMethodCallParams(**{
313
+ **dataclasses.asdict(params),
314
+ "method": "blkData(uint64,uint64)(uint64,uint64,uint64,address)",
315
+ "args": method_args,
316
+ }))
317
+
318
+ def acct_balance_data(
319
+ self,
320
+ args: tuple[list[str]] | AcctBalanceDataArgs,
321
+ params: algokit_utils.CommonAppCallParams | None = None
322
+ ) -> algokit_utils.BuiltTransactions:
323
+ method_args = _parse_abi_args(args)
324
+ params = params or algokit_utils.CommonAppCallParams()
325
+ return self.app_client.create_transaction.call(algokit_utils.AppClientMethodCallParams(**{
326
+ **dataclasses.asdict(params),
327
+ "method": "acctBalanceData(address[])(address,uint64,uint64)",
328
+ "args": method_args,
329
+ }))
330
+
331
+ def clear_state(
332
+ self,
333
+ params: algokit_utils.AppClientBareCallParams | None = None,
334
+
335
+ ) -> Transaction:
336
+ return self.app_client.create_transaction.bare.clear_state(
337
+ params,
338
+
339
+ )
340
+
341
+
342
+ class GhostofavmSend:
343
+ def __init__(self, app_client: algokit_utils.AppClient):
344
+ self.app_client = app_client
345
+
346
+ def blk_timestamp(
347
+ self,
348
+ args: tuple[int, int] | BlkTimestampArgs,
349
+ params: algokit_utils.CommonAppCallParams | None = None,
350
+ send_params: algokit_utils.SendParams | None = None
351
+ ) -> algokit_utils.SendAppTransactionResult[int]:
352
+ method_args = _parse_abi_args(args)
353
+ params = params or algokit_utils.CommonAppCallParams()
354
+ response = self.app_client.send.call(algokit_utils.AppClientMethodCallParams(**{
355
+ **dataclasses.asdict(params),
356
+ "method": "blkTimestamp(uint64,uint64)uint64",
357
+ "args": method_args,
358
+ }), send_params=send_params)
359
+ parsed_response = response
360
+ return typing.cast(algokit_utils.SendAppTransactionResult[int], parsed_response)
361
+
362
+ def blk_txn_counter(
363
+ self,
364
+ args: tuple[int, int] | BlkTxnCounterArgs,
365
+ params: algokit_utils.CommonAppCallParams | None = None,
366
+ send_params: algokit_utils.SendParams | None = None
367
+ ) -> algokit_utils.SendAppTransactionResult[int]:
368
+ method_args = _parse_abi_args(args)
369
+ params = params or algokit_utils.CommonAppCallParams()
370
+ response = self.app_client.send.call(algokit_utils.AppClientMethodCallParams(**{
371
+ **dataclasses.asdict(params),
372
+ "method": "blkTxnCounter(uint64,uint64)uint64",
373
+ "args": method_args,
374
+ }), send_params=send_params)
375
+ parsed_response = response
376
+ return typing.cast(algokit_utils.SendAppTransactionResult[int], parsed_response)
377
+
378
+ def blk_proposer(
379
+ self,
380
+ args: tuple[int, int] | BlkProposerArgs,
381
+ params: algokit_utils.CommonAppCallParams | None = None,
382
+ send_params: algokit_utils.SendParams | None = None
383
+ ) -> algokit_utils.SendAppTransactionResult[str]:
384
+ method_args = _parse_abi_args(args)
385
+ params = params or algokit_utils.CommonAppCallParams()
386
+ response = self.app_client.send.call(algokit_utils.AppClientMethodCallParams(**{
387
+ **dataclasses.asdict(params),
388
+ "method": "blkProposer(uint64,uint64)address",
389
+ "args": method_args,
390
+ }), send_params=send_params)
391
+ parsed_response = response
392
+ return typing.cast(algokit_utils.SendAppTransactionResult[str], parsed_response)
393
+
394
+ def blk_data(
395
+ self,
396
+ args: tuple[int, int] | BlkDataArgs,
397
+ params: algokit_utils.CommonAppCallParams | None = None,
398
+ send_params: algokit_utils.SendParams | None = None
399
+ ) -> algokit_utils.SendAppTransactionResult[BlkData]:
400
+ method_args = _parse_abi_args(args)
401
+ params = params or algokit_utils.CommonAppCallParams()
402
+ response = self.app_client.send.call(algokit_utils.AppClientMethodCallParams(**{
403
+ **dataclasses.asdict(params),
404
+ "method": "blkData(uint64,uint64)(uint64,uint64,uint64,address)",
405
+ "args": method_args,
406
+ }), send_params=send_params)
407
+ parsed_response = dataclasses.replace(response, abi_return=_init_dataclass(BlkData, typing.cast(dict, response.abi_return))) # type: ignore
408
+ return typing.cast(algokit_utils.SendAppTransactionResult[BlkData], parsed_response)
409
+
410
+ def acct_balance_data(
411
+ self,
412
+ args: tuple[list[str]] | AcctBalanceDataArgs,
413
+ params: algokit_utils.CommonAppCallParams | None = None,
414
+ send_params: algokit_utils.SendParams | None = None
415
+ ) -> algokit_utils.SendAppTransactionResult[AcctBalanceData]:
416
+ method_args = _parse_abi_args(args)
417
+ params = params or algokit_utils.CommonAppCallParams()
418
+ response = self.app_client.send.call(algokit_utils.AppClientMethodCallParams(**{
419
+ **dataclasses.asdict(params),
420
+ "method": "acctBalanceData(address[])(address,uint64,uint64)",
421
+ "args": method_args,
422
+ }), send_params=send_params)
423
+ parsed_response = dataclasses.replace(response, abi_return=_init_dataclass(AcctBalanceData, typing.cast(dict, response.abi_return))) # type: ignore
424
+ return typing.cast(algokit_utils.SendAppTransactionResult[AcctBalanceData], parsed_response)
425
+
426
+ def clear_state(
427
+ self,
428
+ params: algokit_utils.AppClientBareCallParams | None = None,
429
+ send_params: algokit_utils.SendParams | None = None
430
+ ) -> algokit_utils.SendAppTransactionResult[algokit_utils.ABIReturn]:
431
+ return self.app_client.send.bare.clear_state(
432
+ params,
433
+ send_params=send_params,
434
+ )
435
+
436
+
437
+ class GhostofavmState:
438
+ """Methods to access state for the current Ghostofavm app"""
439
+
440
+ def __init__(self, app_client: algokit_utils.AppClient):
441
+ self.app_client = app_client
442
+
443
+ class GhostofavmClient:
444
+ """Client for interacting with Ghostofavm smart contract"""
445
+
446
+ @typing.overload
447
+ def __init__(self, app_client: algokit_utils.AppClient) -> None: ...
448
+
449
+ @typing.overload
450
+ def __init__(
451
+ self,
452
+ *,
453
+ algorand: _AlgoKitAlgorandClient,
454
+ app_id: int,
455
+ app_name: str | None = None,
456
+ default_sender: str | None = None,
457
+ default_signer: TransactionSigner | None = None,
458
+ approval_source_map: SourceMap | None = None,
459
+ clear_source_map: SourceMap | None = None,
460
+ ) -> None: ...
461
+
462
+ def __init__(
463
+ self,
464
+ app_client: algokit_utils.AppClient | None = None,
465
+ *,
466
+ algorand: _AlgoKitAlgorandClient | None = None,
467
+ app_id: int | None = None,
468
+ app_name: str | None = None,
469
+ default_sender: str | None = None,
470
+ default_signer: TransactionSigner | None = None,
471
+ approval_source_map: SourceMap | None = None,
472
+ clear_source_map: SourceMap | None = None,
473
+ ) -> None:
474
+ if app_client:
475
+ self.app_client = app_client
476
+ elif algorand and app_id:
477
+ self.app_client = algokit_utils.AppClient(
478
+ algokit_utils.AppClientParams(
479
+ algorand=algorand,
480
+ app_spec=APP_SPEC,
481
+ app_id=app_id,
482
+ app_name=app_name,
483
+ default_sender=default_sender,
484
+ default_signer=default_signer,
485
+ approval_source_map=approval_source_map,
486
+ clear_source_map=clear_source_map,
487
+ )
488
+ )
489
+ else:
490
+ raise ValueError("Either app_client or algorand and app_id must be provided")
491
+
492
+ self.params = GhostofavmParams(self.app_client)
493
+ self.create_transaction = GhostofavmCreateTransactionParams(self.app_client)
494
+ self.send = GhostofavmSend(self.app_client)
495
+ self.state = GhostofavmState(self.app_client)
496
+
497
+ @staticmethod
498
+ def from_creator_and_name(
499
+ creator_address: str,
500
+ app_name: str,
501
+ algorand: _AlgoKitAlgorandClient,
502
+ default_sender: str | None = None,
503
+ default_signer: TransactionSigner | None = None,
504
+ approval_source_map: SourceMap | None = None,
505
+ clear_source_map: SourceMap | None = None,
506
+ ignore_cache: bool | None = None,
507
+ app_lookup_cache: algokit_utils.ApplicationLookup | None = None,
508
+ ) -> "GhostofavmClient":
509
+ return GhostofavmClient(
510
+ algokit_utils.AppClient.from_creator_and_name(
511
+ creator_address=creator_address,
512
+ app_name=app_name,
513
+ app_spec=APP_SPEC,
514
+ algorand=algorand,
515
+ default_sender=default_sender,
516
+ default_signer=default_signer,
517
+ approval_source_map=approval_source_map,
518
+ clear_source_map=clear_source_map,
519
+ ignore_cache=ignore_cache,
520
+ app_lookup_cache=app_lookup_cache,
521
+ )
522
+ )
523
+
524
+ @staticmethod
525
+ def from_network(
526
+ algorand: _AlgoKitAlgorandClient,
527
+ app_name: str | None = None,
528
+ default_sender: str | None = None,
529
+ default_signer: TransactionSigner | None = None,
530
+ approval_source_map: SourceMap | None = None,
531
+ clear_source_map: SourceMap | None = None,
532
+ ) -> "GhostofavmClient":
533
+ return GhostofavmClient(
534
+ algokit_utils.AppClient.from_network(
535
+ app_spec=APP_SPEC,
536
+ algorand=algorand,
537
+ app_name=app_name,
538
+ default_sender=default_sender,
539
+ default_signer=default_signer,
540
+ approval_source_map=approval_source_map,
541
+ clear_source_map=clear_source_map,
542
+ )
543
+ )
544
+
545
+ @property
546
+ def app_id(self) -> int:
547
+ return self.app_client.app_id
548
+
549
+ @property
550
+ def app_address(self) -> str:
551
+ return self.app_client.app_address
552
+
553
+ @property
554
+ def app_name(self) -> str:
555
+ return self.app_client.app_name
556
+
557
+ @property
558
+ def app_spec(self) -> algokit_utils.Arc56Contract:
559
+ return self.app_client.app_spec
560
+
561
+ @property
562
+ def algorand(self) -> _AlgoKitAlgorandClient:
563
+ return self.app_client.algorand
564
+
565
+ def clone(
566
+ self,
567
+ app_name: str | None = None,
568
+ default_sender: str | None = None,
569
+ default_signer: TransactionSigner | None = None,
570
+ approval_source_map: SourceMap | None = None,
571
+ clear_source_map: SourceMap | None = None,
572
+ ) -> "GhostofavmClient":
573
+ return GhostofavmClient(
574
+ self.app_client.clone(
575
+ app_name=app_name,
576
+ default_sender=default_sender,
577
+ default_signer=default_signer,
578
+ approval_source_map=approval_source_map,
579
+ clear_source_map=clear_source_map,
580
+ )
581
+ )
582
+
583
+ def new_group(self) -> "GhostofavmComposer":
584
+ return GhostofavmComposer(self)
585
+
586
+ @typing.overload
587
+ def decode_return_value(
588
+ self,
589
+ method: typing.Literal["blkTimestamp(uint64,uint64)uint64"],
590
+ return_value: algokit_utils.ABIReturn | None
591
+ ) -> int | None: ...
592
+ @typing.overload
593
+ def decode_return_value(
594
+ self,
595
+ method: typing.Literal["blkTxnCounter(uint64,uint64)uint64"],
596
+ return_value: algokit_utils.ABIReturn | None
597
+ ) -> int | None: ...
598
+ @typing.overload
599
+ def decode_return_value(
600
+ self,
601
+ method: typing.Literal["blkProposer(uint64,uint64)address"],
602
+ return_value: algokit_utils.ABIReturn | None
603
+ ) -> str | None: ...
604
+ @typing.overload
605
+ def decode_return_value(
606
+ self,
607
+ method: typing.Literal["blkData(uint64,uint64)(uint64,uint64,uint64,address)"],
608
+ return_value: algokit_utils.ABIReturn | None
609
+ ) -> BlkData | None: ...
610
+ @typing.overload
611
+ def decode_return_value(
612
+ self,
613
+ method: typing.Literal["acctBalanceData(address[])(address,uint64,uint64)"],
614
+ return_value: algokit_utils.ABIReturn | None
615
+ ) -> AcctBalanceData | None: ...
616
+ @typing.overload
617
+ def decode_return_value(
618
+ self,
619
+ method: typing.Literal["blkTimestamp(uint64,uint64)uint64"],
620
+ return_value: algokit_utils.ABIReturn | None
621
+ ) -> int | None: ...
622
+ @typing.overload
623
+ def decode_return_value(
624
+ self,
625
+ method: typing.Literal["blkTxnCounter(uint64,uint64)uint64"],
626
+ return_value: algokit_utils.ABIReturn | None
627
+ ) -> int | None: ...
628
+ @typing.overload
629
+ def decode_return_value(
630
+ self,
631
+ method: typing.Literal["blkProposer(uint64,uint64)address"],
632
+ return_value: algokit_utils.ABIReturn | None
633
+ ) -> str | None: ...
634
+ @typing.overload
635
+ def decode_return_value(
636
+ self,
637
+ method: typing.Literal["blkData(uint64,uint64)(uint64,uint64,uint64,address)"],
638
+ return_value: algokit_utils.ABIReturn | None
639
+ ) -> BlkData | None: ...
640
+ @typing.overload
641
+ def decode_return_value(
642
+ self,
643
+ method: typing.Literal["acctBalanceData(address[])(address,uint64,uint64)"],
644
+ return_value: algokit_utils.ABIReturn | None
645
+ ) -> AcctBalanceData | None: ...
646
+ @typing.overload
647
+ def decode_return_value(
648
+ self,
649
+ method: str,
650
+ return_value: algokit_utils.ABIReturn | None
651
+ ) -> algokit_utils.ABIValue | algokit_utils.ABIStruct | None: ...
652
+
653
+ def decode_return_value(
654
+ self,
655
+ method: str,
656
+ return_value: algokit_utils.ABIReturn | None
657
+ ) -> algokit_utils.ABIValue | algokit_utils.ABIStruct | None | AcctBalanceData | BlkData | int | str:
658
+ """Decode ABI return value for the given method."""
659
+ if return_value is None:
660
+ return None
661
+
662
+ arc56_method = self.app_spec.get_arc56_method(method)
663
+ decoded = return_value.get_arc56_value(arc56_method, self.app_spec.structs)
664
+
665
+ # If method returns a struct, convert the dict to appropriate dataclass
666
+ if (arc56_method and
667
+ arc56_method.returns and
668
+ arc56_method.returns.struct and
669
+ isinstance(decoded, dict)):
670
+ struct_class = globals().get(arc56_method.returns.struct)
671
+ if struct_class:
672
+ return struct_class(**typing.cast(dict, decoded))
673
+ return decoded
674
+
675
+
676
+ class GhostofavmComposer:
677
+ """Composer for creating transaction groups for Ghostofavm contract calls"""
678
+
679
+ def __init__(self, client: "GhostofavmClient"):
680
+ self.client = client
681
+ self._composer = client.algorand.new_group()
682
+ self._result_mappers: list[typing.Callable[[algokit_utils.ABIReturn | None], object] | None] = []
683
+
684
+ def blk_timestamp(
685
+ self,
686
+ args: tuple[int, int] | BlkTimestampArgs,
687
+ params: algokit_utils.CommonAppCallParams | None = None
688
+ ) -> "GhostofavmComposer":
689
+ self._composer.add_app_call_method_call(
690
+ self.client.params.blk_timestamp(
691
+ args=args,
692
+ params=params,
693
+ )
694
+ )
695
+ self._result_mappers.append(
696
+ lambda v: self.client.decode_return_value(
697
+ "blkTimestamp(uint64,uint64)uint64", v
698
+ )
699
+ )
700
+ return self
701
+
702
+ def blk_txn_counter(
703
+ self,
704
+ args: tuple[int, int] | BlkTxnCounterArgs,
705
+ params: algokit_utils.CommonAppCallParams | None = None
706
+ ) -> "GhostofavmComposer":
707
+ self._composer.add_app_call_method_call(
708
+ self.client.params.blk_txn_counter(
709
+ args=args,
710
+ params=params,
711
+ )
712
+ )
713
+ self._result_mappers.append(
714
+ lambda v: self.client.decode_return_value(
715
+ "blkTxnCounter(uint64,uint64)uint64", v
716
+ )
717
+ )
718
+ return self
719
+
720
+ def blk_proposer(
721
+ self,
722
+ args: tuple[int, int] | BlkProposerArgs,
723
+ params: algokit_utils.CommonAppCallParams | None = None
724
+ ) -> "GhostofavmComposer":
725
+ self._composer.add_app_call_method_call(
726
+ self.client.params.blk_proposer(
727
+ args=args,
728
+ params=params,
729
+ )
730
+ )
731
+ self._result_mappers.append(
732
+ lambda v: self.client.decode_return_value(
733
+ "blkProposer(uint64,uint64)address", v
734
+ )
735
+ )
736
+ return self
737
+
738
+ def blk_data(
739
+ self,
740
+ args: tuple[int, int] | BlkDataArgs,
741
+ params: algokit_utils.CommonAppCallParams | None = None
742
+ ) -> "GhostofavmComposer":
743
+ self._composer.add_app_call_method_call(
744
+ self.client.params.blk_data(
745
+ args=args,
746
+ params=params,
747
+ )
748
+ )
749
+ self._result_mappers.append(
750
+ lambda v: self.client.decode_return_value(
751
+ "blkData(uint64,uint64)(uint64,uint64,uint64,address)", v
752
+ )
753
+ )
754
+ return self
755
+
756
+ def acct_balance_data(
757
+ self,
758
+ args: tuple[list[str]] | AcctBalanceDataArgs,
759
+ params: algokit_utils.CommonAppCallParams | None = None
760
+ ) -> "GhostofavmComposer":
761
+ self._composer.add_app_call_method_call(
762
+ self.client.params.acct_balance_data(
763
+ args=args,
764
+ params=params,
765
+ )
766
+ )
767
+ self._result_mappers.append(
768
+ lambda v: self.client.decode_return_value(
769
+ "acctBalanceData(address[])(address,uint64,uint64)", v
770
+ )
771
+ )
772
+ return self
773
+
774
+ def clear_state(
775
+ self,
776
+ *,
777
+ args: list[bytes] | None = None,
778
+ params: algokit_utils.CommonAppCallParams | None = None,
779
+ ) -> "GhostofavmComposer":
780
+ params=params or algokit_utils.CommonAppCallParams()
781
+ self._composer.add_app_call(
782
+ self.client.params.clear_state(
783
+ algokit_utils.AppClientBareCallParams(
784
+ **{
785
+ **dataclasses.asdict(params),
786
+ "args": args
787
+ }
788
+ )
789
+ )
790
+ )
791
+ return self
792
+
793
+ def add_transaction(
794
+ self, txn: Transaction, signer: TransactionSigner | None = None
795
+ ) -> "GhostofavmComposer":
796
+ self._composer.add_transaction(txn, signer)
797
+ return self
798
+
799
+ def composer(self) -> algokit_utils.TransactionComposer:
800
+ return self._composer
801
+
802
+ def simulate(
803
+ self,
804
+ allow_more_logs: bool | None = None,
805
+ allow_empty_signatures: bool | None = None,
806
+ allow_unnamed_resources: bool | None = None,
807
+ extra_opcode_budget: int | None = None,
808
+ exec_trace_config: SimulateTraceConfig | None = None,
809
+ simulation_round: int | None = None,
810
+ skip_signatures: bool | None = None,
811
+ ) -> algokit_utils.SendAtomicTransactionComposerResults:
812
+ return self._composer.simulate(
813
+ allow_more_logs=allow_more_logs,
814
+ allow_empty_signatures=allow_empty_signatures,
815
+ allow_unnamed_resources=allow_unnamed_resources,
816
+ extra_opcode_budget=extra_opcode_budget,
817
+ exec_trace_config=exec_trace_config,
818
+ simulation_round=simulation_round,
819
+ skip_signatures=skip_signatures,
820
+ )
821
+
822
+ def send(
823
+ self,
824
+ send_params: algokit_utils.SendParams | None = None
825
+ ) -> algokit_utils.SendAtomicTransactionComposerResults:
826
+ return self._composer.send(send_params)
@@ -0,0 +1 @@
1
+ from . import Ghostofavm_a552bf7f as Ghostofavm_a552bf7f
@@ -0,0 +1,17 @@
1
+ {
2
+ "contracts": {
3
+ "https://raw.githubusercontent.com/d13co/ghostkit/HEAD/examples/Ghostofavm.arc56.json": {
4
+ "class_name": "GhostofavmClient",
5
+ "content_sha256": "fdc1fa3706ad6b6f206540ba865238f330f1a529e23b7c90f59cbeddda20de97",
6
+ "file_slug": "Ghostofavm",
7
+ "generated_at": "2026-07-18T15:58:20.918435+00:00",
8
+ "hash8": "a552bf7f",
9
+ "py_sha256": "a91185d3a75b98a19c94c5e4e5b7c93a34739e3e45f2f6f1674b562db59f92f2"
10
+ }
11
+ },
12
+ "dist_name": "arc56-generated-d13co-ghostkit",
13
+ "generator_version": "2.2.0",
14
+ "increment": 2,
15
+ "template_hash": "e7cb5fa2fecdfde3f4cdfff941ff9299032493e9bd016b9cfc7c4a6c889246d5",
16
+ "version": "1.2.2026072010"
17
+ }