algokit-utils 3.0.3b1__py3-none-any.whl → 4.0.0__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.
@@ -1,14 +1,14 @@
1
1
  import os
2
2
  from collections.abc import Callable
3
3
  from dataclasses import dataclass
4
- from typing import Any
4
+ from typing import Any, overload
5
5
 
6
6
  import algosdk
7
7
  from algosdk import mnemonic
8
8
  from algosdk.atomic_transaction_composer import TransactionSigner
9
9
  from algosdk.mnemonic import to_private_key
10
10
  from algosdk.transaction import SuggestedParams
11
- from typing_extensions import Self
11
+ from typing_extensions import Self, deprecated
12
12
 
13
13
  from algokit_utils.accounts.kmd_account_manager import KmdAccountManager
14
14
  from algokit_utils.clients.client_manager import ClientManager
@@ -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
@@ -215,6 +215,7 @@ class AccountManager:
215
215
  )
216
216
  return self
217
217
 
218
+ @overload
218
219
  def set_signer_from_account(self, account: TransactionSignerAccountProtocol) -> Self:
219
220
  """
220
221
  Tracks the given account for later signing.
@@ -227,11 +228,80 @@ class AccountManager:
227
228
 
228
229
  :example:
229
230
  >>> account_manager = AccountManager(client_manager)
230
- >>> account_manager.set_signer_from_account(SigningAccount(private_key=algosdk.account.generate_account()[0]))
231
+ >>> account_manager.set_signer_from_account(
232
+ ... SigningAccount(private_key=algosdk.account.generate_account()[0])
233
+ ... )
231
234
  >>> account_manager.set_signer_from_account(LogicSigAccount(AlgosdkLogicSigAccount(program, args)))
232
235
  >>> account_manager.set_signer_from_account(MultiSigAccount(multisig_params, [account1, account2]))
233
- """ # noqa: E501
234
- self._accounts[account.address] = account
236
+ """
237
+
238
+ @overload
239
+ @deprecated("Use set_signer_from_account(account) instead of set_signer_from_account(signer)")
240
+ def set_signer_from_account(self, signer: TransactionSignerAccountProtocol) -> Self:
241
+ """
242
+ Tracks the given account for later signing.
243
+
244
+ Note: If you are generating accounts via the various methods on `AccountManager`
245
+ (like `random`, `from_mnemonic`, `logic_sig`, etc.) then they automatically get tracked.
246
+
247
+ :param signer: The account to register (deprecated, use account parameter instead)
248
+ :returns: The `AccountManager` instance for method chaining
249
+
250
+ :example:
251
+ >>> account_manager = AccountManager(client_manager)
252
+ >>> account_manager.set_signer_from_account(
253
+ ... SigningAccount(private_key=algosdk.account.generate_account()[0])
254
+ ... )
255
+ >>> account_manager.set_signer_from_account(LogicSigAccount(AlgosdkLogicSigAccount(program, args)))
256
+ >>> account_manager.set_signer_from_account(MultiSigAccount(multisig_params, [account1, account2]))
257
+ """
258
+
259
+ def set_signer_from_account(
260
+ self,
261
+ *args: TransactionSignerAccountProtocol,
262
+ **kwargs: TransactionSignerAccountProtocol,
263
+ ) -> Self:
264
+ """
265
+ Tracks the given account for later signing.
266
+
267
+ Note: If you are generating accounts via the various methods on `AccountManager`
268
+ (like `random`, `from_mnemonic`, `logic_sig`, etc.) then they automatically get tracked.
269
+
270
+ The method accepts either a positional argument or a keyword argument named 'account' or 'signer'.
271
+ The 'signer' parameter is deprecated and will show a warning when used.
272
+
273
+ :param *args: Variable positional arguments. The first argument should be a TransactionSignerAccountProtocol.
274
+ :param **kwargs: Variable keyword arguments. Can include 'account' or 'signer' (deprecated) as
275
+ TransactionSignerAccountProtocol.
276
+ :returns: The `AccountManager` instance for method chaining
277
+ :raises ValueError: If no account or signer argument is provided
278
+
279
+ :example:
280
+ >>> account_manager = AccountManager(client_manager)
281
+ >>> # Using positional argument
282
+ >>> account_manager.set_signer_from_account(
283
+ ... SigningAccount(private_key=algosdk.account.generate_account()[0])
284
+ ... )
285
+ >>> # Using keyword argument 'account'
286
+ >>> account_manager.set_signer_from_account(
287
+ ... account=LogicSigAccount(AlgosdkLogicSigAccount(program, args))
288
+ ... )
289
+ >>> # Using deprecated keyword argument 'signer'
290
+ >>> account_manager.set_signer_from_account(
291
+ ... signer=MultiSigAccount(multisig_params, [account1, account2])
292
+ ... )
293
+ """
294
+ # Extract the account from either positional args or keyword args
295
+ if args:
296
+ account_obj = args[0]
297
+ elif "account" in kwargs:
298
+ account_obj = kwargs["account"]
299
+ elif "signer" in kwargs:
300
+ account_obj = kwargs["signer"]
301
+ else:
302
+ raise ValueError("Missing required argument: either 'account' or 'signer'")
303
+
304
+ self._accounts[account_obj.address] = account_obj
235
305
  return self
236
306
 
237
307
  def get_signer(self, sender: str | TransactionSignerAccountProtocol) -> TransactionSigner:
@@ -277,7 +347,7 @@ class AccountManager:
277
347
  """
