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

@@ -124,7 +124,7 @@ def ensure_funded(
124
124
  Funds a given account using a funding source to ensure it has sufficient spendable ALGOs.
125
125
 
126
126
  Ensures the target account has enough ALGOs free to spend after accounting for ALGOs locked in minimum balance
127
- requirements. See https://developer.algorand.org/docs/get-details/accounts/#minimum-balance for details on minimum
127
+ requirements. See https://dev.algorand.co/concepts/smart-contracts/costs-constraints#mbr for details on minimum
128
128
  balance requirements.
129
129
 
130
130
  :param client: An instance of the AlgodClient class from the AlgoSDK library
@@ -73,7 +73,7 @@ def opt_in(algod_client: "AlgodClient", account: Account, asset_ids: list[int])
73
73
  """
74
74
  Opt-in to a list of assets on the Algorand blockchain. Before an account can receive a specific asset,
75
75
  it must `opt-in` to receive it. An opt-in transaction places an asset holding of 0 into the account and increases
76
- its minimum balance by [100,000 microAlgos](https://developer.algorand.org/docs/get-details/asa/#assets-overview).
76
+ its minimum balance by [100,000 microAlgos](https://dev.algorand.co/concepts/assets/overview).
77
77
 
78
78
  :param algod_client: An instance of the AlgodClient class from the algosdk library.
79
79
  :param account: An instance of the Account class representing the account that wants to opt-in to the assets.
@@ -71,7 +71,7 @@ class AccountInformation:
71
71
  """
72
72
  Information about an Algorand account's current status, balance and other properties.
73
73
 
74
- See `https://developer.algorand.org/docs/rest-apis/algod/#account` for detailed field descriptions.
74
+ See `https://dev.algorand.co/reference/rest-apis/algod/#account` for detailed field descriptions.
75
75
  """
76
76
 
77
77
  address: str
@@ -347,7 +347,7 @@ class AccountManager:
347
347
  """
348
348
  Returns the given sender account's current status, balance and spendable amounts.
349
349
 
350
- See `<https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddress>`_
350
+ See `<https://dev.algorand.co/reference/rest-apis/algod/#account>`_
351
351
  for response data schema details.
352
352
 
353
353
  :param sender: The address or account compliant with `TransactionSignerAccountProtocol` protocol to look up
@@ -612,7 +612,7 @@ class AccountManager:
612
612
 
613
613
  .. warning::
614
614
  Please be careful with this function and be sure to read the
615
- `official rekey guidance <https://developer.algorand.org/docs/get-details/accounts/rekey/>`_.
615
+ `official rekey guidance <https://dev.algorand.co/concepts/accounts/rekeying>`_.
616
616
 
617
617
  :example:
618
618
  >>> # Basic example (with string addresses):
@@ -693,7 +693,7 @@ class AccountManager:
693
693
  Ensures the given account has a certain amount of Algo free to spend (accounting for
694
694
  Algo locked in minimum balance requirement).
695
695
 
696
- See `<https://developer.algorand.org/docs/get-details/accounts/#minimum-balance>`_ for details.
696
+ See `<https://dev.algorand.co/concepts/smart-contracts/costs-constraints#mbr>`_ for details.
697
697
 
698
698
  :param account_to_fund: The account to fund
699
699
  :param dispenser_account: The account to use as a dispenser funding source
@@ -795,7 +795,7 @@ class AccountManager:
795
795
  as a funding source such that the given account has a certain amount of Algo free to spend
796
796
  (accounting for Algo locked in minimum balance requirement).
797
797
 
798
- See `<https://developer.algorand.org/docs/get-details/accounts/#minimum-balance>`_ for details.
798
+ See `<https://dev.algorand.co/concepts/smart-contracts/costs-constraints#mbr>`_ for details.
799
799
 
800
800
  :param account_to_fund: The account to fund
801
801
  :param min_spending_balance: The minimum balance of Algo that the account should have available to
@@ -888,7 +888,7 @@ class AccountManager:
888
888
  Uses the TestNet Dispenser API as a funding source such that the account has a certain amount
889
889
  of Algo free to spend (accounting for Algo locked in minimum balance requirement).
890
890
 
891
- See `<https://developer.algorand.org/docs/get-details/accounts/#minimum-balance>`_ for details.
891
+ See `<https://dev.algorand.co/concepts/smart-contracts/costs-constraints#mbr>`_ for details.
892
892
 
893
893
  :param account_to_fund: The account to fund
894
894
  :param dispenser_client: The TestNet dispenser funding client
@@ -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.0b1
3
+ Version: 4.0.1
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
@@ -1,12 +1,12 @@
1
1
  algokit_utils/__init__.py,sha256=he0sKUGvOgN2ROlXJ_6GOBqElfoDy3c5_XgVA3BYACU,1039
2
2
  algokit_utils/_debugging.py,sha256=nAiC10WXiZsvc0RPWOrMLpjJQZT_ItgcMl7D9Z4DfYc,11703
3
3
  algokit_utils/_legacy_v2/__init__.py,sha256=WcRE30axWjGnBB09bJCeTw9NT-2_jDN_CVJITFcIDc8,4689
4
- algokit_utils/_legacy_v2/_ensure_funded.py,sha256=_k3hc_xL-_KOEmvF3mofk-Z2D1n8dSo9Rz8OLqPnoNg,6912
4
+ algokit_utils/_legacy_v2/_ensure_funded.py,sha256=k52b56CfWttPiu2gy09HIEiXl0eIz5WKQy-iuhxpSQg,6909
5
5
  algokit_utils/_legacy_v2/_transfer.py,sha256=nMHm3jXKJLLjOLqjMK_B3bFsslDCx45EPJ5yt7Ex-8k,6464
6
6
  algokit_utils/_legacy_v2/account.py,sha256=mv5GjHlIPKNr3dx1FI1aAYFiJqeVpCbf0mTUXeYu0UU,8314
7
7
  algokit_utils/_legacy_v2/application_client.py,sha256=Gb7WldXLi0V92YfeU19HP1rJ-L4Rmz2Lxm2q45tQJ2s,59610
8
8
  algokit_utils/_legacy_v2/application_specification.py,sha256=wp2Y9ou2_F-bSFbDnm6AEhFexybmD7-fAT0CuWtO26g,521
9
- algokit_utils/_legacy_v2/asset.py,sha256=b4GEzsPuHAbb330ZjoyY3lol0SisQGwJiOpnXvuXvJI,7594
9
+ algokit_utils/_legacy_v2/asset.py,sha256=vuSmqwEp2W6bpLB34_fUkzZ8VnLDXC__d-rqI4bmkDM,7574
10
10
  algokit_utils/_legacy_v2/common.py,sha256=lB6zHUDJSjYiZ41hvcG0P5TZk_t-n2Iy0OXuQcJosm0,823
11
11
  algokit_utils/_legacy_v2/deploy.py,sha256=uoRaUTIYzLZdUucW3DOIbD3qwa9CvLgo1GSJ1Ibfmsw,32778
12
12
  algokit_utils/_legacy_v2/logic_error.py,sha256=pmaMTuvbOD7PHukSY4epzJRptSivc4O0vFZdW_zzZ38,345
@@ -14,7 +14,7 @@ algokit_utils/_legacy_v2/models.py,sha256=hH7aO50E4po4EgxXI9zdX5HTthn1HLfSLvkuPf
14
14
  algokit_utils/_legacy_v2/network_clients.py,sha256=z_zm1da9CVBG2TOAnXeYkHBh6a8HtXsSdNrlEizc8J0,5928
15
15
  algokit_utils/account.py,sha256=gyGrBSoafUh8WV677IzYGkYoxtzzElsgxGMp4SgA4pk,410
16
16
  algokit_utils/accounts/__init__.py,sha256=_LyY0se6TaQOes7vAcmbpt6pmG4VKlzfTt37-IjwimA,138
17
- algokit_utils/accounts/account_manager.py,sha256=l0rvCbkvOfALAXZlaookZkhqDCeePtdXIohkEyhHTNM,42282
17
+ algokit_utils/accounts/account_manager.py,sha256=dIECz1QzkvV4bzsqoUJ4cRzJ6evHcRM2TpQpBf8l0ng,42242
18
18
  algokit_utils/accounts/kmd_account_manager.py,sha256=qPlklyoIk0B6B78GZX-VKwSgmfZBKgp5U2k51fg1YXg,6459
19
19
  algokit_utils/algorand.py,sha256=OvYMolOGK-tupKLDohtP_P59jlELIWW2hRqf1CYfrns,13732
20
20
  algokit_utils/application_client.py,sha256=5UIxXIBjukjRyjZPCeXmaNlAftbb3TziV7EfBolW79k,337
@@ -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.0b1.dist-info/LICENSE,sha256=J5i7U1Q9Q2c7saUzlvFRmrCCFhQyXb5Juz_LO5omNUw,1076
68
- algokit_utils-4.0.0b1.dist-info/METADATA,sha256=-CeJCqIsrFuSwcVFmddL10YlmK4oIVK6Vm-gNl4gxEQ,2420
69
- algokit_utils-4.0.0b1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
70
- algokit_utils-4.0.0b1.dist-info/RECORD,,
67
+ algokit_utils-4.0.1.dist-info/LICENSE,sha256=J5i7U1Q9Q2c7saUzlvFRmrCCFhQyXb5Juz_LO5omNUw,1076
68
+ algokit_utils-4.0.1.dist-info/METADATA,sha256=bzOfktBiYPiDso6zD9KdGbCATLWMMmA7Mk57N9nfibo,2419
69
+ algokit_utils-4.0.1.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
70
+ algokit_utils-4.0.1.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