algokit-utils 3.0.3b1__py3-none-any.whl → 4.0.0b1__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.
- algokit_utils/accounts/account_manager.py +75 -5
- algokit_utils/clients/dispenser_api_client.py +1 -1
- algokit_utils/config.py +3 -3
- algokit_utils/transactions/transaction_composer.py +6 -3
- {algokit_utils-3.0.3b1.dist-info → algokit_utils-4.0.0b1.dist-info}/METADATA +1 -1
- {algokit_utils-3.0.3b1.dist-info → algokit_utils-4.0.0b1.dist-info}/RECORD +8 -8
- {algokit_utils-3.0.3b1.dist-info → algokit_utils-4.0.0b1.dist-info}/LICENSE +0 -0
- {algokit_utils-3.0.3b1.dist-info → algokit_utils-4.0.0b1.dist-info}/WHEEL +0 -0
|
@@ -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(
|
|
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
|
-
"""
|
|
234
|
-
|
|
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
|
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 =
|
|
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 =
|
|
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
|
|
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,
|
|
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"]
|
|
@@ -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=
|
|
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,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=
|
|
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=
|
|
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=
|
|
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-
|
|
68
|
-
algokit_utils-
|
|
69
|
-
algokit_utils-
|
|
70
|
-
algokit_utils-
|
|
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,,
|
|
File without changes
|
|
File without changes
|