algokit-utils 3.0.0b10__py3-none-any.whl → 3.0.0b11__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/_legacy_v2/_ensure_funded.py +3 -7
- algokit_utils/_legacy_v2/_transfer.py +5 -2
- algokit_utils/_legacy_v2/account.py +5 -5
- algokit_utils/_legacy_v2/deploy.py +1 -1
- algokit_utils/_legacy_v2/network_clients.py +10 -6
- algokit_utils/accounts/account_manager.py +71 -67
- algokit_utils/algorand.py +105 -11
- algokit_utils/application_specification.py +1 -1
- algokit_utils/applications/abi.py +8 -12
- algokit_utils/applications/app_client.py +132 -44
- algokit_utils/applications/app_deployer.py +93 -2
- algokit_utils/applications/app_factory.py +315 -1
- algokit_utils/applications/app_manager.py +110 -2
- algokit_utils/applications/app_spec/arc56.py +131 -190
- algokit_utils/assets/asset_manager.py +47 -31
- algokit_utils/clients/client_manager.py +76 -0
- algokit_utils/clients/dispenser_api_client.py +32 -3
- algokit_utils/models/application.py +30 -0
- algokit_utils/models/state.py +9 -0
- algokit_utils/transactions/transaction_composer.py +366 -182
- algokit_utils/transactions/transaction_creator.py +550 -18
- algokit_utils/transactions/transaction_sender.py +645 -0
- {algokit_utils-3.0.0b10.dist-info → algokit_utils-3.0.0b11.dist-info}/METADATA +1 -1
- {algokit_utils-3.0.0b10.dist-info → algokit_utils-3.0.0b11.dist-info}/RECORD +26 -26
- {algokit_utils-3.0.0b10.dist-info → algokit_utils-3.0.0b11.dist-info}/WHEEL +1 -1
- {algokit_utils-3.0.0b10.dist-info → algokit_utils-3.0.0b11.dist-info}/LICENSE +0 -0
|
@@ -85,393 +85,374 @@ MAX_APP_CALL_ACCOUNT_REFERENCES = 4
|
|
|
85
85
|
@dataclass(kw_only=True, frozen=True)
|
|
86
86
|
class _CommonTxnParams:
|
|
87
87
|
sender: str
|
|
88
|
+
"""The account that will send the transaction"""
|
|
88
89
|
signer: TransactionSigner | TransactionSignerAccountProtocol | None = None
|
|
90
|
+
"""The signer for the transaction, defaults to None"""
|
|
89
91
|
rekey_to: str | None = None
|
|
92
|
+
"""The account to rekey to, defaults to None"""
|
|
90
93
|
note: bytes | None = None
|
|
94
|
+
"""The note for the transaction, defaults to None"""
|
|
91
95
|
lease: bytes | None = None
|
|
96
|
+
"""The lease for the transaction, defaults to None"""
|
|
92
97
|
static_fee: AlgoAmount | None = None
|
|
98
|
+
"""The static fee for the transaction, defaults to None"""
|
|
93
99
|
extra_fee: AlgoAmount | None = None
|
|
100
|
+
"""The extra fee for the transaction, defaults to None"""
|
|
94
101
|
max_fee: AlgoAmount | None = None
|
|
102
|
+
"""The maximum fee for the transaction, defaults to None"""
|
|
95
103
|
validity_window: int | None = None
|
|
104
|
+
"""The validity window for the transaction, defaults to None"""
|
|
96
105
|
first_valid_round: int | None = None
|
|
106
|
+
"""The first valid round for the transaction, defaults to None"""
|
|
97
107
|
last_valid_round: int | None = None
|
|
108
|
+
"""The last valid round for the transaction, defaults to None"""
|
|
98
109
|
|
|
99
110
|
|
|
100
111
|
@dataclass(kw_only=True, frozen=True)
|
|
101
112
|
class AdditionalAtcContext:
|
|
102
113
|
max_fees: dict[int, AlgoAmount] | None = None
|
|
114
|
+
"""The maximum fees for each transaction, defaults to None"""
|
|
103
115
|
suggested_params: SuggestedParams | None = None
|
|
116
|
+
"""The suggested parameters for the transaction, defaults to None"""
|
|
104
117
|
|
|
105
118
|
|
|
106
119
|
@dataclass(kw_only=True, frozen=True)
|
|
107
120
|
class PaymentParams(_CommonTxnParams):
|
|
108
|
-
"""Parameters for a payment transaction.
|
|
109
|
-
|
|
110
|
-
:ivar receiver: The account that will receive the ALGO
|
|
111
|
-
:ivar amount: Amount to send
|
|
112
|
-
:ivar close_remainder_to: If given, close the sender account and send the remaining balance to this address,
|
|
113
|
-
defaults to None
|
|
114
|
-
"""
|
|
121
|
+
"""Parameters for a payment transaction."""
|
|
115
122
|
|
|
116
123
|
receiver: str
|
|
124
|
+
"""The account that will receive the ALGO"""
|
|
117
125
|
amount: AlgoAmount
|
|
126
|
+
"""Amount to send"""
|
|
118
127
|
close_remainder_to: str | None = None
|
|
128
|
+
"""If given, close the sender account and send the remaining balance to this address, defaults to None"""
|
|
119
129
|
|
|
120
130
|
|
|
121
131
|
@dataclass(kw_only=True, frozen=True)
|
|
122
132
|
class AssetCreateParams(_CommonTxnParams):
|
|
123
|
-
"""Parameters for creating a new asset.
|
|
124
|
-
|
|
125
|
-
:ivar total: The total amount of the smallest divisible unit to create
|
|
126
|
-
:ivar decimals: The amount of decimal places the asset should have, defaults to None
|
|
127
|
-
:ivar default_frozen: Whether the asset is frozen by default in the creator address, defaults to None
|
|
128
|
-
:ivar manager: The address that can change the manager, reserve, clawback, and freeze addresses, defaults to None
|
|
129
|
-
:ivar reserve: The address that holds the uncirculated supply, defaults to None
|
|
130
|
-
:ivar freeze: The address that can freeze the asset in any account, defaults to None
|
|
131
|
-
:ivar clawback: The address that can clawback the asset from any account, defaults to None
|
|
132
|
-
:ivar unit_name: The short ticker name for the asset, defaults to None
|
|
133
|
-
:ivar asset_name: The full name of the asset, defaults to None
|
|
134
|
-
:ivar url: The metadata URL for the asset, defaults to None
|
|
135
|
-
:ivar metadata_hash: Hash of the metadata contained in the metadata URL, defaults to None
|
|
136
|
-
"""
|
|
133
|
+
"""Parameters for creating a new asset."""
|
|
137
134
|
|
|
138
135
|
total: int
|
|
136
|
+
"""The total amount of the smallest divisible unit to create"""
|
|
139
137
|
asset_name: str | None = None
|
|
138
|
+
"""The full name of the asset"""
|
|
140
139
|
unit_name: str | None = None
|
|
140
|
+
"""The short ticker name for the asset"""
|
|
141
141
|
url: str | None = None
|
|
142
|
+
"""The metadata URL for the asset"""
|
|
142
143
|
decimals: int | None = None
|
|
144
|
+
"""The amount of decimal places the asset should have"""
|
|
143
145
|
default_frozen: bool | None = None
|
|
146
|
+
"""Whether the asset is frozen by default in the creator address"""
|
|
144
147
|
manager: str | None = None
|
|
148
|
+
"""The address that can change the manager, reserve, clawback, and freeze addresses"""
|
|
145
149
|
reserve: str | None = None
|
|
150
|
+
"""The address that holds the uncirculated supply"""
|
|
146
151
|
freeze: str | None = None
|
|
152
|
+
"""The address that can freeze the asset in any account"""
|
|
147
153
|
clawback: str | None = None
|
|
154
|
+
"""The address that can clawback the asset from any account"""
|
|
148
155
|
metadata_hash: bytes | None = None
|
|
156
|
+
"""Hash of the metadata contained in the metadata URL"""
|
|
149
157
|
|
|
150
158
|
|
|
151
159
|
@dataclass(kw_only=True, frozen=True)
|
|
152
160
|
class AssetConfigParams(_CommonTxnParams):
|
|
153
|
-
"""Parameters for configuring an existing asset.
|
|
154
|
-
|
|
155
|
-
:ivar asset_id: ID of the asset
|
|
156
|
-
:ivar manager: The address that can change the manager, reserve, clawback, and freeze addresses, defaults to None
|
|
157
|
-
:ivar reserve: The address that holds the uncirculated supply, defaults to None
|
|
158
|
-
:ivar freeze: The address that can freeze the asset in any account, defaults to None
|
|
159
|
-
:ivar clawback: The address that can clawback the asset from any account, defaults to None
|
|
160
|
-
"""
|
|
161
|
+
"""Parameters for configuring an existing asset."""
|
|
161
162
|
|
|
162
163
|
asset_id: int
|
|
164
|
+
"""The ID of the asset"""
|
|
163
165
|
manager: str | None = None
|
|
166
|
+
"""The address that can change the manager, reserve, clawback, and freeze addresses, defaults to None"""
|
|
164
167
|
reserve: str | None = None
|
|
168
|
+
"""The address that holds the uncirculated supply, defaults to None"""
|
|
165
169
|
freeze: str | None = None
|
|
170
|
+
"""The address that can freeze the asset in any account, defaults to None"""
|
|
166
171
|
clawback: str | None = None
|
|
172
|
+
"""The address that can clawback the asset from any account, defaults to None"""
|
|
167
173
|
|
|
168
174
|
|
|
169
175
|
@dataclass(kw_only=True, frozen=True)
|
|
170
176
|
class AssetFreezeParams(_CommonTxnParams):
|
|
171
|
-
"""Parameters for freezing an asset.
|
|
172
|
-
|
|
173
|
-
:ivar asset_id: The ID of the asset
|
|
174
|
-
:ivar account: The account to freeze or unfreeze
|
|
175
|
-
:ivar frozen: Whether the assets in the account should be frozen
|
|
176
|
-
"""
|
|
177
|
+
"""Parameters for freezing an asset."""
|
|
177
178
|
|
|
178
179
|
asset_id: int
|
|
180
|
+
"""The ID of the asset"""
|
|
179
181
|
account: str
|
|
182
|
+
"""The account to freeze or unfreeze"""
|
|
180
183
|
frozen: bool
|
|
184
|
+
"""Whether the assets in the account should be frozen"""
|
|
181
185
|
|
|
182
186
|
|
|
183
187
|
@dataclass(kw_only=True, frozen=True)
|
|
184
188
|
class AssetDestroyParams(_CommonTxnParams):
|
|
185
|
-
"""Parameters for destroying an asset.
|
|
186
|
-
|
|
187
|
-
:ivar asset_id: ID of the asset
|
|
188
|
-
"""
|
|
189
|
+
"""Parameters for destroying an asset."""
|
|
189
190
|
|
|
190
191
|
asset_id: int
|
|
192
|
+
"""The ID of the asset"""
|
|
191
193
|
|
|
192
194
|
|
|
193
195
|
@dataclass(kw_only=True, frozen=True)
|
|
194
196
|
class OnlineKeyRegistrationParams(_CommonTxnParams):
|
|
195
|
-
"""Parameters for online key registration.
|
|
196
|
-
|
|
197
|
-
:ivar vote_key: The root participation public key
|
|
198
|
-
:ivar selection_key: The VRF public key
|
|
199
|
-
:ivar vote_first: The first round that the participation key is valid
|
|
200
|
-
:ivar vote_last: The last round that the participation key is valid
|
|
201
|
-
:ivar vote_key_dilution: The dilution for the 2-level participation key
|
|
202
|
-
:ivar state_proof_key: The 64 byte state proof public key commitment, defaults to None
|
|
203
|
-
"""
|
|
197
|
+
"""Parameters for online key registration."""
|
|
204
198
|
|
|
205
199
|
vote_key: str
|
|
200
|
+
"""The root participation public key"""
|
|
206
201
|
selection_key: str
|
|
202
|
+
"""The VRF public key"""
|
|
207
203
|
vote_first: int
|
|
204
|
+
"""The first round that the participation key is valid"""
|
|
208
205
|
vote_last: int
|
|
206
|
+
"""The last round that the participation key is valid"""
|
|
209
207
|
vote_key_dilution: int
|
|
208
|
+
"""The dilution for the 2-level participation key"""
|
|
210
209
|
state_proof_key: bytes | None = None
|
|
210
|
+
"""The 64 byte state proof public key commitment, defaults to None"""
|
|
211
211
|
|
|
212
212
|
|
|
213
213
|
@dataclass(kw_only=True, frozen=True)
|
|
214
214
|
class OfflineKeyRegistrationParams(_CommonTxnParams):
|
|
215
|
-
"""Parameters for offline key registration.
|
|
216
|
-
|
|
217
|
-
:ivar prevent_account_from_ever_participating_again: Whether to prevent the account from ever participating again
|
|
218
|
-
"""
|
|
215
|
+
"""Parameters for offline key registration."""
|
|
219
216
|
|
|
220
217
|
prevent_account_from_ever_participating_again: bool
|
|
218
|
+
"""Whether to prevent the account from ever participating again"""
|
|
221
219
|
|
|
222
220
|
|
|
223
221
|
@dataclass(kw_only=True, frozen=True)
|
|
224
222
|
class AssetTransferParams(_CommonTxnParams):
|
|
225
|
-
"""Parameters for transferring an asset.
|
|
226
|
-
|
|
227
|
-
:ivar asset_id: ID of the asset
|
|
228
|
-
:ivar amount: Amount of the asset to transfer (smallest divisible unit)
|
|
229
|
-
:ivar receiver: The account to send the asset to
|
|
230
|
-
:ivar clawback_target: The account to take the asset from, defaults to None
|
|
231
|
-
:ivar close_asset_to: The account to close the asset to, defaults to None
|
|
232
|
-
"""
|
|
223
|
+
"""Parameters for transferring an asset."""
|
|
233
224
|
|
|
234
225
|
asset_id: int
|
|
226
|
+
"""The ID of the asset"""
|
|
235
227
|
amount: int
|
|
228
|
+
"""The amount of the asset to transfer (smallest divisible unit)"""
|
|
236
229
|
receiver: str
|
|
230
|
+
"""The account to send the asset to"""
|
|
237
231
|
clawback_target: str | None = None
|
|
232
|
+
"""The account to take the asset from, defaults to None"""
|
|
238
233
|
close_asset_to: str | None = None
|
|
234
|
+
"""The account to close the asset to, defaults to None"""
|
|
239
235
|
|
|
240
236
|
|
|
241
237
|
@dataclass(kw_only=True, frozen=True)
|
|
242
238
|
class AssetOptInParams(_CommonTxnParams):
|
|
243
|
-
"""Parameters for opting into an asset.
|
|
244
|
-
|
|
245
|
-
:ivar asset_id: ID of the asset
|
|
246
|
-
"""
|
|
239
|
+
"""Parameters for opting into an asset."""
|
|
247
240
|
|
|
248
241
|
asset_id: int
|
|
242
|
+
"""The ID of the asset"""
|
|
249
243
|
|
|
250
244
|
|
|
251
245
|
@dataclass(kw_only=True, frozen=True)
|
|
252
246
|
class AssetOptOutParams(_CommonTxnParams):
|
|
253
|
-
"""Parameters for opting out of an asset.
|
|
254
|
-
|
|
255
|
-
:ivar asset_id: ID of the asset
|
|
256
|
-
:ivar creator: The creator address of the asset
|
|
257
|
-
"""
|
|
247
|
+
"""Parameters for opting out of an asset."""
|
|
258
248
|
|
|
259
249
|
asset_id: int
|
|
250
|
+
"""The ID of the asset"""
|
|
260
251
|
creator: str
|
|
252
|
+
"""The creator address of the asset"""
|
|
261
253
|
|
|
262
254
|
|
|
263
255
|
@dataclass(kw_only=True, frozen=True)
|
|
264
256
|
class AppCallParams(_CommonTxnParams):
|
|
265
|
-
"""Parameters for calling an application.
|
|
266
|
-
|
|
267
|
-
:ivar on_complete: The OnComplete action
|
|
268
|
-
:ivar app_id: ID of the application, defaults to None
|
|
269
|
-
:ivar approval_program: The program to execute for all OnCompletes other than ClearState, defaults to None
|
|
270
|
-
:ivar clear_state_program: The program to execute for ClearState OnComplete, defaults to None
|
|
271
|
-
:ivar schema: The state schema for the app. This is immutable, defaults to None
|
|
272
|
-
:ivar args: Application arguments, defaults to None
|
|
273
|
-
:ivar account_references: Account references, defaults to None
|
|
274
|
-
:ivar app_references: App references, defaults to None
|
|
275
|
-
:ivar asset_references: Asset references, defaults to None
|
|
276
|
-
:ivar extra_pages: Number of extra pages required for the programs, defaults to None
|
|
277
|
-
:ivar box_references: Box references, defaults to None
|
|
278
|
-
"""
|
|
257
|
+
"""Parameters for calling an application."""
|
|
279
258
|
|
|
280
259
|
on_complete: OnComplete
|
|
260
|
+
"""The OnComplete action, defaults to None"""
|
|
281
261
|
app_id: int | None = None
|
|
262
|
+
"""The ID of the application, defaults to None"""
|
|
282
263
|
approval_program: str | bytes | None = None
|
|
264
|
+
"""The program to execute for all OnCompletes other than ClearState, defaults to None"""
|
|
283
265
|
clear_state_program: str | bytes | None = None
|
|
266
|
+
"""The program to execute for ClearState OnComplete, defaults to None"""
|
|
284
267
|
schema: dict[str, int] | None = None
|
|
268
|
+
"""The state schema for the app, defaults to None"""
|
|
285
269
|
args: list[bytes] | None = None
|
|
270
|
+
"""Application arguments, defaults to None"""
|
|
286
271
|
account_references: list[str] | None = None
|
|
272
|
+
"""Account references, defaults to None"""
|
|
287
273
|
app_references: list[int] | None = None
|
|
274
|
+
"""App references, defaults to None"""
|
|
288
275
|
asset_references: list[int] | None = None
|
|
276
|
+
"""Asset references, defaults to None"""
|
|
289
277
|
extra_pages: int | None = None
|
|
278
|
+
"""Number of extra pages required for the programs, defaults to None"""
|
|
290
279
|
box_references: list[BoxReference | BoxIdentifier] | None = None
|
|
280
|
+
"""Box references, defaults to None"""
|
|
291
281
|
|
|
292
282
|
|
|
293
283
|
class AppCreateSchema(TypedDict):
|
|
294
284
|
global_ints: int
|
|
285
|
+
"""The number of global ints in the schema"""
|
|
295
286
|
global_byte_slices: int
|
|
287
|
+
"""The number of global byte slices in the schema"""
|
|
296
288
|
local_ints: int
|
|
289
|
+
"""The number of local ints in the schema"""
|
|
297
290
|
local_byte_slices: int
|
|
291
|
+
"""The number of local byte slices in the schema"""
|
|
298
292
|
|
|
299
293
|
|
|
300
294
|
@dataclass(kw_only=True, frozen=True)
|
|
301
295
|
class AppCreateParams(_CommonTxnParams):
|
|
302
|
-
"""Parameters for creating an application.
|
|
303
|
-
|
|
304
|
-
:ivar approval_program: The program to execute for all OnCompletes other than ClearState as raw teal (string)
|
|
305
|
-
or compiled teal (bytes)
|
|
306
|
-
:ivar clear_state_program: The program to execute for ClearState OnComplete as raw teal (string)
|
|
307
|
-
or compiled teal (bytes)
|
|
308
|
-
:ivar schema: The state schema for the app. This is immutable, defaults to None
|
|
309
|
-
:ivar on_complete: The OnComplete action (cannot be ClearState), defaults to None
|
|
310
|
-
:ivar args: Application arguments, defaults to None
|
|
311
|
-
:ivar account_references: Account references, defaults to None
|
|
312
|
-
:ivar app_references: App references, defaults to None
|
|
313
|
-
:ivar asset_references: Asset references, defaults to None
|
|
314
|
-
:ivar box_references: Box references, defaults to None
|
|
315
|
-
:ivar extra_program_pages: Number of extra pages required for the programs, defaults to None
|
|
316
|
-
"""
|
|
296
|
+
"""Parameters for creating an application."""
|
|
317
297
|
|
|
318
298
|
approval_program: str | bytes
|
|
299
|
+
"""The program to execute for all OnCompletes other than ClearState"""
|
|
319
300
|
clear_state_program: str | bytes
|
|
301
|
+
"""The program to execute for ClearState OnComplete"""
|
|
320
302
|
schema: AppCreateSchema | None = None
|
|
303
|
+
"""The state schema for the app, defaults to None"""
|
|
321
304
|
on_complete: OnComplete | None = None
|
|
305
|
+
"""The OnComplete action, defaults to None"""
|
|
322
306
|
args: list[bytes] | None = None
|
|
307
|
+
"""Application arguments, defaults to None"""
|
|
323
308
|
account_references: list[str] | None = None
|
|
309
|
+
"""Account references, defaults to None"""
|
|
324
310
|
app_references: list[int] | None = None
|
|
311
|
+
"""App references, defaults to None"""
|
|
325
312
|
asset_references: list[int] | None = None
|
|
313
|
+
"""Asset references, defaults to None"""
|
|
326
314
|
box_references: list[BoxReference | BoxIdentifier] | None = None
|
|
315
|
+
"""Box references, defaults to None"""
|
|
327
316
|
extra_program_pages: int | None = None
|
|
317
|
+
"""Number of extra pages required for the programs, defaults to None"""
|
|
328
318
|
|
|
329
319
|
|
|
330
320
|
@dataclass(kw_only=True, frozen=True)
|
|
331
321
|
class AppUpdateParams(_CommonTxnParams):
|
|
332
|
-
"""Parameters for updating an application.
|
|
333
|
-
|
|
334
|
-
:ivar app_id: ID of the application
|
|
335
|
-
:ivar approval_program: The program to execute for all OnCompletes other than ClearState as raw teal (string)
|
|
336
|
-
or compiled teal (bytes)
|
|
337
|
-
:ivar clear_state_program: The program to execute for ClearState OnComplete as raw teal (string)
|
|
338
|
-
or compiled teal (bytes)
|
|
339
|
-
:ivar args: Application arguments, defaults to None
|
|
340
|
-
:ivar account_references: Account references, defaults to None
|
|
341
|
-
:ivar app_references: App references, defaults to None
|
|
342
|
-
:ivar asset_references: Asset references, defaults to None
|
|
343
|
-
:ivar box_references: Box references, defaults to None
|
|
344
|
-
:ivar on_complete: The OnComplete action, defaults to None
|
|
345
|
-
"""
|
|
322
|
+
"""Parameters for updating an application."""
|
|
346
323
|
|
|
347
324
|
app_id: int
|
|
325
|
+
"""The ID of the application"""
|
|
348
326
|
approval_program: str | bytes
|
|
327
|
+
"""The program to execute for all OnCompletes other than ClearState"""
|
|
349
328
|
clear_state_program: str | bytes
|
|
329
|
+
"""The program to execute for ClearState OnComplete"""
|
|
350
330
|
args: list[bytes] | None = None
|
|
331
|
+
"""Application arguments, defaults to None"""
|
|
351
332
|
account_references: list[str] | None = None
|
|
333
|
+
"""Account references, defaults to None"""
|
|
352
334
|
app_references: list[int] | None = None
|
|
335
|
+
"""App references, defaults to None"""
|
|
353
336
|
asset_references: list[int] | None = None
|
|
337
|
+
"""Asset references, defaults to None"""
|
|
354
338
|
box_references: list[BoxReference | BoxIdentifier] | None = None
|
|
339
|
+
"""Box references, defaults to None"""
|
|
355
340
|
on_complete: OnComplete | None = None
|
|
341
|
+
"""The OnComplete action, defaults to None"""
|
|
356
342
|
|
|
357
343
|
|
|
358
344
|
@dataclass(kw_only=True, frozen=True)
|
|
359
345
|
class AppDeleteParams(_CommonTxnParams):
|
|
360
|
-
"""Parameters for deleting an application.
|
|
361
|
-
|
|
362
|
-
:ivar app_id: ID of the application
|
|
363
|
-
:ivar args: Application arguments, defaults to None
|
|
364
|
-
:ivar account_references: Account references, defaults to None
|
|
365
|
-
:ivar app_references: App references, defaults to None
|
|
366
|
-
:ivar asset_references: Asset references, defaults to None
|
|
367
|
-
:ivar box_references: Box references, defaults to None
|
|
368
|
-
:ivar on_complete: The OnComplete action, defaults to DeleteApplicationOC
|
|
369
|
-
"""
|
|
346
|
+
"""Parameters for deleting an application."""
|
|
370
347
|
|
|
371
348
|
app_id: int
|
|
349
|
+
"""The ID of the application"""
|
|
372
350
|
args: list[bytes] | None = None
|
|
351
|
+
"""Application arguments, defaults to None"""
|
|
373
352
|
account_references: list[str] | None = None
|
|
353
|
+
"""Account references, defaults to None"""
|
|
374
354
|
app_references: list[int] | None = None
|
|
355
|
+
"""App references, defaults to None"""
|
|
375
356
|
asset_references: list[int] | None = None
|
|
357
|
+
"""Asset references, defaults to None"""
|
|
376
358
|
box_references: list[BoxReference | BoxIdentifier] | None = None
|
|
359
|
+
"""Box references, defaults to None"""
|
|
377
360
|
on_complete: OnComplete = OnComplete.DeleteApplicationOC
|
|
361
|
+
"""The OnComplete action, defaults to DeleteApplicationOC"""
|
|
378
362
|
|
|
379
363
|
|
|
380
364
|
@dataclass(kw_only=True, frozen=True)
|
|
381
365
|
class _BaseAppMethodCall(_CommonTxnParams):
|
|
382
366
|
app_id: int
|
|
367
|
+
"""The ID of the application"""
|
|
383
368
|
method: Method
|
|
369
|
+
"""The ABI method to call"""
|
|
384
370
|
args: list | None = None
|
|
371
|
+
"""Arguments to the ABI method, defaults to None"""
|
|
385
372
|
account_references: list[str] | None = None
|
|
373
|
+
"""Account references, defaults to None"""
|
|
386
374
|
app_references: list[int] | None = None
|
|
375
|
+
"""App references, defaults to None"""
|
|
387
376
|
asset_references: list[int] | None = None
|
|
377
|
+
"""Asset references, defaults to None"""
|
|
388
378
|
box_references: list[BoxReference | BoxIdentifier] | None = None
|
|
379
|
+
"""Box references, defaults to None"""
|
|
389
380
|
schema: AppCreateSchema | None = None
|
|
381
|
+
"""The state schema for the app, defaults to None"""
|
|
382
|
+
on_complete: OnComplete | None = None
|
|
383
|
+
"""The OnComplete action, defaults to None"""
|
|
390
384
|
|
|
391
385
|
|
|
392
386
|
@dataclass(kw_only=True, frozen=True)
|
|
393
387
|
class AppMethodCallParams(_CommonTxnParams):
|
|
394
|
-
"""Parameters for calling an application method.
|
|
395
|
-
|
|
396
|
-
:ivar app_id: ID of the application
|
|
397
|
-
:ivar method: The ABI method to call
|
|
398
|
-
:ivar args: Arguments to the ABI method, defaults to None
|
|
399
|
-
:ivar on_complete: The OnComplete action (cannot be UpdateApplication or ClearState), defaults to None
|
|
400
|
-
:ivar account_references: Account references, defaults to None
|
|
401
|
-
:ivar app_references: App references, defaults to None
|
|
402
|
-
:ivar asset_references: Asset references, defaults to None
|
|
403
|
-
:ivar box_references: Box references, defaults to None
|
|
404
|
-
"""
|
|
388
|
+
"""Parameters for calling an application method."""
|
|
405
389
|
|
|
406
390
|
app_id: int
|
|
391
|
+
"""The ID of the application"""
|
|
407
392
|
method: Method
|
|
393
|
+
"""The ABI method to call"""
|
|
408
394
|
args: list[bytes] | None = None
|
|
395
|
+
"""Arguments to the ABI method, defaults to None"""
|
|
409
396
|
on_complete: OnComplete | None = None
|
|
397
|
+
"""The OnComplete action, defaults to None"""
|
|
410
398
|
account_references: list[str] | None = None
|
|
399
|
+
"""Account references, defaults to None"""
|
|
411
400
|
app_references: list[int] | None = None
|
|
401
|
+
"""App references, defaults to None"""
|
|
412
402
|
asset_references: list[int] | None = None
|
|
403
|
+
"""Asset references, defaults to None"""
|
|
413
404
|
box_references: list[BoxReference | BoxIdentifier] | None = None
|
|
405
|
+
"""Box references, defaults to None"""
|
|
414
406
|
|
|
415
407
|
|
|
416
408
|
@dataclass(kw_only=True, frozen=True)
|
|
417
409
|
class AppCallMethodCallParams(_BaseAppMethodCall):
|
|
418
|
-
"""Parameters for a regular ABI method call.
|
|
419
|
-
|
|
420
|
-
:ivar app_id: ID of the application
|
|
421
|
-
:ivar method: The ABI method to call
|
|
422
|
-
:ivar args: Arguments to the ABI method, either an ABI value, transaction with explicit signer,
|
|
423
|
-
transaction, another method call, or None
|
|
424
|
-
:ivar on_complete: The OnComplete action (cannot be UpdateApplication or ClearState), defaults to None
|
|
425
|
-
"""
|
|
410
|
+
"""Parameters for a regular ABI method call."""
|
|
426
411
|
|
|
427
412
|
app_id: int
|
|
413
|
+
"""The ID of the application"""
|
|
428
414
|
on_complete: OnComplete | None = None
|
|
415
|
+
"""The OnComplete action, defaults to None"""
|
|
429
416
|
|
|
430
417
|
|
|
431
418
|
@dataclass(kw_only=True, frozen=True)
|
|
432
419
|
class AppCreateMethodCallParams(_BaseAppMethodCall):
|
|
433
|
-
"""Parameters for an ABI method call that creates an application.
|
|
434
|
-
|
|
435
|
-
:ivar approval_program: The program to execute for all OnCompletes other than ClearState
|
|
436
|
-
:ivar clear_state_program: The program to execute for ClearState OnComplete
|
|
437
|
-
:ivar schema: The state schema for the app, defaults to None
|
|
438
|
-
:ivar on_complete: The OnComplete action (cannot be ClearState), defaults to None
|
|
439
|
-
:ivar extra_program_pages: Number of extra pages required for the programs, defaults to None
|
|
440
|
-
"""
|
|
420
|
+
"""Parameters for an ABI method call that creates an application."""
|
|
441
421
|
|
|
442
422
|
approval_program: str | bytes
|
|
423
|
+
"""The program to execute for all OnCompletes other than ClearState"""
|
|
443
424
|
clear_state_program: str | bytes
|
|
425
|
+
"""The program to execute for ClearState OnComplete"""
|
|
444
426
|
schema: AppCreateSchema | None = None
|
|
427
|
+
"""The state schema for the app, defaults to None"""
|
|
445
428
|
on_complete: OnComplete | None = None
|
|
429
|
+
"""The OnComplete action (cannot be ClearState), defaults to None"""
|
|
446
430
|
extra_program_pages: int | None = None
|
|
431
|
+
"""Number of extra pages required for the programs, defaults to None"""
|
|
447
432
|
|
|
448
433
|
|
|
449
434
|
@dataclass(kw_only=True, frozen=True)
|
|
450
435
|
class AppUpdateMethodCallParams(_BaseAppMethodCall):
|
|
451
|
-
"""Parameters for an ABI method call that updates an application.
|
|
452
|
-
|
|
453
|
-
:ivar app_id: ID of the application
|
|
454
|
-
:ivar approval_program: The program to execute for all OnCompletes other than ClearState
|
|
455
|
-
:ivar clear_state_program: The program to execute for ClearState OnComplete
|
|
456
|
-
:ivar on_complete: The OnComplete action, defaults to UpdateApplicationOC
|
|
457
|
-
"""
|
|
436
|
+
"""Parameters for an ABI method call that updates an application."""
|
|
458
437
|
|
|
459
438
|
app_id: int
|
|
439
|
+
"""The ID of the application"""
|
|
460
440
|
approval_program: str | bytes
|
|
441
|
+
"""The program to execute for all OnCompletes other than ClearState"""
|
|
461
442
|
clear_state_program: str | bytes
|
|
443
|
+
"""The program to execute for ClearState OnComplete"""
|
|
462
444
|
on_complete: OnComplete = OnComplete.UpdateApplicationOC
|
|
445
|
+
"""The OnComplete action"""
|
|
463
446
|
|
|
464
447
|
|
|
465
448
|
@dataclass(kw_only=True, frozen=True)
|
|
466
449
|
class AppDeleteMethodCallParams(_BaseAppMethodCall):
|
|
467
|
-
"""Parameters for an ABI method call that deletes an application.
|
|
468
|
-
|
|
469
|
-
:ivar app_id: ID of the application
|
|
470
|
-
:ivar on_complete: The OnComplete action, defaults to DeleteApplicationOC
|
|
471
|
-
"""
|
|
450
|
+
"""Parameters for an ABI method call that deletes an application."""
|
|
472
451
|
|
|
473
452
|
app_id: int
|
|
453
|
+
"""The ID of the application"""
|
|
474
454
|
on_complete: OnComplete = OnComplete.DeleteApplicationOC
|
|
455
|
+
"""The OnComplete action"""
|
|
475
456
|
|
|
476
457
|
|
|
477
458
|
MethodCallParams = (
|
|
@@ -545,50 +526,44 @@ class TransactionWithSignerAndContext(TransactionWithSigner):
|
|
|
545
526
|
|
|
546
527
|
@dataclass(frozen=True)
|
|
547
528
|
class BuiltTransactions:
|
|
548
|
-
"""Set of transactions built by TransactionComposer.
|
|
549
|
-
|
|
550
|
-
:ivar transactions: The built transactions
|
|
551
|
-
:ivar method_calls: Any ABIMethod objects associated with any of the transactions in a map keyed by txn id
|
|
552
|
-
:ivar signers: Any TransactionSigner objects associated with any of the transactions in a map keyed by txn id
|
|
553
|
-
"""
|
|
529
|
+
"""Set of transactions built by TransactionComposer."""
|
|
554
530
|
|
|
555
531
|
transactions: list[algosdk.transaction.Transaction]
|
|
532
|
+
"""The built transactions"""
|
|
556
533
|
method_calls: dict[int, Method]
|
|
534
|
+
"""Map of transaction index to ABI method"""
|
|
557
535
|
signers: dict[int, TransactionSigner]
|
|
536
|
+
"""Map of transaction index to TransactionSigner"""
|
|
558
537
|
|
|
559
538
|
|
|
560
539
|
@dataclass
|
|
561
540
|
class TransactionComposerBuildResult:
|
|
562
|
-
"""Result of building transactions with TransactionComposer.
|
|
563
|
-
|
|
564
|
-
:ivar atc: The AtomicTransactionComposer instance
|
|
565
|
-
:ivar transactions: The list of transactions with signers
|
|
566
|
-
:ivar method_calls: Map of transaction index to ABI method
|
|
567
|
-
"""
|
|
541
|
+
"""Result of building transactions with TransactionComposer."""
|
|
568
542
|
|
|
569
543
|
atc: AtomicTransactionComposer
|
|
544
|
+
"""The AtomicTransactionComposer instance"""
|
|
570
545
|
transactions: list[TransactionWithSigner]
|
|
546
|
+
"""The list of transactions with signers"""
|
|
571
547
|
method_calls: dict[int, Method]
|
|
548
|
+
"""Map of transaction index to ABI method"""
|
|
572
549
|
|
|
573
550
|
|
|
574
551
|
@dataclass
|
|
575
552
|
class SendAtomicTransactionComposerResults:
|
|
576
|
-
"""Results from sending an AtomicTransactionComposer transaction group.
|
|
577
|
-
|
|
578
|
-
:ivar group_id: The group ID if this was a transaction group
|
|
579
|
-
:ivar confirmations: The confirmation info for each transaction
|
|
580
|
-
:ivar tx_ids: The transaction IDs that were sent
|
|
581
|
-
:ivar transactions: The transactions that were sent
|
|
582
|
-
:ivar returns: The ABI return values from any ABI method calls
|
|
583
|
-
:ivar simulate_response: The simulation response if simulation was performed, defaults to None
|
|
584
|
-
"""
|
|
553
|
+
"""Results from sending an AtomicTransactionComposer transaction group."""
|
|
585
554
|
|
|
586
555
|
group_id: str
|
|
556
|
+
"""The group ID if this was a transaction group"""
|
|
587
557
|
confirmations: list[algosdk.v2client.algod.AlgodResponseType]
|
|
558
|
+
"""The confirmation info for each transaction"""
|
|
588
559
|
tx_ids: list[str]
|
|
560
|
+
"""The transaction IDs that were sent"""
|
|
589
561
|
transactions: list[TransactionWrapper]
|
|
562
|
+
"""The transactions that were sent"""
|
|
590
563
|
returns: list[ABIReturn]
|
|
564
|
+
"""The ABI return values from any ABI method calls"""
|
|
591
565
|
simulate_response: dict[str, Any] | None = None
|
|
566
|
+
"""The simulation response if simulation was performed, defaults to None"""
|
|
592
567
|
|
|
593
568
|
|
|
594
569
|
class UnnamedResourcesAccessed:
|
|
@@ -611,8 +586,12 @@ class UnnamedResourcesAccessed:
|
|
|
611
586
|
|
|
612
587
|
@dataclass
|
|
613
588
|
class ExecutionInfoTxn:
|
|
589
|
+
"""Execution info for a transaction."""
|
|
590
|
+
|
|
614
591
|
unnamed_resources_accessed: UnnamedResourcesAccessed | None = None
|
|
592
|
+
"""The unnamed resources accessed in the transaction"""
|
|
615
593
|
required_fee_delta: int = 0
|
|
594
|
+
"""The required fee delta for the transaction"""
|
|
616
595
|
|
|
617
596
|
|
|
618
597
|
@dataclass
|
|
@@ -620,7 +599,9 @@ class ExecutionInfo:
|
|
|
620
599
|
"""Information about transaction execution from simulation."""
|
|
621
600
|
|
|
622
601
|
group_unnamed_resources_accessed: UnnamedResourcesAccessed | None = None
|
|
602
|
+
"""The unnamed resources accessed in the group"""
|
|
623
603
|
txns: list[ExecutionInfoTxn] | None = None
|
|
604
|
+
"""The execution info for each transaction"""
|
|
624
605
|
|
|
625
606
|
|
|
626
607
|
@dataclass
|
|
@@ -1377,6 +1358,9 @@ class TransactionComposer:
|
|
|
1377
1358
|
:param transaction: The transaction to add
|
|
1378
1359
|
:param signer: Optional transaction signer, defaults to getting signer from transaction sender
|
|
1379
1360
|
:return: The transaction composer instance for chaining
|
|
1361
|
+
|
|
1362
|
+
:example:
|
|
1363
|
+
>>> composer.add_transaction(transaction)
|
|
1380
1364
|
"""
|
|
1381
1365
|
self._txns.append(TransactionWithSigner(txn=transaction, signer=signer or self._get_signer(transaction.sender)))
|
|
1382
1366
|
return self
|
|
@@ -1384,6 +1368,16 @@ class TransactionComposer:
|
|
|
1384
1368
|
def add_payment(self, params: PaymentParams) -> TransactionComposer:
|
|
1385
1369
|
"""Add a payment transaction.
|
|
1386
1370
|
|
|
1371
|
+
:example:
|
|
1372
|
+
>>> params = PaymentParams(
|
|
1373
|
+
... sender="SENDER_ADDRESS",
|
|
1374
|
+
... receiver="RECEIVER_ADDRESS",
|
|
1375
|
+
... amount=AlgoAmount.from_algo(1),
|
|
1376
|
+
... close_remainder_to="CLOSE_ADDRESS"
|
|
1377
|
+
... ... (see PaymentParams for more options)
|
|
1378
|
+
... )
|
|
1379
|
+
>>> composer.add_payment(params)
|
|
1380
|
+
|
|
1387
1381
|
:param params: The payment transaction parameters
|
|
1388
1382
|
:return: The transaction composer instance for chaining
|
|
1389
1383
|
"""
|
|
@@ -1393,6 +1387,22 @@ class TransactionComposer:
|
|
|
1393
1387
|
def add_asset_create(self, params: AssetCreateParams) -> TransactionComposer:
|
|
1394
1388
|
"""Add an asset creation transaction.
|
|
1395
1389
|
|
|
1390
|
+
:example:
|
|
1391
|
+
>>> params = AssetCreateParams(
|
|
1392
|
+
... sender="SENDER_ADDRESS",
|
|
1393
|
+
... total=1000,
|
|
1394
|
+
... asset_name="MyAsset",
|
|
1395
|
+
... unit_name="MA",
|
|
1396
|
+
... url="https://example.com",
|
|
1397
|
+
... decimals=0,
|
|
1398
|
+
... default_frozen=False,
|
|
1399
|
+
... manager="MANAGER_ADDRESS",
|
|
1400
|
+
... reserve="RESERVE_ADDRESS",
|
|
1401
|
+
... freeze="FREEZE_ADDRESS",
|
|
1402
|
+
... clawback="CLAWBACK_ADDRESS"
|
|
1403
|
+
... ... (see AssetCreateParams for more options)
|
|
1404
|
+
>>> composer.add_asset_create(params)
|
|
1405
|
+
|
|
1396
1406
|
:param params: The asset creation parameters
|
|
1397
1407
|
:return: The transaction composer instance for chaining
|
|
1398
1408
|
"""
|
|
@@ -1402,6 +1412,18 @@ class TransactionComposer:
|
|
|
1402
1412
|
def add_asset_config(self, params: AssetConfigParams) -> TransactionComposer:
|
|
1403
1413
|
"""Add an asset configuration transaction.
|
|
1404
1414
|
|
|
1415
|
+
:example:
|
|
1416
|
+
>>> params = AssetConfigParams(
|
|
1417
|
+
... sender="SENDER_ADDRESS",
|
|
1418
|
+
... asset_id=123456,
|
|
1419
|
+
... manager="NEW_MANAGER_ADDRESS",
|
|
1420
|
+
... reserve="NEW_RESERVE_ADDRESS",
|
|
1421
|
+
... freeze="NEW_FREEZE_ADDRESS",
|
|
1422
|
+
... clawback="NEW_CLAWBACK_ADDRESS"
|
|
1423
|
+
... ... (see AssetConfigParams for more options)
|
|
1424
|
+
... )
|
|
1425
|
+
>>> composer.add_asset_config(params)
|
|
1426
|
+
|
|
1405
1427
|
:param params: The asset configuration parameters
|
|
1406
1428
|
:return: The transaction composer instance for chaining
|
|
1407
1429
|
"""
|
|
@@ -1411,6 +1433,16 @@ class TransactionComposer:
|
|
|
1411
1433
|
def add_asset_freeze(self, params: AssetFreezeParams) -> TransactionComposer:
|
|
1412
1434
|
"""Add an asset freeze transaction.
|
|
1413
1435
|
|
|
1436
|
+
:example:
|
|
1437
|
+
>>> params = AssetFreezeParams(
|
|
1438
|
+
... sender="SENDER_ADDRESS",
|
|
1439
|
+
... asset_id=123456,
|
|
1440
|
+
... account="ACCOUNT_TO_FREEZE",
|
|
1441
|
+
... frozen=True
|
|
1442
|
+
... ... (see AssetFreezeParams for more options)
|
|
1443
|
+
... )
|
|
1444
|
+
>>> composer.add_asset_freeze(params)
|
|
1445
|
+
|
|
1414
1446
|
:param params: The asset freeze parameters
|
|
1415
1447
|
:return: The transaction composer instance for chaining
|
|
1416
1448
|
"""
|
|
@@ -1420,6 +1452,13 @@ class TransactionComposer:
|
|
|
1420
1452
|
def add_asset_destroy(self, params: AssetDestroyParams) -> TransactionComposer:
|
|
1421
1453
|
"""Add an asset destruction transaction.
|
|
1422
1454
|
|
|
1455
|
+
:example:
|
|
1456
|
+
>>> params = AssetDestroyParams(
|
|
1457
|
+
... sender="SENDER_ADDRESS",
|
|
1458
|
+
... asset_id=123456
|
|
1459
|
+
... ... (see AssetDestroyParams for more options)
|
|
1460
|
+
>>> composer.add_asset_destroy(params)
|
|
1461
|
+
|
|
1423
1462
|
:param params: The asset destruction parameters
|
|
1424
1463
|
:return: The transaction composer instance for chaining
|
|
1425
1464
|
"""
|
|
@@ -1429,6 +1468,17 @@ class TransactionComposer:
|
|
|
1429
1468
|
def add_asset_transfer(self, params: AssetTransferParams) -> TransactionComposer:
|
|
1430
1469
|
"""Add an asset transfer transaction.
|
|
1431
1470
|
|
|
1471
|
+
:example:
|
|
1472
|
+
>>> params = AssetTransferParams(
|
|
1473
|
+
... sender="SENDER_ADDRESS",
|
|
1474
|
+
... asset_id=123456,
|
|
1475
|
+
... amount=10,
|
|
1476
|
+
... receiver="RECEIVER_ADDRESS",
|
|
1477
|
+
... clawback_target="CLAWBACK_TARGET_ADDRESS",
|
|
1478
|
+
... close_asset_to="CLOSE_ADDRESS"
|
|
1479
|
+
... ... (see AssetTransferParams for more options)
|
|
1480
|
+
>>> composer.add_asset_transfer(params)
|
|
1481
|
+
|
|
1432
1482
|
:param params: The asset transfer parameters
|
|
1433
1483
|
:return: The transaction composer instance for chaining
|
|
1434
1484
|
"""
|
|
@@ -1438,6 +1488,14 @@ class TransactionComposer:
|
|
|
1438
1488
|
def add_asset_opt_in(self, params: AssetOptInParams) -> TransactionComposer:
|
|
1439
1489
|
"""Add an asset opt-in transaction.
|
|
1440
1490
|
|
|
1491
|
+
:example:
|
|
1492
|
+
>>> params = AssetOptInParams(
|
|
1493
|
+
... sender="SENDER_ADDRESS",
|
|
1494
|
+
... asset_id=123456
|
|
1495
|
+
... ... (see AssetOptInParams for more options)
|
|
1496
|
+
... )
|
|
1497
|
+
>>> composer.add_asset_opt_in(params)
|
|
1498
|
+
|
|
1441
1499
|
:param params: The asset opt-in parameters
|
|
1442
1500
|
:return: The transaction composer instance for chaining
|
|
1443
1501
|
"""
|
|
@@ -1447,6 +1505,14 @@ class TransactionComposer:
|
|
|
1447
1505
|
def add_asset_opt_out(self, params: AssetOptOutParams) -> TransactionComposer:
|
|
1448
1506
|
"""Add an asset opt-out transaction.
|
|
1449
1507
|
|
|
1508
|
+
:example:
|
|
1509
|
+
>>> params = AssetOptOutParams(
|
|
1510
|
+
... sender="SENDER_ADDRESS",
|
|
1511
|
+
... asset_id=123456,
|
|
1512
|
+
... creator="CREATOR_ADDRESS"
|
|
1513
|
+
... ... (see AssetOptOutParams for more options)
|
|
1514
|
+
>>> composer.add_asset_opt_out(params)
|
|
1515
|
+
|
|
1450
1516
|
:param params: The asset opt-out parameters
|
|
1451
1517
|
:return: The transaction composer instance for chaining
|
|
1452
1518
|
"""
|
|
@@ -1456,6 +1522,23 @@ class TransactionComposer:
|
|
|
1456
1522
|
def add_app_create(self, params: AppCreateParams) -> TransactionComposer:
|
|
1457
1523
|
"""Add an application creation transaction.
|
|
1458
1524
|
|
|
1525
|
+
:example:
|
|
1526
|
+
>>> params = AppCreateParams(
|
|
1527
|
+
... sender="SENDER_ADDRESS",
|
|
1528
|
+
... approval_program="TEAL_APPROVAL_CODE",
|
|
1529
|
+
... clear_state_program="TEAL_CLEAR_CODE",
|
|
1530
|
+
... schema={'global_ints': 1, 'global_byte_slices': 1, 'local_ints': 1, 'local_byte_slices': 1},
|
|
1531
|
+
... on_complete=OnComplete.NoOpOC,
|
|
1532
|
+
... args=[b'arg1'],
|
|
1533
|
+
... account_references=["ACCOUNT1"],
|
|
1534
|
+
... app_references=[789],
|
|
1535
|
+
... asset_references=[123],
|
|
1536
|
+
... box_references=[],
|
|
1537
|
+
... extra_program_pages=0
|
|
1538
|
+
... ... (see AppCreateParams for more options)
|
|
1539
|
+
... )
|
|
1540
|
+
>>> composer.add_app_create(params)
|
|
1541
|
+
|
|
1459
1542
|
:param params: The application creation parameters
|
|
1460
1543
|
:return: The transaction composer instance for chaining
|
|
1461
1544
|
"""
|
|
@@ -1465,6 +1548,21 @@ class TransactionComposer:
|
|
|
1465
1548
|
def add_app_update(self, params: AppUpdateParams) -> TransactionComposer:
|
|
1466
1549
|
"""Add an application update transaction.
|
|
1467
1550
|
|
|
1551
|
+
:example:
|
|
1552
|
+
>>> params = AppUpdateParams(
|
|
1553
|
+
... sender="SENDER_ADDRESS",
|
|
1554
|
+
... app_id=789,
|
|
1555
|
+
... approval_program="TEAL_NEW_APPROVAL_CODE",
|
|
1556
|
+
... clear_state_program="TEAL_NEW_CLEAR_CODE",
|
|
1557
|
+
... args=[b'new_arg1'],
|
|
1558
|
+
... account_references=["ACCOUNT1"],
|
|
1559
|
+
... app_references=[789],
|
|
1560
|
+
... asset_references=[123],
|
|
1561
|
+
... box_references=[],
|
|
1562
|
+
... on_complete=OnComplete.UpdateApplicationOC
|
|
1563
|
+
... ... (see AppUpdateParams for more options)
|
|
1564
|
+
>>> composer.add_app_update(params)
|
|
1565
|
+
|
|
1468
1566
|
:param params: The application update parameters
|
|
1469
1567
|
:return: The transaction composer instance for chaining
|
|
1470
1568
|
"""
|
|
@@ -1474,6 +1572,19 @@ class TransactionComposer:
|
|
|
1474
1572
|
def add_app_delete(self, params: AppDeleteParams) -> TransactionComposer:
|
|
1475
1573
|
"""Add an application deletion transaction.
|
|
1476
1574
|
|
|
1575
|
+
:example:
|
|
1576
|
+
>>> params = AppDeleteParams(
|
|
1577
|
+
... sender="SENDER_ADDRESS",
|
|
1578
|
+
... app_id=789,
|
|
1579
|
+
... args=[b'delete_arg'],
|
|
1580
|
+
... account_references=["ACCOUNT1"],
|
|
1581
|
+
... app_references=[789],
|
|
1582
|
+
... asset_references=[123],
|
|
1583
|
+
... box_references=[],
|
|
1584
|
+
... on_complete=OnComplete.DeleteApplicationOC
|
|
1585
|
+
... ... (see AppDeleteParams for more options)
|
|
1586
|
+
>>> composer.add_app_delete(params)
|
|
1587
|
+
|
|
1477
1588
|
:param params: The application deletion parameters
|
|
1478
1589
|
:return: The transaction composer instance for chaining
|
|
1479
1590
|
"""
|
|
@@ -1483,6 +1594,18 @@ class TransactionComposer:
|
|
|
1483
1594
|
def add_app_call(self, params: AppCallParams) -> TransactionComposer:
|
|
1484
1595
|
"""Add an application call transaction.
|
|
1485
1596
|
|
|
1597
|
+
:example:
|
|
1598
|
+
>>> params = AppCallParams(
|
|
1599
|
+
... sender="SENDER_ADDRESS",
|
|
1600
|
+
... on_complete=OnComplete.NoOpOC,
|
|
1601
|
+
... app_id=789,
|
|
1602
|
+
... approval_program="TEAL_APPROVAL_CODE",
|
|
1603
|
+
... clear_state_program="TEAL_CLEAR_CODE",
|
|
1604
|
+
... schema={'global_ints': 1, 'global_byte_slices': 1, 'local_ints': 1, 'local_byte_slices': 1},
|
|
1605
|
+
... ... (see AppCallParams for more options)
|
|
1606
|
+
... )
|
|
1607
|
+
>>> composer.add_app_call(params)
|
|
1608
|
+
|
|
1486
1609
|
:param params: The application call parameters
|
|
1487
1610
|
:return: The transaction composer instance for chaining
|
|
1488
1611
|
"""
|
|
@@ -1494,6 +1617,59 @@ class TransactionComposer:
|
|
|
1494
1617
|
|
|
1495
1618
|
:param params: The application creation method call parameters
|
|
1496
1619
|
:return: The transaction composer instance for chaining
|
|
1620
|
+
|
|
1621
|
+
:example:
|
|
1622
|
+
>>> # Basic example
|
|
1623
|
+
>>> method = algosdk.abi.Method(
|
|
1624
|
+
... name="method",
|
|
1625
|
+
... args=[...],
|
|
1626
|
+
... returns="string"
|
|
1627
|
+
... )
|
|
1628
|
+
>>> composer.add_app_create_method_call(
|
|
1629
|
+
... AppCreateMethodCallParams(
|
|
1630
|
+
... sender="CREATORADDRESS",
|
|
1631
|
+
... approval_program="TEALCODE",
|
|
1632
|
+
... clear_state_program="TEALCODE",
|
|
1633
|
+
... method=method,
|
|
1634
|
+
... args=["arg1_value"]
|
|
1635
|
+
... )
|
|
1636
|
+
... )
|
|
1637
|
+
>>>
|
|
1638
|
+
>>> # Advanced example
|
|
1639
|
+
>>> method = ABIMethod(
|
|
1640
|
+
... name="method",
|
|
1641
|
+
... args=[{"name": "arg1", "type": "string"}],
|
|
1642
|
+
... returns={"type": "string"}
|
|
1643
|
+
... )
|
|
1644
|
+
>>> composer.add_app_create_method_call(
|
|
1645
|
+
... AppCreateMethodCallParams(
|
|
1646
|
+
... sender="CREATORADDRESS",
|
|
1647
|
+
... method=method,
|
|
1648
|
+
... args=["arg1_value"],
|
|
1649
|
+
... approval_program="TEALCODE",
|
|
1650
|
+
... clear_state_program="TEALCODE",
|
|
1651
|
+
... schema={
|
|
1652
|
+
... "global_ints": 1,
|
|
1653
|
+
... "global_byte_slices": 2,
|
|
1654
|
+
... "local_ints": 3,
|
|
1655
|
+
... "local_byte_slices": 4
|
|
1656
|
+
... },
|
|
1657
|
+
... extra_pages=1,
|
|
1658
|
+
... on_complete=OnComplete.OptInOC,
|
|
1659
|
+
... args=[bytes([1, 2, 3, 4])],
|
|
1660
|
+
... account_references=["ACCOUNT_1"],
|
|
1661
|
+
... app_references=[123, 1234],
|
|
1662
|
+
... asset_references=[12345],
|
|
1663
|
+
... box_references=["box1", {"app_id": 1234, "name": "box2"}],
|
|
1664
|
+
... lease="lease",
|
|
1665
|
+
... note="note",
|
|
1666
|
+
... first_valid_round=1000,
|
|
1667
|
+
... validity_window=10,
|
|
1668
|
+
... extra_fee=AlgoAmount.from_micro_algos(1000),
|
|
1669
|
+
... static_fee=AlgoAmount.from_micro_algos(1000),
|
|
1670
|
+
... max_fee=AlgoAmount.from_micro_algos(3000)
|
|
1671
|
+
... )
|
|
1672
|
+
... )
|
|
1497
1673
|
"""
|
|
1498
1674
|
self._txns.append(params)
|
|
1499
1675
|
return self
|
|
@@ -1548,6 +1724,11 @@ class TransactionComposer:
|
|
|
1548
1724
|
|
|
1549
1725
|
:param atc: The AtomicTransactionComposer to add
|
|
1550
1726
|
:return: The transaction composer instance for chaining
|
|
1727
|
+
|
|
1728
|
+
:example:
|
|
1729
|
+
>>> atc = AtomicTransactionComposer()
|
|
1730
|
+
>>> atc.add_transaction(TransactionWithSigner(transaction, signer))
|
|
1731
|
+
>>> composer.add_atc(atc)
|
|
1551
1732
|
"""
|
|
1552
1733
|
self._txns.append(atc)
|
|
1553
1734
|
return self
|
|
@@ -1708,6 +1889,9 @@ class TransactionComposer:
|
|
|
1708
1889
|
:param simulation_round: Round number to simulate at
|
|
1709
1890
|
:param skip_signatures: Whether to skip signature validation
|
|
1710
1891
|
:return: The simulation results
|
|
1892
|
+
|
|
1893
|
+
:example:
|
|
1894
|
+
>>> result = composer.simulate(extra_opcode_budget=1000, skip_signatures=True, ...)
|
|
1711
1895
|
"""
|
|
1712
1896
|
from algokit_utils._debugging import simulate_and_persist_response, simulate_response
|
|
1713
1897
|
|