278
348
  Returns the given sender account's current status, balance and spendable amounts.
279
349
 
280
- See `<https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddress>`_
350
+ See `<https://dev.algorand.co/reference/rest-apis/algod/#account>`_
281
351
  for response data schema details.
282
352
 
283
353
  :param sender: The address or account compliant with `TransactionSignerAccountProtocol` protocol to look up
@@ -542,7 +612,7 @@ class AccountManager:
542
612
 
543
613
  .. warning::
544
614
  Please be careful with this function and be sure to read the
545
- `official rekey guidance <https://developer.algorand.org/docs/get-details/accounts/rekey/>`_.
615
+ `official rekey guidance <https://dev.algorand.co/concepts/accounts/rekeying>`_.
546
616
 
547
617
  :example:
548
618
  >>> # Basic example (with string addresses):
@@ -623,7 +693,7 @@ class AccountManager:
623
693
  Ensures the given account has a certain amount of Algo free to spend (accounting for
624
694
  Algo locked in minimum balance requirement).
625
695
 
626
- 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.
627
697
 
628
698
  :param account_to_fund: The account to fund
629
699
  :param dispenser_account: The account to use as a dispenser funding source
@@ -725,7 +795,7 @@ class AccountManager:
725
795
  as a funding source such that the given account has a certain amount of Algo free to spend
726
796
  (accounting for Algo locked in minimum balance requirement).
727
797
 
728
- 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.
729
799
 
730
800
  :param account_to_fund: The account to fund
731
801
  :param min_spending_balance: The minimum balance of Algo that the account should have available to
@@ -818,7 +888,7 @@ class AccountManager:
818
888
  Uses the TestNet Dispenser API as a funding source such that the account has a certain amount
819
889
  of Algo free to spend (accounting for Algo locked in minimum balance requirement).
820
890
 
821
- 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.
822
892
 
823
893
  :param account_to_fund: The account to fund
824
894
  :param dispenser_client: The TestNet dispenser funding client
@@ -144,8 +144,8 @@ class TestNetDispenserApiClient:
144
144
  @overload
145
145
  def fund(self, address: str, amount: int) -> DispenserFundResponse: ...
146
146
 
147
- @deprecated("Asset ID parameter is deprecated. Can now use `fund(address, amount)` instead.")
148
147
  @overload
148
+ @deprecated("Asset ID parameter is deprecated. Can now use `fund(address, amount)` instead.")
149
149
  def fund(self, address: str, amount: int, asset_id: int | None = None) -> DispenserFundResponse: ...
150
150
 
151
151
  def fund(self, address: str, amount: int, asset_id: int | None = None) -> DispenserFundResponse: # noqa: ARG002
algokit_utils/config.py CHANGED
@@ -59,7 +59,7 @@ class UpdatableConfig:
59
59
  self._trace_all: bool = False
60
60
  self._trace_buffer_size_mb: int | float = 256 # megabytes
61
61
  self._max_search_depth: int = 10
62
- self._populate_app_call_resources: bool = False
62
+ self._populate_app_call_resources: bool = True
63
63
  self._configure_project_root()
64
64
 
65
65
  def _configure_project_root(self) -> None:
@@ -123,7 +123,7 @@ class UpdatableConfig:
123
123
  trace_all: bool = False,
124
124
  trace_buffer_size_mb: float = 256,
125
125
  max_search_depth: int = 10,
126
- populate_app_call_resources: bool = False,
126
+ populate_app_call_resources: bool = True,
127
127
  logger: logging.Logger | None = None,
128
128
  ) -> None:
129
129
  """
@@ -134,7 +134,7 @@ class UpdatableConfig:
134
134
  :param trace_all: Whether to trace all operations. Defaults to False.
135
135
  :param trace_buffer_size_mb: The trace buffer size in megabytes. Defaults to 256.
136
136
  :param max_search_depth: The maximum depth to search for a specific file. Defaults to 10.
137
- :param populate_app_call_resources: Whether to populate app call resources. Defaults to False.
137
+ :param populate_app_call_resources: Whether to populate app call resources. Defaults to True.
138
138
  :param logger: A custom logger to use. Defaults to AlgoKitLogger instance.
139
139
  """
140
140
  if logger is not None:
