algokit-utils 2.3.1b3__py3-none-any.whl → 2.3.2b2__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.

@@ -220,7 +220,7 @@ def simulate_response(atc: AtomicTransactionComposer, algod_client: "AlgodClient
220
220
  txn_list = [txn_group.txn for txn_group in unsigned_txn_groups]
221
221
  fake_signed_transactions = empty_signer.sign_transactions(txn_list, [])
222
222
  txn_group = [SimulateRequestTransactionGroup(txns=fake_signed_transactions)]
223
- trace_config = SimulateTraceConfig(enable=True, stack_change=True, scratch_change=True)
223
+ trace_config = SimulateTraceConfig(enable=True, stack_change=True, scratch_change=True, state_change=True)
224
224
 
225
225
  simulate_request = SimulateRequest(
226
226
  txn_groups=txn_group, allow_more_logs=True, allow_empty_signatures=True, exec_trace_config=trace_config
algokit_utils/account.py CHANGED
@@ -39,14 +39,14 @@ def get_account_from_mnemonic(mnemonic: str) -> Account:
39
39
 
40
40
  def create_kmd_wallet_account(kmd_client: "KMDClient", name: str) -> Account:
41
41
  """Creates a wallet with specified name"""
42
- wallet_id = kmd_client.create_wallet(name, "")["id"] # type: ignore[no-untyped-call]
43
- wallet_handle = kmd_client.init_wallet_handle(wallet_id, "") # type: ignore[no-untyped-call]
44
- kmd_client.generate_key(wallet_handle) # type: ignore[no-untyped-call]
42
+ wallet_id = kmd_client.create_wallet(name, "")["id"]
43
+ wallet_handle = kmd_client.init_wallet_handle(wallet_id, "")
44
+ kmd_client.generate_key(wallet_handle)
45
45
 
46
- key_ids: list[str] = kmd_client.list_keys(wallet_handle) # type: ignore[no-untyped-call]
46
+ key_ids: list[str] = kmd_client.list_keys(wallet_handle)
47
47
  account_key = key_ids[0]
48
48
 
49
- private_account_key = kmd_client.export_key(wallet_handle, "", account_key) # type: ignore[no-untyped-call]
49
+ private_account_key = kmd_client.export_key(wallet_handle, "", account_key)
50
50
  return get_account_from_mnemonic(from_private_key(private_account_key)) # type: ignore[no-untyped-call]
51
51
 
52
52
 
@@ -116,15 +116,15 @@ def get_kmd_wallet_account(
116
116
  predicate: "Callable[[dict[str, Any]], bool] | None" = None,
117
117
  ) -> Account | None:
118
118
  """Returns wallet matching specified name and predicate or None if not found"""
119
- wallets: list[dict] = kmd_client.list_wallets() # type: ignore[no-untyped-call]
119
+ wallets: list[dict] = kmd_client.list_wallets()
120
120
 
121
121
  wallet = next((w for w in wallets if w["name"] == name), None)
122
122
  if wallet is None:
123
123
  return None
124
124
 
125
125
  wallet_id = wallet["id"]
126
- wallet_handle = kmd_client.init_wallet_handle(wallet_id, "") # type: ignore[no-untyped-call]
127
- key_ids: list[str] = kmd_client.list_keys(wallet_handle) # type: ignore[no-untyped-call]
126
+ wallet_handle = kmd_client.init_wallet_handle(wallet_id, "")
127
+ key_ids: list[str] = kmd_client.list_keys(wallet_handle)
128
128
  matched_account_key = None
129
129
  if predicate:
130
130
  for key in key_ids:
@@ -138,7 +138,7 @@ def get_kmd_wallet_account(
138
138
  if not matched_account_key:
139
139
  return None
140
140
 
141
- private_account_key = kmd_client.export_key(wallet_handle, "", matched_account_key) # type: ignore[no-untyped-call]
141
+ private_account_key = kmd_client.export_key(wallet_handle, "", matched_account_key)
142
142
  return get_account_from_mnemonic(from_private_key(private_account_key)) # type: ignore[no-untyped-call]
143
143
 
144
144
 
@@ -233,7 +233,7 @@ class ApplicationClient:
233
233
  ) -> "ApplicationClient":
234
234
  """Creates a copy of this ApplicationClient, using the new signer, sender and app_id values if provided.
235
235
  Will also substitute provided template_values into the associated app_spec in the copy"""
236
- new_client: "ApplicationClient" = copy.copy(self)
236
+ new_client: ApplicationClient = copy.copy(self)
237
237
  new_client._prepare( # noqa: SLF001
238
238
  new_client, signer=signer, sender=sender, app_id=app_id, template_values=template_values
239
239
  )
@@ -567,7 +567,7 @@ class AlgokitComposer:
567
567
 
568
568
  return isinstance(x, bool | int | float | str | bytes)
569
569
 
570
- def _build_method_call(
570
+ def _build_method_call( # noqa: C901, PLR0912
571
571
  self, params: MethodCallParams, suggested_params: algosdk.transaction.SuggestedParams
572
572
  ) -> list[TransactionWithSigner]:
573
573
  method_args = []
@@ -633,7 +633,7 @@ class AlgokitComposer:
633
633
 
634
634
  return self._build_atc(method_atc)
635
635
 
636
- def _build_txn(
636
+ def _build_txn( # noqa: C901, PLR0912
637
637
  self,
638
638
  txn: TransactionWithSigner | TxnParams | AtomicTransactionComposer,
639
639
  suggested_params: algosdk.transaction.SuggestedParams,
algokit_utils/deploy.py CHANGED
@@ -325,29 +325,45 @@ def add_deploy_template_variables(
325
325
 
326
326
 
327
327
  def _find_unquoted_string(line: str, token: str, start: int = 0, end: int = -1) -> int | None:
328
- """Find the first string within a line of TEAL. Only matches outside of quotes are returned.
328
+ """Find the first string within a line of TEAL. Only matches outside of quotes and base64 are returned.
329
329
  Returns None if not found"""
330
330
 
331
331
  if end < 0:
332
332
  end = len(line)
333
333
  idx = start
334
- in_quotes = False
334
+ in_quotes = in_base64 = False
335
335
  while idx < end:
336
336
  current_char = line[idx]
337
337
  match current_char:
338
- case "\\":
339
- if in_quotes: # skip next character
340
- idx += 1
338
+ # enter base64
339
+ case " " | "(" if not in_quotes and _last_token_base64(line, idx):
340
+ in_base64 = True
341
+ # exit base64
342
+ case " " | ")" if not in_quotes and in_base64:
343
+ in_base64 = False
344
+ # escaped char
345
+ case "\\" if in_quotes:
346
+ # skip next character
347
+ idx += 1
348
+ # quote boundary
341
349
  case '"':
342
350
  in_quotes = not in_quotes
343
- case _:
351
+ # can test for match
352
+ case _ if not in_quotes and not in_base64 and line.startswith(token, idx):
344
353
  # only match if not in quotes and string matches
345
- if not in_quotes and line.startswith(token, idx):
346
- return idx
354
+ return idx
347
355
  idx += 1
348
356
  return None
349
357
 
350
358
 
359
+ def _last_token_base64(line: str, idx: int) -> bool:
360
+ try:
361
+ *_, last = line[:idx].split()
362
+ except ValueError:
363
+ return False
364
+ return last in ("base64", "b64")
365
+
366
+
351
367
  def _find_template_token(line: str, token: str, start: int = 0, end: int = -1) -> int | None:
352
368
  """Find the first template token within a line of TEAL. Only matches outside of quotes are returned.
353
369
  Only full token matches are returned, i.e. TMPL_STR will not match against TMPL_STRING
@@ -851,7 +867,7 @@ def _convert_deploy_args(
851
867
  signer: TransactionSigner | None,
852
868
  sender: str | None,
853
869
  ) -> tuple[ABIMethod | bool | None, ABIArgsDict, CreateCallParameters]:
854
- args = _args.__dict__ if isinstance(_args, DeployCallArgs) else (_args or {})
870
+ args = _args.__dict__ if isinstance(_args, DeployCallArgs) else dict(_args or {})
855
871
 
856
872
  # return most derived type, unused parameters are ignored
857
873
  parameters = CreateCallParameters(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: algokit-utils
3
- Version: 2.3.1b3
3
+ Version: 2.3.2b2
4
4
  Summary: Utilities for Algorand development for use by AlgoKit
5
5
  License: MIT
6
6
  Author: Algorand Foundation
@@ -11,6 +11,7 @@ Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: 3.10
12
12
  Classifier: Programming Language :: Python :: 3.11
13
13
  Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
14
15
  Requires-Dist: deprecated (>=1.2.14,<2.0.0)
15
16
  Requires-Dist: httpx (>=0.23.1,<0.24.0)
16
17
  Requires-Dist: py-algorand-sdk (>=2.4.0,<3.0.0)
@@ -1,24 +1,24 @@
1
1
  algokit_utils/__init__.py,sha256=Xc9NVy3cETI2qzbkkAea2YrZ9-CLtZLHnuS1UHQ13wQ,4909
2
- algokit_utils/_debugging.py,sha256=4UC5NZGqxF32y742TUB34rX9kWaObXCCPOs-lbkQjGQ,10732
2
+ algokit_utils/_debugging.py,sha256=HlO_mOsVTaz2aqci_4tOpGT-rAd-xZ1RxFphnTRgDLQ,10751
3
3
  algokit_utils/_ensure_funded.py,sha256=ZdEdUB43QGIQrg7cSSgNrDmWaLSUhli9x9I6juwKfgo,6786
4
4
  algokit_utils/_transfer.py,sha256=R9q8RoMHiwtqcwQjuGHEluMxIzmYqAsI5WrTsQd24Ds,6021
5
- algokit_utils/account.py,sha256=UIuOQZe28pQxjEP9TzhtYlOU20tUdzzS-nIIZM9Bp6Y,7364
6
- algokit_utils/application_client.py,sha256=rBV5QnMJ8wBwfV6KCz5QS9dtI97aF61a0TGPy2ZnEu0,58703
5
+ algokit_utils/account.py,sha256=JYovI84sxiU2mIbwNwWVuoEJBMuAPJauHx5jkKFrR7E,7067
6
+ algokit_utils/application_client.py,sha256=sDSUBsLhoPJkjTlkWLAOh-DLkEhLypH3p5VzJkSlIx4,58701
7
7
  algokit_utils/application_specification.py,sha256=XusOe7VrGPun2UoNspC9Ei202NzPkxRNx5USXiABuXc,7466
8
8
  algokit_utils/asset.py,sha256=jsc7T1dH9HZA3Yve2gRLObwUlK6xLDoQz0NxLLnqaGs,7216
9
9
  algokit_utils/beta/account_manager.py,sha256=dSb-jpBAWRfmKFYzG6T8t5vkh6ysX2NkZXl5UcZY5WA,8015
10
10
  algokit_utils/beta/algorand_client.py,sha256=y1CYYn_ADwgOLTVID9BFMvdubDgKqUfx9R6XH3PrzsA,12649
11
11
  algokit_utils/beta/client_manager.py,sha256=rW58VVBdYAV_5QwXNyt3VMP8NGon_IRhq1Dr35Mp31g,3117
12
- algokit_utils/beta/composer.py,sha256=qpIWQ6Xeysk1FzqW8AntHJ_go_W2qIEDB4uvGFOOdgM,28627
12
+ algokit_utils/beta/composer.py,sha256=isGd8obdf8F4Agnq-yG7mVHxt4VtihZFZNR9LHx5_ek,28673
13
13
  algokit_utils/common.py,sha256=K6-3_9dv2clDn0WMYb8AWE_N46kWWIXglZIPfHIowDs,812
14
14
  algokit_utils/config.py,sha256=oY3o1kPzVPRiQH--f4HzrMMNPojT078CSudqS9WQaEc,4279
15
- algokit_utils/deploy.py,sha256=ydE3QSq1lRkjXQC9zdFclywx8q1UgV9l-l3Mx-shbHg,34668
15
+ algokit_utils/deploy.py,sha256=AQz7FTeIpprI83jT470bSgAkqObZc1UgqWxWkEbJjEk,35216
16
16
  algokit_utils/dispenser_api.py,sha256=BpwEhKDig6qz54wbO-htG8hmLxFIrvdzXpESUb7Y1zw,5584
17
17
  algokit_utils/logic_error.py,sha256=I9fJJ09zfpPlKgcJJ7fqC77BBPTz37QsSlGfZwXDdPQ,2684
18
18
  algokit_utils/models.py,sha256=KMpSUv7XGjZ9_50U6qUjcPjGh9_7lsRj3ZlO9Fb2zyE,8421
19
19
  algokit_utils/network_clients.py,sha256=TlGRZ4l62_vi__AKg9zyVGiAawTrA0ca6AfPDzRL44E,5136
20
20
  algokit_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
- algokit_utils-2.3.1b3.dist-info/LICENSE,sha256=J5i7U1Q9Q2c7saUzlvFRmrCCFhQyXb5Juz_LO5omNUw,1076
22
- algokit_utils-2.3.1b3.dist-info/METADATA,sha256=7Hh0uIcgrt05m-NDEtHDNluue-XZcOTRJt-LNoBAv-0,2207
23
- algokit_utils-2.3.1b3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
24
- algokit_utils-2.3.1b3.dist-info/RECORD,,
21
+ algokit_utils-2.3.2b2.dist-info/LICENSE,sha256=J5i7U1Q9Q2c7saUzlvFRmrCCFhQyXb5Juz_LO5omNUw,1076
22
+ algokit_utils-2.3.2b2.dist-info/METADATA,sha256=SFZRvih1A9XO8dCkn0EeTEcAweLY7_-qpEn-dvm5jsA,2258
23
+ algokit_utils-2.3.2b2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
24
+ algokit_utils-2.3.2b2.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.0
2
+ Generator: poetry-core 1.9.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any