algokit-utils 3.0.3b1__py3-none-any.whl → 3.0.3b2__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.

@@ -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
@@ -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:
@@ -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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: algokit-utils
3
- Version: 3.0.3b1
3
+ Version: 3.0.3b2
4
4
  Summary: Utilities for Algorand development for use by AlgoKit
5
5
  License: MIT
6
6
  Author: Algorand Foundation
@@ -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=l0rvCbkvOfALAXZlaookZkhqDCeePtdXIohkEyhHTNM,42282
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,7 +39,7 @@ 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
44
  algokit_utils/config.py,sha256=SFqfR_JKlx-pCOps1xF646oZqtIcRS2AtasiYne63E4,6051
45
45
  algokit_utils/deploy.py,sha256=UUtSDI6JcBUuto62FuirhUlDcjZwQyLkiERgDMx8P7A,330
@@ -64,7 +64,7 @@ algokit_utils/transactions/__init__.py,sha256=7fYF3m6DyOGzbV36MT5svo0wSkj9AIz496
64
64
  algokit_utils/transactions/transaction_composer.py,sha256=x_pCYWaOQvigzTWPN9KwnmUZGC_MvgxYsCtY0HXqJPw,104042
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-3.0.3b2.dist-info/LICENSE,sha256=J5i7U1Q9Q2c7saUzlvFRmrCCFhQyXb5Juz_LO5omNUw,1076
68
+ algokit_utils-3.0.3b2.dist-info/METADATA,sha256=YwXDja0I788_p-R2VWyYzOSSHDDvl0VRjIxAdy6-vo4,2420
69
+ algokit_utils-3.0.3b2.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
70
+ algokit_utils-3.0.3b2.dist-info/RECORD,,