algokit-utils 4.0.0b2__py3-none-any.whl → 4.0.1b2__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.

Potentially problematic release.


This version of algokit-utils might be problematic. Click here for more details.

@@ -261,6 +261,8 @@ class AppManager:
261
261
  def get_box_names(self, app_id: int) -> list[BoxName]:
262
262
  """Get names of all boxes for an application.
263
263
 
264
+ If the box name can't be decoded from UTF-8, the string representation of the bytes is returned.
265
+
264
266
  :param app_id: The application ID
265
267
  :return: List of box names
266
268
 
@@ -270,13 +272,20 @@ class AppManager:
270
272
  >>> box_names = app_manager.get_box_names(app_id)
271
273
  """
272
274
 
275
+ def utf8_decode_or_string_cast(b: bytes) -> str:
276
+ """Return the UTF-8 encoding or return the string representation of the bytes."""
277
+ try:
278
+ return b.decode("utf-8")
279
+ except UnicodeDecodeError:
280
+ return str(b)
281
+
273
282
  box_result = self._algod.application_boxes(app_id)
274
283
  assert isinstance(box_result, dict)
275
284
  return [
276
285
  BoxName(
277
286
  name_raw=base64.b64decode(b["name"]),
278
287
  name_base64=b["name"],
279
- name=base64.b64decode(b["name"]).decode("utf-8"),
288
+ name=utf8_decode_or_string_cast(base64.b64decode(b["name"])),
280
289
  )
281
290
  for b in box_result["boxes"]
282
291
  ]
@@ -22,7 +22,8 @@ class BoxName:
22
22
  """The name of the box"""
23
23
 
24
24
  name: str
25
- """The name of the box as a string"""
25
+ """The name of the box as a string.
26
+ If the name can't be decoded from UTF-8, the string representation of the bytes is returned instead."""
26
27
  name_raw: bytes
27
28
  """The name of the box as raw bytes"""
28
29
  name_base64: str
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: algokit-utils
3
- Version: 4.0.0b2
3
+ Version: 4.0.1b2
4
4
  Summary: Utilities for Algorand development for use by AlgoKit
5
5
  License: MIT
6
6
  Author: Algorand Foundation
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3.10
12
12
  Classifier: Programming Language :: Python :: 3.11
13
13
  Classifier: Programming Language :: Python :: 3.12
14
14
  Classifier: Programming Language :: Python :: 3.13
15
- Requires-Dist: httpx (>=0.23.1,<0.24.0)
15
+ Requires-Dist: httpx (>=0.23.1,<=0.28.1)
16
16
  Requires-Dist: py-algorand-sdk (>=2.4.0,<3.0.0)
17
17
  Requires-Dist: typing-extensions (>=4.6.0)
18
18
  Description-Content-Type: text/markdown
@@ -24,7 +24,7 @@ algokit_utils/applications/abi.py,sha256=OjTdn4szJPPeC8XmosdDYtkIIVgQSWAnqz2DHw5
24
24
  algokit_utils/applications/app_client.py,sha256=wM3tH0-oW6uQG_W0RLiL3iULnvAPpNM-O9BiPw5wfiU,88470
25
25
  algokit_utils/applications/app_deployer.py,sha256=kAypS20VM-yAwosCcYdMwTmXntGOt_6EN_i5nIYN5rw,30627
26
26
  algokit_utils/applications/app_factory.py,sha256=PPJnR-fs1hNkEMlIqwY7jx63hPnOkdyiIK6l4-A3d10,45383
27
- algokit_utils/applications/app_manager.py,sha256=wDrJW-YtArRldNk5Nh9Mf-DwEz9XTjKD1Q0z4O_WPTY,21904
27
+ algokit_utils/applications/app_manager.py,sha256=8bboIswlwBQhPIqilSBMaxd83yHjIpkloezmtgcAdZY,22301
28
28
  algokit_utils/applications/app_spec/__init__.py,sha256=HtjAhAqHNFml9WbRKGmhJnwyJeW8AztPRO_BriQ84vs,140