@@ -831,7 +831,11 @@ def prepare_group_for_sending( # noqa: C901, PLR0912, PLR0915
831
831
  """
832
832
  # Get execution info via simulation
833
833
  execution_info = _get_group_execution_info(
834
- atc, algod, populate_app_call_resources, cover_app_call_inner_transaction_fees, additional_atc_context
834
+ atc,
835
+ algod,
836
+ populate_app_call_resources if populate_app_call_resources is not None else config.populate_app_call_resource,
837
+ cover_app_call_inner_transaction_fees,
838
+ additional_atc_context,
835
839
  )
836
840
  max_fees = additional_atc_context.max_fees if additional_atc_context else None
837
841
 
@@ -1971,8 +1975,7 @@ class TransactionComposer:
1971
1975
  pattern = r"^[a-zA-Z0-9][a-zA-Z0-9_/@.-]{4,31}$"
1972
1976
  if not re.match(pattern, note["dapp_name"]):
1973
1977
  raise ValueError(
1974
- "dapp_name must be 5-32 chars, start with alphanumeric, "
1975
- "and contain only alphanumeric, _, /, @, ., or -"
1978
+ "dapp_name must be 5-32 chars, start with alphanumeric, and contain only alphanumeric, _, /, @, ., or -"
1976
1979
  )
1977
1980
 
1978
1981
  data = note["data"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: algokit-utils
3
- Version: 3.0.3b1
3
+ Version: 4.0.0
4
4
  Summary: Utilities for Algorand development for use by AlgoKit
5
5
  License: MIT
6
6
  Author: Algorand Foundation
@@ -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=LEqAp4AAssUugWG4PkOHw9oVmhIK-iZMGYcR7_q6zT0,38997
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
@@ -39,9 +39,9 @@ algokit_utils/beta/client_manager.py,sha256=xDFvsMSha0Ki42BGvKvfScQWT_W9y4GeP_RW
39
39
  algokit_utils/beta/composer.py,sha256=xDFvsMSha0Ki42BGvKvfScQWT_W9y4GeP_RWXjc3vnE,213
40
40
  algokit_utils/clients/__init__.py,sha256=qUuKBvfLnw4z6ZU9x7mc-mLjfnnXC9UcvtoeU33ZLJ8,136
41
41
  algokit_utils/clients/client_manager.py,sha256=eTkgaDVRl-auRnd_t3tQQzdrpLky6I1rQLR_1ZUXmrw,28615
42
- algokit_utils/clients/dispenser_api_client.py,sha256=TL4BZqRS81y55NVi_1Fczqkw8EmRcRavHTHkaSLw-t4,7336
42
+ algokit_utils/clients/dispenser_api_client.py,sha256=3TgbnQsDmC9zSfDIykwNKDadbXLhQKZxUSbPwTDJISY,7336
43
43
  algokit_utils/common.py,sha256=5wl83vWw91RYdEC4hTTufqaptKiFtgjKLIyONDmRSH0,300
44
- algokit_utils/config.py,sha256=SFqfR_JKlx-pCOps1xF646oZqtIcRS2AtasiYne63E4,6051
44
+ algokit_utils/config.py,sha256=CvDH5B8uPWnm6wCHHlMsl-0lONzq26vPLvwmnbw7c-k,6048
45
45
  algokit_utils/deploy.py,sha256=UUtSDI6JcBUuto62FuirhUlDcjZwQyLkiERgDMx8P7A,330
46
46
  algokit_utils/dispenser_api.py,sha256=-EO4Dq3q_v4kSMey43kXJfoX8uCBPJpjEMTlLI7xn_I,324
47
47
  algokit_utils/errors/__init__.py,sha256=CmuiLVjzMAOYxPaIIwmYCNArsso_RtS2ssFoNdp5CMs,61
@@ -61,10 +61,10 @@ algokit_utils/protocols/account.py,sha256=CowaVY7ErBP84TWBHNvBjkZy18whPb8HIlMZtJ
61
61
  algokit_utils/protocols/typed_clients.py,sha256=UrQrHbN2SvS8pEFJ8JQodvouoWeBrQOQGZGyBQx1KLM,3322
62
62
  algokit_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
63
  algokit_utils/transactions/__init__.py,sha256=7fYF3m6DyOGzbV36MT5svo0wSkj9AIz496kWgIWSAlk,225
64
- algokit_utils/transactions/transaction_composer.py,sha256=x_pCYWaOQvigzTWPN9KwnmUZGC_MvgxYsCtY0HXqJPw,104042
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-3.0.3b1.dist-info/LICENSE,sha256=J5i7U1Q9Q2c7saUzlvFRmrCCFhQyXb5Juz_LO5omNUw,1076
68
- algokit_utils-3.0.3b1.dist-info/METADATA,sha256=c58s4IG_nnES-xqFkIJk6EMTcvq9FpRiTEmIxDqumYw,2420
69
- algokit_utils-3.0.3b1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
70
- algokit_utils-3.0.3b1.dist-info/RECORD,,
67
+ algokit_utils-4.0.0.dist-info/LICENSE,sha256=J5i7U1Q9Q2c7saUzlvFRmrCCFhQyXb5Juz_LO5omNUw,1076
68
+ algokit_utils-4.0.0.dist-info/METADATA,sha256=u8F32Z2gvnS71zPzFOu8tkP9P65MyyJNWmFwPHkDBe4,2418
69
+ algokit_utils-4.0.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
70
+ algokit_utils-4.0.0.dist-info/RECORD,,