algokit-utils 3.0.0b7__py3-none-any.whl → 3.0.0b9__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 +1 -2
- algokit_utils/applications/app_client.py +5 -0
- algokit_utils/models/account.py +27 -7
- algokit_utils/transactions/transaction_composer.py +60 -40
- {algokit_utils-3.0.0b7.dist-info → algokit_utils-3.0.0b9.dist-info}/METADATA +1 -1
- {algokit_utils-3.0.0b7.dist-info → algokit_utils-3.0.0b9.dist-info}/RECORD +8 -8
- {algokit_utils-3.0.0b7.dist-info → algokit_utils-3.0.0b9.dist-info}/LICENSE +0 -0
- {algokit_utils-3.0.0b7.dist-info → algokit_utils-3.0.0b9.dist-info}/WHEEL +0 -0
|
@@ -7,7 +7,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
|
-
from algosdk.transaction import LogicSigAccount as AlgosdkLogicSigAccount
|
|
11
10
|
from algosdk.transaction import SuggestedParams
|
|
12
11
|
from typing_extensions import Self
|
|
13
12
|
|
|
@@ -313,7 +312,7 @@ class AccountManager:
|
|
|
313
312
|
:param args: The (binary) arguments to pass into the logic signature
|
|
314
313
|
:returns: The registered AlgosdkLogicSigAccount instance
|
|
315
314
|
"""
|
|
316
|
-
logic_sig = LogicSigAccount(
|
|
315
|
+
logic_sig = LogicSigAccount(program, args)
|
|
317
316
|
self._accounts[logic_sig.address] = logic_sig
|
|
318
317
|
return logic_sig
|
|
319
318
|
|
|
@@ -1900,6 +1900,11 @@ class AppClient:
|
|
|
1900
1900
|
method = self._app_spec.get_arc56_method(method_name_or_signature)
|
|
1901
1901
|
result: list[ABIValue | ABIStruct | AppMethodCallTransactionArgument | None] = []
|
|
1902
1902
|
|
|
1903
|
+
if args and len(method.args) < len(args):
|
|
1904
|
+
raise ValueError(
|
|
1905
|
+
f"Unexpected arg at position {len(method.args)}. {method.name} only expects {len(method.args)} args"
|
|
1906
|
+
)
|
|
1907
|
+
|
|
1903
1908
|
for i, method_arg in enumerate(method.args):
|
|
1904
1909
|
arg_value = args[i] if args and i < len(args) else None
|
|
1905
1910
|
|
algokit_utils/models/account.py
CHANGED
|
@@ -9,6 +9,7 @@ from typing_extensions import deprecated
|
|
|
9
9
|
|
|
10
10
|
__all__ = [
|
|
11
11
|
"DISPENSER_ACCOUNT_NAME",
|
|
12
|
+
"LogicSigAccount",
|
|
12
13
|
"MultiSigAccount",
|
|
13
14
|
"MultisigMetadata",
|
|
14
15
|
"SigningAccount",
|
|
@@ -118,6 +119,14 @@ class MultiSigAccount:
|
|
|
118
119
|
[account.private_key for account in signing_accounts],
|
|
119
120
|
)
|
|
120
121
|
|
|
122
|
+
@property
|
|
123
|
+
def multisig(self) -> Multisig:
|
|
124
|
+
"""Get the underlying `algosdk.transaction.Multisig` object instance.
|
|
125
|
+
|
|
126
|
+
:return: The `algosdk.transaction.Multisig` object instance
|
|
127
|
+
"""
|
|
128
|
+
return self._multisig
|
|
129
|
+
|
|
121
130
|
@property
|
|
122
131
|
def params(self) -> MultisigMetadata:
|
|
123
132
|
"""Get the parameters for the multisig account.
|
|
@@ -173,20 +182,31 @@ class LogicSigAccount:
|
|
|
173
182
|
Provides functionality to manage and sign transactions for a logic sig account.
|
|
174
183
|
"""
|
|
175
184
|
|
|
176
|
-
_account: AlgosdkLogicSigAccount
|
|
177
185
|
_signer: LogicSigTransactionSigner
|
|
178
186
|
|
|
179
|
-
def __init__(self,
|
|
180
|
-
self.
|
|
181
|
-
|
|
187
|
+
def __init__(self, program: bytes, args: list[bytes] | None) -> None:
|
|
188
|
+
self._signer = LogicSigTransactionSigner(AlgosdkLogicSigAccount(program, args))
|
|
189
|
+
|
|
190
|
+
@property
|
|
191
|
+
def lsig(self) -> AlgosdkLogicSigAccount:
|
|
192
|
+
"""Get the underlying `algosdk.transaction.LogicSigAccount` object instance.
|
|
193
|
+
|
|
194
|
+
:return: The `algosdk.transaction.LogicSigAccount` object instance
|
|
195
|
+
"""
|
|
196
|
+
return self._signer.lsig
|
|
182
197
|
|
|
183
198
|
@property
|
|
184
199
|
def address(self) -> str:
|
|
185
|
-
"""Get the address of the
|
|
200
|
+
"""Get the address of the logic sig account.
|
|
186
201
|
|
|
187
|
-
|
|
202
|
+
If the LogicSig is delegated to another account, this will return the address of that account.
|
|
203
|
+
|
|
204
|
+
If the LogicSig is not delegated to another account, this will return an escrow address that is the hash of
|
|
205
|
+
the LogicSig's program code.
|
|
206
|
+
|
|
207
|
+
:return: The logic sig account address
|
|
188
208
|
"""
|
|
189
|
-
return self.
|
|
209
|
+
return self._signer.lsig.address()
|
|
190
210
|
|
|
191
211
|
@property
|
|
192
212
|
def signer(self) -> LogicSigTransactionSigner:
|
|
@@ -591,9 +591,27 @@ class SendAtomicTransactionComposerResults:
|
|
|
591
591
|
simulate_response: dict[str, Any] | None = None
|
|
592
592
|
|
|
593
593
|
|
|
594
|
+
class UnnamedResourcesAccessed:
|
|
595
|
+
"""Information about unnamed resource access."""
|
|
596
|
+
|
|
597
|
+
def __init__(self, resources_accessed: dict[str, Any] | None = None):
|
|
598
|
+
resources = resources_accessed or {}
|
|
599
|
+
|
|
600
|
+
if not isinstance(resources, dict):
|
|
601
|
+
raise TypeError(f"Expected dictionary object, got {type(resources_accessed)}")
|
|
602
|
+
|
|
603
|
+
self.accounts: list[str] | None = resources.get("accounts", None)
|
|
604
|
+
self.app_locals: list[dict[str, Any]] | None = resources.get("app-locals", None)
|
|
605
|
+
self.apps: list[int] | None = resources.get("apps", None)
|
|
606
|
+
self.asset_holdings: list[dict[str, Any]] | None = resources.get("asset-holdings", None)
|
|
607
|
+
self.assets: list[int] | None = resources.get("assets", None)
|
|
608
|
+
self.boxes: list[dict[str, Any]] | None = resources.get("boxes", None)
|
|
609
|
+
self.extra_box_refs: int | None = resources.get("extra-box-refs", None)
|
|
610
|
+
|
|
611
|
+
|
|
594
612
|
@dataclass
|
|
595
613
|
class ExecutionInfoTxn:
|
|
596
|
-
unnamed_resources_accessed:
|
|
614
|
+
unnamed_resources_accessed: UnnamedResourcesAccessed | None = None
|
|
597
615
|
required_fee_delta: int = 0
|
|
598
616
|
|
|
599
617
|
|
|
@@ -601,7 +619,7 @@ class ExecutionInfoTxn:
|
|
|
601
619
|
class ExecutionInfo:
|
|
602
620
|
"""Information about transaction execution from simulation."""
|
|
603
621
|
|
|
604
|
-
group_unnamed_resources_accessed:
|
|
622
|
+
group_unnamed_resources_accessed: UnnamedResourcesAccessed | None = None
|
|
605
623
|
txns: list[ExecutionInfoTxn] | None = None
|
|
606
624
|
|
|
607
625
|
|
|
@@ -706,7 +724,7 @@ def _get_group_execution_info( # noqa: C901, PLR0912
|
|
|
706
724
|
)
|
|
707
725
|
failed_at = group_response.get("failed-at", [0])[0]
|
|
708
726
|
raise ValueError(
|
|
709
|
-
f"Error
|
|
727
|
+
f"Error resolving execution info via simulate in transaction {failed_at}: "
|
|
710
728
|
f"{group_response['failure-message']}"
|
|
711
729
|
)
|
|
712
730
|
|
|
@@ -745,7 +763,7 @@ def _get_group_execution_info( # noqa: C901, PLR0912
|
|
|
745
763
|
|
|
746
764
|
txn_results.append(
|
|
747
765
|
ExecutionInfoTxn(
|
|
748
|
-
unnamed_resources_accessed=txn_result_raw.get("unnamed-resources-accessed")
|
|
766
|
+
unnamed_resources_accessed=UnnamedResourcesAccessed(txn_result_raw.get("unnamed-resources-accessed"))
|
|
749
767
|
if populate_app_call_resources
|
|
750
768
|
else None,
|
|
751
769
|
required_fee_delta=required_fee_delta,
|
|
@@ -753,7 +771,7 @@ def _get_group_execution_info( # noqa: C901, PLR0912
|
|
|
753
771
|
)
|
|
754
772
|
|
|
755
773
|
return ExecutionInfo(
|
|
756
|
-
group_unnamed_resources_accessed=group_response.get("unnamed-resources-accessed")
|
|
774
|
+
group_unnamed_resources_accessed=UnnamedResourcesAccessed(group_response.get("unnamed-resources-accessed"))
|
|
757
775
|
if populate_app_call_resources
|
|
758
776
|
else None,
|
|
759
777
|
txns=txn_results,
|
|
@@ -1052,11 +1070,11 @@ def prepare_group_for_sending( # noqa: C901, PLR0912, PLR0915
|
|
|
1052
1070
|
resources = txn_info.unnamed_resources_accessed
|
|
1053
1071
|
if resources and is_app_txn:
|
|
1054
1072
|
app_txn = group[i].txn
|
|
1055
|
-
if resources.
|
|
1073
|
+
if resources.boxes or resources.extra_box_refs:
|
|
1056
1074
|
raise ValueError("Unexpected boxes at transaction level")
|
|
1057
|
-
if resources.
|
|
1075
|
+
if resources.app_locals:
|
|
1058
1076
|
raise ValueError("Unexpected app local at transaction level")
|
|
1059
|
-
if resources.
|
|
1077
|
+
if resources.asset_holdings:
|
|
1060
1078
|
raise ValueError("Unexpected asset holding at transaction level")
|
|
1061
1079
|
|
|
1062
1080
|
# Update application call fields
|
|
@@ -1066,10 +1084,10 @@ def prepare_group_for_sending( # noqa: C901, PLR0912, PLR0915
|
|
|
1066
1084
|
boxes = list(getattr(app_txn, "boxes", []) or [])
|
|
1067
1085
|
|
|
1068
1086
|
# Add new resources
|
|
1069
|
-
accounts.extend(resources.
|
|
1070
|
-
foreign_apps.extend(resources.
|
|
1071
|
-
foreign_assets.extend(resources.
|
|
1072
|
-
boxes.extend(resources.
|
|
1087
|
+
accounts.extend(resources.accounts or [])
|
|
1088
|
+
foreign_apps.extend(resources.apps or [])
|
|
1089
|
+
foreign_assets.extend(resources.assets or [])
|
|
1090
|
+
boxes.extend(resources.boxes or [])
|
|
1073
1091
|
|
|
1074
1092
|
# Validate limits
|
|
1075
1093
|
if len(accounts) > MAX_APP_CALL_ACCOUNT_REFERENCES:
|
|
@@ -1113,45 +1131,41 @@ def prepare_group_for_sending( # noqa: C901, PLR0912, PLR0915
|
|
|
1113
1131
|
group_resources = execution_info.group_unnamed_resources_accessed
|
|
1114
1132
|
if group_resources:
|
|
1115
1133
|
# Handle cross-reference resources first
|
|
1116
|
-
for app_local in group_resources.
|
|
1134
|
+
for app_local in group_resources.app_locals or []:
|
|
1117
1135
|
populate_group_resource(group, app_local, "appLocal")
|
|
1118
1136
|
# Remove processed resources
|
|
1119
|
-
if
|
|
1120
|
-
group_resources
|
|
1121
|
-
|
|
1122
|
-
]
|
|
1123
|
-
if "apps" in group_resources:
|
|
1124
|
-
group_resources["apps"] = [app for app in group_resources["apps"] if int(app) != int(app_local["app"])]
|
|
1137
|
+
if group_resources.accounts:
|
|
1138
|
+
group_resources.accounts = [acc for acc in group_resources.accounts if acc != app_local["account"]]
|
|
1139
|
+
if group_resources.apps:
|
|
1140
|
+
group_resources.apps = [app for app in group_resources.apps if int(app) != int(app_local["app"])]
|
|
1125
1141
|
|
|
1126
|
-
for asset_holding in group_resources.
|
|
1142
|
+
for asset_holding in group_resources.asset_holdings or []:
|
|
1127
1143
|
populate_group_resource(group, asset_holding, "assetHolding")
|
|
1128
1144
|
# Remove processed resources
|
|
1129
|
-
if
|
|
1130
|
-
group_resources
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
group_resources["assets"] = [
|
|
1135
|
-
asset for asset in group_resources["assets"] if int(asset) != int(asset_holding["asset"])
|
|
1145
|
+
if group_resources.accounts:
|
|
1146
|
+
group_resources.accounts = [acc for acc in group_resources.accounts if acc != asset_holding["account"]]
|
|
1147
|
+
if group_resources.assets:
|
|
1148
|
+
group_resources.assets = [
|
|
1149
|
+
asset for asset in group_resources.assets if int(asset) != int(asset_holding["asset"])
|
|
1136
1150
|
]
|
|
1137
1151
|
|
|
1138
1152
|
# Handle remaining resources
|
|
1139
|
-
for account in group_resources.
|
|
1153
|
+
for account in group_resources.accounts or []:
|
|
1140
1154
|
populate_group_resource(group, account, "account")
|
|
1141
1155
|
|
|
1142
|
-
for box in group_resources.
|
|
1156
|
+
for box in group_resources.boxes or []:
|
|
1143
1157
|
populate_group_resource(group, box, "box")
|
|
1144
|
-
if
|
|
1145
|
-
group_resources
|
|
1158
|
+
if group_resources.apps:
|
|
1159
|
+
group_resources.apps = [app for app in group_resources.apps if int(app) != int(box["app"])]
|
|
1146
1160
|
|
|
1147
|
-
for asset in group_resources.
|
|
1161
|
+
for asset in group_resources.assets or []:
|
|
1148
1162
|
populate_group_resource(group, asset, "asset")
|
|
1149
1163
|
|
|
1150
|
-
for app in group_resources.
|
|
1164
|
+
for app in group_resources.apps or []:
|
|
1151
1165
|
populate_group_resource(group, app, "app")
|
|
1152
1166
|
|
|
1153
1167
|
# Handle extra box references
|
|
1154
|
-
extra_box_refs = group_resources.
|
|
1168
|
+
extra_box_refs = group_resources.extra_box_refs or 0
|
|
1155
1169
|
for _ in range(extra_box_refs):
|
|
1156
1170
|
populate_group_resource(group, {"app": 0, "name": ""}, "box")
|
|
1157
1171
|
|
|
@@ -2111,18 +2125,24 @@ class TransactionComposer:
|
|
|
2111
2125
|
if not sdk_params["approval_program"] or not sdk_params["clear_program"]:
|
|
2112
2126
|
raise ValueError("approval_program and clear_program are required for application creation")
|
|
2113
2127
|
|
|
2114
|
-
|
|
2115
|
-
|
|
2128
|
+
schema = params.schema
|
|
2129
|
+
if not schema:
|
|
2130
|
+
schema = AppCreateSchema(
|
|
2131
|
+
global_ints=0,
|
|
2132
|
+
global_byte_slices=0,
|
|
2133
|
+
local_ints=0,
|
|
2134
|
+
local_byte_slices=0,
|
|
2135
|
+
)
|
|
2116
2136
|
|
|
2117
2137
|
txn_params = {
|
|
2118
2138
|
**txn_params,
|
|
2119
2139
|
"global_schema": algosdk.transaction.StateSchema(
|
|
2120
|
-
num_uints=
|
|
2121
|
-
num_byte_slices=
|
|
2140
|
+
num_uints=schema["global_ints"],
|
|
2141
|
+
num_byte_slices=schema["global_byte_slices"],
|
|
2122
2142
|
),
|
|
2123
2143
|
"local_schema": algosdk.transaction.StateSchema(
|
|
2124
|
-
num_uints=
|
|
2125
|
-
num_byte_slices=
|
|
2144
|
+
num_uints=schema["local_ints"],
|
|
2145
|
+
num_byte_slices=schema["local_byte_slices"],
|
|
2126
2146
|
),
|
|
2127
2147
|
"extra_pages": params.extra_program_pages
|
|
2128
2148
|
or calculate_extra_program_pages(approval_program, clear_program),
|
|
@@ -14,14 +14,14 @@ algokit_utils/_legacy_v2/models.py,sha256=hH7aO50E4po4EgxXI9zdX5HTthn1HLfSLvkuPf
|
|
|
14
14
|
algokit_utils/_legacy_v2/network_clients.py,sha256=5nqC-47hreWvMxR-PQWs_QP44wJDAGhtS1MQv8JQ82o,5660
|
|
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=-yjs3ep_FpPHS8wHRmaYCnZdq_aSK6iAYuahxr0uPHY,39665
|
|
18
18
|
algokit_utils/accounts/kmd_account_manager.py,sha256=0flsU5T11JciyL0YvOKDHPVSm-ghV0RjJAbtm8JwrhU,6476
|
|
19
19
|
algokit_utils/algorand.py,sha256=Gtx3vspZmSxUrNWmh09NFQB24G4v4CEogYuRX_9o5Xw,10554
|
|
20
20
|
algokit_utils/application_client.py,sha256=5UIxXIBjukjRyjZPCeXmaNlAftbb3TziV7EfBolW79k,337
|
|
21
21
|
algokit_utils/application_specification.py,sha256=-ZM13Qv-AcLmwudJCq8xGPoWLvAvKBICgAdHeFozKbY,1416
|
|
22
22
|
algokit_utils/applications/__init__.py,sha256=NGjhpBeExsQZOAYCT2QUFag1xuKoFiX-Ux5SR2GNzd8,452
|
|
23
23
|
algokit_utils/applications/abi.py,sha256=IhrEUdg2kDzR4iU5_FzUDjlMIHO7Rfe-ibJ6z9CMUq8,10260
|
|
24
|
-
algokit_utils/applications/app_client.py,sha256=
|
|
24
|
+
algokit_utils/applications/app_client.py,sha256=TGMngl7BNLvMlMt3lsREEQrI0C1-jl4IhYqVNr2oG7g,85191
|
|
25
25
|
algokit_utils/applications/app_deployer.py,sha256=MD7RIvh6Z6dFr9sx8dP5nP1DzSEbwz-vX-Exz_CwoN4,24740
|
|
26
26
|
algokit_utils/applications/app_factory.py,sha256=wljyXuXWaMc3KJkDeACJ5XVEfIsVxeSXqdGTJ9p3tJQ,33425
|
|
27
27
|
algokit_utils/applications/app_manager.py,sha256=EA1uRtmvPVAdKi1I5HSCpHjIDgLN7eZcEPT0Cj3C7fU,17661
|
|
@@ -48,7 +48,7 @@ algokit_utils/errors/__init__.py,sha256=CmuiLVjzMAOYxPaIIwmYCNArsso_RtS2ssFoNdp5
|
|
|
48
48
|
algokit_utils/errors/logic_error.py,sha256=uxqUOU9-D1R5TrKturCbmmWRVlB024Ca4CfVi8x_sgo,4104
|
|
49
49
|
algokit_utils/logic_error.py,sha256=3duw-l6tBr-DeapO0e0tYHoa9rOxP-QZZ6QWmN8L9tc,305
|
|
50
50
|
algokit_utils/models/__init__.py,sha256=0aB_c5pnkqKl1Z0hkxM9qbKn2qVdizZE2DvziN9ObqM,465
|
|
51
|
-
algokit_utils/models/account.py,sha256=
|
|
51
|
+
algokit_utils/models/account.py,sha256=eqGJvExzd7gDm3--DBDaIq6pJarxMPHZ-UySxZ9Qznk,6778
|
|
52
52
|
algokit_utils/models/amount.py,sha256=PcjzqRY5ThcUuSYHk1yeYgUooos1j2-54hBIJJcipd4,7567
|
|
53
53
|
algokit_utils/models/application.py,sha256=lM2_g5kZ18k_zyVzcbGvkvqHzksfb2sgRqowJ3pvUgo,1288
|
|
54
54
|
algokit_utils/models/network.py,sha256=3QNcZ9jVmckv3CCxrD2Y1jiwBdBGdaaziiRgOpsqhwI,904
|
|
@@ -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=S9GrGDCTg0JJa4HbcTVbGAsV_qAHW2xWNiT9olo6_tk,96058
|
|
65
65
|
algokit_utils/transactions/transaction_creator.py,sha256=A1YHeGC2EkR2V0HPYJiXVOAEIrfjBW2KVyYgi3exm4E,6167
|
|
66
66
|
algokit_utils/transactions/transaction_sender.py,sha256=uQmHElJgUIxLXfdklMNoabjQQzUku8CFP82wwhfr44E,22769
|
|
67
|
-
algokit_utils-3.0.
|
|
68
|
-
algokit_utils-3.0.
|
|
69
|
-
algokit_utils-3.0.
|
|
70
|
-
algokit_utils-3.0.
|
|
67
|
+
algokit_utils-3.0.0b9.dist-info/LICENSE,sha256=J5i7U1Q9Q2c7saUzlvFRmrCCFhQyXb5Juz_LO5omNUw,1076
|
|
68
|
+
algokit_utils-3.0.0b9.dist-info/METADATA,sha256=98lFs0a_MbLQwVSjyx-jrxYeIU_Juzr_B7ZxhdhhnsM,2420
|
|
69
|
+
algokit_utils-3.0.0b9.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
|
70
|
+
algokit_utils-3.0.0b9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|