29
29
  algokit_utils/applications/app_spec/arc32.py,sha256=8MMGUopPzkWq48rl5sYbc2Awf-RKnxSX8F0P0UibK5M,7523
30
30
  algokit_utils/applications/app_spec/arc56.py,sha256=v6OnNnOzVpjS61TyFNwqym2tBEXHXXj6NZhounZmXjQ,32330
@@ -53,7 +53,7 @@ algokit_utils/models/amount.py,sha256=PcjzqRY5ThcUuSYHk1yeYgUooos1j2-54hBIJJcipd
53
53
  algokit_utils/models/application.py,sha256=YhSrDGJ3iZRzxcYvazD40WKwID-1WQQZHtwwkGfExNw,2377
54
54
  algokit_utils/models/network.py,sha256=3QNcZ9jVmckv3CCxrD2Y1jiwBdBGdaaziiRgOpsqhwI,904
55
55
  algokit_utils/models/simulate.py,sha256=F9OSEfA9QGFGe5po24h8IGLor5z1ogu5Cwm3l6cHnAs,236
56
- algokit_utils/models/state.py,sha256=P-F_TsahWraa8pwtnd02_DNBvuWWE0CRe_YG0S67MjI,1757
56
+ algokit_utils/models/state.py,sha256=UEpxLcsN0TJREVoKnJ1w-oHSuVNb78aKSC1oRNai4v4,1863
57
57
  algokit_utils/models/transaction.py,sha256=2JJLDbbbKEWaXkfx3rtcSjsQNVH6f8kyhY1iFBVW-Uc,3019
58
58
  algokit_utils/network_clients.py,sha256=Nd096NpRM7z9iLLdLSC9HV9jl_8Y7sT9ft54mqfyxLA,251
59
59
  algokit_utils/protocols/__init__.py,sha256=yD7ZxPEiERQ5ecJuz7BSM9uz1_GhamIaQWCnuVikgro,126
@@ -64,7 +64,7 @@ algokit_utils/transactions/__init__.py,sha256=7fYF3m6DyOGzbV36MT5svo0wSkj9AIz496
64
64
  algokit_utils/transactions/transaction_composer.py,sha256=66_vY6DNs4gDhLRAamtzzo7oeLM8nxS9QKwZY_tidYc,104138
65
65
  algokit_utils/transactions/transaction_creator.py,sha256=cuP6Xm-fhGoCc2FNSbLiEg3iQRwW38rfdTzsqPyEcpM,29053
66
66
  algokit_utils/transactions/transaction_sender.py,sha256=foK_2S-gUl9D7xkWG3lD526qIKz5mVibHNKVREQCgoA,50079
67
- algokit_utils-4.0.0b2.dist-info/LICENSE,sha256=J5i7U1Q9Q2c7saUzlvFRmrCCFhQyXb5Juz_LO5omNUw,1076
68
- algokit_utils-4.0.0b2.dist-info/METADATA,sha256=0JC6n4CK90AF8wc8ZPjV5XyOqnsYn0HOlqpyrj810MI,2420
69
- algokit_utils-4.0.0b2.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
70
- algokit_utils-4.0.0b2.dist-info/RECORD,,
67
+ algokit_utils-4.0.1b2.dist-info/LICENSE,sha256=J5i7U1Q9Q2c7saUzlvFRmrCCFhQyXb5Juz_LO5omNUw,1076
68
+ algokit_utils-4.0.1b2.dist-info/METADATA,sha256=Waqh-lGepYmdW6XOazX53yPXxQvm7OyyYUix52JkW2c,2421
69
+ algokit_utils-4.0.1b2.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
70
+ algokit_utils-4.0.1b2.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.1
2
+ Generator: poetry-core 2.1.2
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any