algokit-utils 3.0.0b9__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 +171 -205
- 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.0b9.dist-info → algokit_utils-3.0.0b11.dist-info}/METADATA +1 -1
- {algokit_utils-3.0.0b9.dist-info → algokit_utils-3.0.0b11.dist-info}/RECORD +26 -26
- {algokit_utils-3.0.0b9.dist-info → algokit_utils-3.0.0b11.dist-info}/WHEEL +1 -1
- {algokit_utils-3.0.0b9.dist-info → algokit_utils-3.0.0b11.dist-info}/LICENSE +0 -0
|
@@ -41,6 +41,10 @@ class AlgorandClientTransactionCreator:
|
|
|
41
41
|
asset operations, application calls and key registrations.
|
|
42
42
|
|
|
43
43
|
:param new_group: A lambda that starts a new TransactionComposer transaction group
|
|
44
|
+
|
|
45
|
+
:example:
|
|
46
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
47
|
+
>>> creator.payment(PaymentParams(sender="sender", receiver="receiver", amount=AlgoAmount.from_algo(1)))
|
|
44
48
|
"""
|
|
45
49
|
|
|
46
50
|
def __init__(self, new_group: Callable[[], TransactionComposer]) -> None:
|
|
@@ -67,90 +71,618 @@ class AlgorandClientTransactionCreator:
|
|
|
67
71
|
|
|
68
72
|
@property
|
|
69
73
|
def payment(self) -> Callable[[PaymentParams], Transaction]:
|
|
70
|
-
"""Create a payment transaction to transfer Algo between accounts.
|
|
74
|
+
"""Create a payment transaction to transfer Algo between accounts.
|
|
75
|
+
|
|
76
|
+
:example:
|
|
77
|
+
>>> #Basic example
|
|
78
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
79
|
+
>>> creator.payment(PaymentParams(sender="sender", receiver="receiver", amount=AlgoAmount.from_algo(4)))
|
|
80
|
+
:example:
|
|
81
|
+
>>> #Advanced example
|
|
82
|
+
>>> creator.payment(PaymentParams(
|
|
83
|
+
sender="SENDERADDRESS",
|
|
84
|
+
receiver="RECEIVERADDRESS",
|
|
85
|
+
amount=AlgoAmount.from_algo(4),
|
|
86
|
+
close_remainder_to="CLOSEREMAINDERTOADDRESS",
|
|
87
|
+
lease="lease",
|
|
88
|
+
note=b"note",
|
|
89
|
+
rekey_to="REKEYTOADDRESS",
|
|
90
|
+
first_valid_round=1000,
|
|
91
|
+
validity_window=10,
|
|
92
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
93
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
94
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
95
|
+
))
|
|
96
|
+
"""
|
|
71
97
|
return self._transaction(lambda c: c.add_payment)
|
|
72
98
|
|
|
73
99
|
@property
|
|
74
100
|
def asset_create(self) -> Callable[[AssetCreateParams], Transaction]:
|
|
75
|
-
"""Create a create Algorand Standard Asset transaction.
|
|
101
|
+
"""Create a create Algorand Standard Asset transaction.
|
|
102
|
+
|
|
103
|
+
:example:
|
|
104
|
+
>>> #Basic example
|
|
105
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
106
|
+
>>> params = AssetCreateParams(sender="SENDER_ADDRESS", total=1000)
|
|
107
|
+
>>> txn = creator.asset_create(params)
|
|
108
|
+
:example:
|
|
109
|
+
>>> #Advanced example
|
|
110
|
+
>>> creator.asset_create(AssetCreateParams(
|
|
111
|
+
sender="SENDER_ADDRESS",
|
|
112
|
+
total=1000,
|
|
113
|
+
asset_name="MyAsset",
|
|
114
|
+
unit_name="MA",
|
|
115
|
+
url="https://example.com/asset",
|
|
116
|
+
decimals=0,
|
|
117
|
+
default_frozen=False,
|
|
118
|
+
manager="MANAGER_ADDRESS",
|
|
119
|
+
reserve="RESERVE_ADDRESS",
|
|
120
|
+
freeze="FREEZE_ADDRESS",
|
|
121
|
+
clawback="CLAWBACK_ADDRESS",
|
|
122
|
+
lease="lease",
|
|
123
|
+
note=b"note",
|
|
124
|
+
rekey_to="REKEYTOADDRESS",
|
|
125
|
+
first_valid_round=1000,
|
|
126
|
+
validity_window=10,
|
|
127
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
128
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
129
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
130
|
+
))
|
|
131
|
+
"""
|
|
76
132
|
return self._transaction(lambda c: c.add_asset_create)
|
|
77
133
|
|
|
78
134
|
@property
|
|
79
135
|
def asset_config(self) -> Callable[[AssetConfigParams], Transaction]:
|
|
80
|
-
"""Create an asset config transaction to reconfigure an existing Algorand Standard Asset.
|
|
136
|
+
"""Create an asset config transaction to reconfigure an existing Algorand Standard Asset.
|
|
137
|
+
|
|
138
|
+
:example:
|
|
139
|
+
>>> #Basic example
|
|
140
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
141
|
+
>>> params = AssetConfigParams(sender="SENDER_ADDRESS", asset_id=123456, manager="NEW_MANAGER_ADDRESS")
|
|
142
|
+
>>> txn = creator.asset_config(params)
|
|
143
|
+
:example:
|
|
144
|
+
>>> #Advanced example
|
|
145
|
+
>>> creator.asset_config(AssetConfigParams(
|
|
146
|
+
sender="SENDER_ADDRESS",
|
|
147
|
+
asset_id=123456,
|
|
148
|
+
manager="NEW_MANAGER_ADDRESS",
|
|
149
|
+
reserve="NEW_RESERVE_ADDRESS",
|
|
150
|
+
freeze="NEW_FREEZE_ADDRESS",
|
|
151
|
+
clawback="NEW_CLAWBACK_ADDRESS",
|
|
152
|
+
lease="lease",
|
|
153
|
+
note=b"note",
|
|
154
|
+
rekey_to="REKEYTOADDRESS",
|
|
155
|
+
first_valid_round=1000,
|
|
156
|
+
validity_window=10,
|
|
157
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
158
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
159
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
160
|
+
))
|
|
161
|
+
"""
|
|
81
162
|
return self._transaction(lambda c: c.add_asset_config)
|
|
82
163
|
|
|
83
164
|
@property
|
|
84
165
|
def asset_freeze(self) -> Callable[[AssetFreezeParams], Transaction]:
|
|
85
|
-
"""Create an Algorand Standard Asset freeze transaction.
|
|
166
|
+
"""Create an Algorand Standard Asset freeze transaction.
|
|
167
|
+
|
|
168
|
+
:example:
|
|
169
|
+
>>> #Basic example
|
|
170
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
171
|
+
>>> params = AssetFreezeParams(sender="SENDER_ADDRESS",
|
|
172
|
+
asset_id=123456,
|
|
173
|
+
account="ACCOUNT_TO_FREEZE",
|
|
174
|
+
frozen=True)
|
|
175
|
+
>>> txn = creator.asset_freeze(params)
|
|
176
|
+
|
|
177
|
+
:example:
|
|
178
|
+
>>> #Advanced example
|
|
179
|
+
>>> creator.asset_freeze(AssetFreezeParams(
|
|
180
|
+
sender="SENDER_ADDRESS",
|
|
181
|
+
asset_id=123456,
|
|
182
|
+
account="ACCOUNT_TO_FREEZE",
|
|
183
|
+
frozen=True,
|
|
184
|
+
lease="lease",
|
|
185
|
+
note=b"note",
|
|
186
|
+
rekey_to="REKEYTOADDRESS",
|
|
187
|
+
first_valid_round=1000,
|
|
188
|
+
validity_window=10,
|
|
189
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
190
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
191
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
192
|
+
))
|
|
193
|
+
"""
|
|
86
194
|
return self._transaction(lambda c: c.add_asset_freeze)
|
|
87
195
|
|
|
88
196
|
@property
|
|
89
197
|
def asset_destroy(self) -> Callable[[AssetDestroyParams], Transaction]:
|
|
90
|
-
"""Create an Algorand Standard Asset destroy transaction.
|
|
198
|
+
"""Create an Algorand Standard Asset destroy transaction.
|
|
199
|
+
|
|
200
|
+
:example:
|
|
201
|
+
>>> #Basic example
|
|
202
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
203
|
+
>>> params = AssetDestroyParams(sender="SENDER_ADDRESS", asset_id=123456)
|
|
204
|
+
>>> txn = creator.asset_destroy(params)
|
|
205
|
+
|
|
206
|
+
:example:
|
|
207
|
+
>>> #Advanced example
|
|
208
|
+
>>> creator.asset_destroy(AssetDestroyParams(
|
|
209
|
+
sender="SENDER_ADDRESS",
|
|
210
|
+
asset_id=123456,
|
|
211
|
+
lease="lease",
|
|
212
|
+
note=b"note",
|
|
213
|
+
rekey_to="REKEYTOADDRESS",
|
|
214
|
+
first_valid_round=1000,
|
|
215
|
+
validity_window=10,
|
|
216
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
217
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
218
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
219
|
+
))
|
|
220
|
+
"""
|
|
91
221
|
return self._transaction(lambda c: c.add_asset_destroy)
|
|
92
222
|
|
|
93
223
|
@property
|
|
94
224
|
def asset_transfer(self) -> Callable[[AssetTransferParams], Transaction]:
|
|
95
|
-
"""Create an Algorand Standard Asset transfer transaction.
|
|
225
|
+
"""Create an Algorand Standard Asset transfer transaction.
|
|
226
|
+
|
|
227
|
+
:example:
|
|
228
|
+
>>> #Basic example
|
|
229
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
230
|
+
>>> params = AssetTransferParams(sender="SENDER_ADDRESS",
|
|
231
|
+
asset_id=123456,
|
|
232
|
+
amount=10,
|
|
233
|
+
receiver="RECEIVER_ADDRESS")
|
|
234
|
+
>>> txn = creator.asset_transfer(params)
|
|
235
|
+
|
|
236
|
+
:example:
|
|
237
|
+
>>> #Advanced example
|
|
238
|
+
>>> creator.asset_transfer(AssetTransferParams(
|
|
239
|
+
sender="SENDER_ADDRESS",
|
|
240
|
+
asset_id=123456,
|
|
241
|
+
amount=10,
|
|
242
|
+
receiver="RECEIVER_ADDRESS",
|
|
243
|
+
clawback_target="CLAWBACK_TARGET_ADDRESS",
|
|
244
|
+
close_asset_to="CLOSE_ASSET_TO_ADDRESS",
|
|
245
|
+
lease="lease",
|
|
246
|
+
note=b"note",
|
|
247
|
+
rekey_to="REKEYTOADDRESS",
|
|
248
|
+
first_valid_round=1000,
|
|
249
|
+
validity_window=10,
|
|
250
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
251
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
252
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
253
|
+
))
|
|
254
|
+
"""
|
|
96
255
|
return self._transaction(lambda c: c.add_asset_transfer)
|
|
97
256
|
|
|
98
257
|
@property
|
|
99
258
|
def asset_opt_in(self) -> Callable[[AssetOptInParams], Transaction]:
|
|
100
|
-
"""Create an Algorand Standard Asset opt-in transaction.
|
|
259
|
+
"""Create an Algorand Standard Asset opt-in transaction.
|
|
260
|
+
|
|
261
|
+
:example:
|
|
262
|
+
>>> # Basic example
|
|
263
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
264
|
+
>>> params = AssetOptInParams(sender="SENDER_ADDRESS", asset_id=123456)
|
|
265
|
+
>>> txn = creator.asset_opt_in(params)
|
|
266
|
+
|
|
267
|
+
:example:
|
|
268
|
+
>>> # Advanced example
|
|
269
|
+
>>> creator.asset_opt_in(AssetOptInParams(
|
|
270
|
+
sender="SENDER_ADDRESS",
|
|
271
|
+
asset_id=123456,
|
|
272
|
+
lease="lease",
|
|
273
|
+
note=b"note",
|
|
274
|
+
rekey_to="REKEYTOADDRESS",
|
|
275
|
+
first_valid_round=1000,
|
|
276
|
+
validity_window=10,
|
|
277
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
278
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
279
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
280
|
+
))
|
|
281
|
+
"""
|
|
101
282
|
return self._transaction(lambda c: c.add_asset_opt_in)
|
|
102
283
|
|
|
103
284
|
@property
|
|
104
285
|
def asset_opt_out(self) -> Callable[[AssetOptOutParams], Transaction]:
|
|
105
|
-
"""Create an asset opt-out transaction.
|
|
286
|
+
"""Create an asset opt-out transaction.
|
|
287
|
+
|
|
288
|
+
:example:
|
|
289
|
+
>>> #Basic example
|
|
290
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
291
|
+
>>> params = AssetOptOutParams(sender="SENDER_ADDRESS", asset_id=123456, creator="CREATOR_ADDRESS")
|
|
292
|
+
>>> txn = creator.asset_opt_out(params)
|
|
293
|
+
|
|
294
|
+
:example:
|
|
295
|
+
>>> #Advanced example
|
|
296
|
+
>>> creator.asset_opt_out(AssetOptOutParams(
|
|
297
|
+
sender="SENDER_ADDRESS",
|
|
298
|
+
asset_id=123456,
|
|
299
|
+
creator="CREATOR_ADDRESS",
|
|
300
|
+
lease="lease",
|
|
301
|
+
note=b"note",
|
|
302
|
+
rekey_to="REKEYTOADDRESS",
|
|
303
|
+
first_valid_round=1000,
|
|
304
|
+
validity_window=10,
|
|
305
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
306
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
307
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
308
|
+
))
|
|
309
|
+
"""
|
|
106
310
|
return self._transaction(lambda c: c.add_asset_opt_out)
|
|
107
311
|
|
|
108
312
|
@property
|
|
109
313
|
def app_create(self) -> Callable[[AppCreateParams], Transaction]:
|
|
110
|
-
"""Create an application create transaction.
|
|
314
|
+
"""Create an application create transaction.
|
|
315
|
+
|
|
316
|
+
:example:
|
|
317
|
+
>>> #Basic example
|
|
318
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
319
|
+
>>> params = AppCreateParams(
|
|
320
|
+
... sender="SENDER_ADDRESS",
|
|
321
|
+
... approval_program="TEAL_APPROVAL_CODE",
|
|
322
|
+
... clear_state_program="TEAL_CLEAR_CODE",
|
|
323
|
+
... schema={
|
|
324
|
+
... 'global_ints': 1,
|
|
325
|
+
... 'global_byte_slices': 1,
|
|
326
|
+
... 'local_ints': 1,
|
|
327
|
+
... 'local_byte_slices': 1
|
|
328
|
+
... }
|
|
329
|
+
... )
|
|
330
|
+
>>> txn = creator.app_create(params)
|
|
331
|
+
|
|
332
|
+
:example:
|
|
333
|
+
>>> #Advanced example
|
|
334
|
+
>>> creator.app_create(AppCreateParams(
|
|
335
|
+
sender="SENDER_ADDRESS",
|
|
336
|
+
approval_program="TEAL_APPROVAL_CODE",
|
|
337
|
+
clear_state_program="TEAL_CLEAR_CODE",
|
|
338
|
+
schema={'global_ints': 1, 'global_byte_slices': 1, 'local_ints': 1, 'local_byte_slices': 1},
|
|
339
|
+
on_complete=OnComplete.NoOpOC,
|
|
340
|
+
args=[b'arg1', b'arg2'],
|
|
341
|
+
account_references=["ACCOUNT1"],
|
|
342
|
+
app_references=[789],
|
|
343
|
+
asset_references=[123],
|
|
344
|
+
box_references=[],
|
|
345
|
+
extra_program_pages=0,
|
|
346
|
+
lease="lease",
|
|
347
|
+
note=b"note",
|
|
348
|
+
rekey_to="REKEYTOADDRESS",
|
|
349
|
+
first_valid_round=1000,
|
|
350
|
+
validity_window=10,
|
|
351
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
352
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
353
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
354
|
+
))
|
|
355
|
+
"""
|
|
111
356
|
return self._transaction(lambda c: c.add_app_create)
|
|
112
357
|
|
|
113
358
|
@property
|
|
114
359
|
def app_update(self) -> Callable[[AppUpdateParams], Transaction]:
|
|
115
|
-
"""Create an application update transaction.
|
|
360
|
+
"""Create an application update transaction.
|
|
361
|
+
|
|
362
|
+
:example:
|
|
363
|
+
>>> #Basic example
|
|
364
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
365
|
+
>>> txn = creator.app_update(AppUpdateParams(sender="SENDER_ADDRESS",
|
|
366
|
+
app_id=789,
|
|
367
|
+
approval_program="TEAL_NEW_APPROVAL_CODE",
|
|
368
|
+
clear_state_program="TEAL_NEW_CLEAR_CODE",
|
|
369
|
+
args=[b'new_arg1', b'new_arg2']))
|
|
370
|
+
|
|
371
|
+
:example:
|
|
372
|
+
>>> #Advanced example
|
|
373
|
+
>>> creator.app_update(AppUpdateParams(
|
|
374
|
+
sender="SENDER_ADDRESS",
|
|
375
|
+
app_id=789,
|
|
376
|
+
approval_program="TEAL_NEW_APPROVAL_CODE",
|
|
377
|
+
clear_state_program="TEAL_NEW_CLEAR_CODE",
|
|
378
|
+
args=[b'new_arg1', b'new_arg2'],
|
|
379
|
+
account_references=["ACCOUNT1"],
|
|
380
|
+
app_references=[789],
|
|
381
|
+
asset_references=[123],
|
|
382
|
+
box_references=[],
|
|
383
|
+
on_complete=OnComplete.UpdateApplicationOC,
|
|
384
|
+
lease="lease",
|
|
385
|
+
note=b"note",
|
|
386
|
+
rekey_to="REKEYTOADDRESS",
|
|
387
|
+
first_valid_round=1000,
|
|
388
|
+
validity_window=10,
|
|
389
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
390
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
391
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
392
|
+
))
|
|
393
|
+
"""
|
|
116
394
|
return self._transaction(lambda c: c.add_app_update)
|
|
117
395
|
|
|
118
396
|
@property
|
|
119
397
|
def app_delete(self) -> Callable[[AppDeleteParams], Transaction]:
|
|
120
|
-
"""Create an application delete transaction.
|
|
398
|
+
"""Create an application delete transaction.
|
|
399
|
+
|
|
400
|
+
:example:
|
|
401
|
+
>>> #Basic example
|
|
402
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
403
|
+
>>> params = AppDeleteParams(sender="SENDER_ADDRESS", app_id=789, args=[b'delete_arg'])
|
|
404
|
+
>>> txn = creator.app_delete(params)
|
|
405
|
+
|
|
406
|
+
:example:
|
|
407
|
+
>>> #Advanced example
|
|
408
|
+
>>> creator.app_delete(AppDeleteParams(
|
|
409
|
+
sender="SENDER_ADDRESS",
|
|
410
|
+
app_id=789,
|
|
411
|
+
args=[b'delete_arg'],
|
|
412
|
+
account_references=["ACCOUNT1"],
|
|
413
|
+
app_references=[789],
|
|
414
|
+
asset_references=[123],
|
|
415
|
+
box_references=[],
|
|
416
|
+
on_complete=OnComplete.DeleteApplicationOC,
|
|
417
|
+
lease="lease",
|
|
418
|
+
note=b"note",
|
|
419
|
+
rekey_to="REKEYTOADDRESS",
|
|
420
|
+
first_valid_round=1000,
|
|
421
|
+
validity_window=10,
|
|
422
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
423
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
424
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
425
|
+
))
|
|
426
|
+
"""
|
|
121
427
|
return self._transaction(lambda c: c.add_app_delete)
|
|
122
428
|
|
|
123
429
|
@property
|
|
124
430
|
def app_call(self) -> Callable[[AppCallParams], Transaction]:
|
|
125
|
-
"""Create an application call transaction.
|
|
431
|
+
"""Create an application call transaction.
|
|
432
|
+
|
|
433
|
+
:example:
|
|
434
|
+
>>> #Basic example
|
|
435
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
436
|
+
>>> params = AppCallParams(
|
|
437
|
+
... sender="SENDER_ADDRESS",
|
|
438
|
+
... on_complete=OnComplete.NoOpOC,
|
|
439
|
+
... app_id=789,
|
|
440
|
+
... approval_program="TEAL_APPROVAL_CODE",
|
|
441
|
+
... clear_state_program="TEAL_CLEAR_CODE",
|
|
442
|
+
... schema={
|
|
443
|
+
... 'global_ints': 1,
|
|
444
|
+
... 'global_byte_slices': 1,
|
|
445
|
+
... 'local_ints': 1,
|
|
446
|
+
... 'local_byte_slices': 1
|
|
447
|
+
... },
|
|
448
|
+
... args=[b'arg1', b'arg2'],
|
|
449
|
+
... account_references=["ACCOUNT1"],
|
|
450
|
+
... app_references=[789],
|
|
451
|
+
... asset_references=[123],
|
|
452
|
+
... extra_pages=0,
|
|
453
|
+
... box_references=[]
|
|
454
|
+
... )
|
|
455
|
+
>>> txn = creator.app_call(params)
|
|
456
|
+
|
|
457
|
+
:example:
|
|
458
|
+
>>> #Advanced example
|
|
459
|
+
>>> creator.app_call(AppCallParams(
|
|
460
|
+
sender="SENDER_ADDRESS",
|
|
461
|
+
on_complete=OnComplete.NoOpOC,
|
|
462
|
+
app_id=789,
|
|
463
|
+
approval_program="TEAL_APPROVAL_CODE",
|
|
464
|
+
clear_state_program="TEAL_CLEAR_CODE",
|
|
465
|
+
schema={'global_ints': 1, 'global_byte_slices': 1, 'local_ints': 1, 'local_byte_slices': 1},
|
|
466
|
+
args=[b'arg1', b'arg2'],
|
|
467
|
+
account_references=["ACCOUNT1"],
|
|
468
|
+
app_references=[789],
|
|
469
|
+
asset_references=[123],
|
|
470
|
+
extra_pages=0,
|
|
471
|
+
box_references=[],
|
|
472
|
+
lease="lease",
|
|
473
|
+
note=b"note",
|
|
474
|
+
rekey_to="REKEYTOADDRESS",
|
|
475
|
+
first_valid_round=1000,
|
|
476
|
+
validity_window=10,
|
|
477
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
478
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
479
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
480
|
+
))
|
|
481
|
+
"""
|
|
126
482
|
return self._transaction(lambda c: c.add_app_call)
|
|
127
483
|
|
|
128
484
|
@property
|
|
129
485
|
def app_create_method_call(self) -> Callable[[AppCreateMethodCallParams], BuiltTransactions]:
|
|
130
|
-
"""Create an application create call with ABI method call transaction.
|
|
486
|
+
"""Create an application create call with ABI method call transaction.
|
|
487
|
+
|
|
488
|
+
:example:
|
|
489
|
+
>>> #Basic example
|
|
490
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
491
|
+
>>> params = AppCreateMethodCallParams(sender="SENDER_ADDRESS", app_id=0, method=some_abi_method_object)
|
|
492
|
+
>>> built_txns = creator.app_create_method_call(params)
|
|
493
|
+
|
|
494
|
+
:example:
|
|
495
|
+
>>> #Advanced example
|
|
496
|
+
>>> creator.app_create_method_call(AppCreateMethodCallParams(
|
|
497
|
+
sender="SENDER_ADDRESS",
|
|
498
|
+
app_id=0,
|
|
499
|
+
method=some_abi_method_object,
|
|
500
|
+
args=[b'method_arg'],
|
|
501
|
+
account_references=["ACCOUNT1"],
|
|
502
|
+
app_references=[789],
|
|
503
|
+
asset_references=[123],
|
|
504
|
+
box_references=[],
|
|
505
|
+
schema={'global_ints': 1, 'global_byte_slices': 1, 'local_ints': 1, 'local_byte_slices': 1},
|
|
506
|
+
approval_program="TEAL_APPROVAL_CODE",
|
|
507
|
+
clear_state_program="TEAL_CLEAR_CODE",
|
|
508
|
+
on_complete=OnComplete.NoOpOC,
|
|
509
|
+
extra_program_pages=0,
|
|
510
|
+
lease="lease",
|
|
511
|
+
note=b"note",
|
|
512
|
+
rekey_to="REKEYTOADDRESS",
|
|
513
|
+
first_valid_round=1000,
|
|
514
|
+
validity_window=10,
|
|
515
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
516
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
517
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
518
|
+
))
|
|
519
|
+
"""
|
|
131
520
|
return self._transactions(lambda c: c.add_app_create_method_call)
|
|
132
521
|
|
|
133
522
|
@property
|
|
134
523
|
def app_update_method_call(self) -> Callable[[AppUpdateMethodCallParams], BuiltTransactions]:
|
|
135
|
-
"""Create an application update call with ABI method call transaction.
|
|
524
|
+
"""Create an application update call with ABI method call transaction.
|
|
525
|
+
|
|
526
|
+
:example:
|
|
527
|
+
>>> #Basic example
|
|
528
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
529
|
+
>>> params = AppUpdateMethodCallParams(sender="SENDER_ADDRESS", app_id=789, method=some_abi_method_object)
|
|
530
|
+
>>> built_txns = creator.app_update_method_call(params)
|
|
531
|
+
|
|
532
|
+
:example:
|
|
533
|
+
>>> #Advanced example
|
|
534
|
+
>>> creator.app_update_method_call(AppUpdateMethodCallParams(
|
|
535
|
+
sender="SENDER_ADDRESS",
|
|
536
|
+
app_id=789,
|
|
537
|
+
method=some_abi_method_object,
|
|
538
|
+
args=[b'method_arg'],
|
|
539
|
+
account_references=["ACCOUNT1"],
|
|
540
|
+
app_references=[789],
|
|
541
|
+
asset_references=[123],
|
|
542
|
+
box_references=[],
|
|
543
|
+
schema={'global_ints': 1, 'global_byte_slices': 1, 'local_ints': 1, 'local_byte_slices': 1},
|
|
544
|
+
approval_program="TEAL_NEW_APPROVAL_CODE",
|
|
545
|
+
clear_state_program="TEAL_NEW_CLEAR_CODE",
|
|
546
|
+
on_complete=OnComplete.UpdateApplicationOC,
|
|
547
|
+
lease="lease",
|
|
548
|
+
note=b"note",
|
|
549
|
+
rekey_to="REKEYTOADDRESS",
|
|
550
|
+
first_valid_round=1000,
|
|
551
|
+
validity_window=10,
|
|
552
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
553
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
554
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
555
|
+
))
|
|
556
|
+
"""
|
|
136
557
|
return self._transactions(lambda c: c.add_app_update_method_call)
|
|
137
558
|
|
|
138
559
|
@property
|
|
139
560
|
def app_delete_method_call(self) -> Callable[[AppDeleteMethodCallParams], BuiltTransactions]:
|
|
140
|
-
"""Create an application delete call with ABI method call transaction.
|
|
561
|
+
"""Create an application delete call with ABI method call transaction.
|
|
562
|
+
|
|
563
|
+
:example:
|
|
564
|
+
>>> #Basic example
|
|
565
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
566
|
+
>>> params = AppDeleteMethodCallParams(sender="SENDER_ADDRESS", app_id=789, method=some_abi_method_object)
|
|
567
|
+
>>> built_txns = creator.app_delete_method_call(params)
|
|
568
|
+
|
|
569
|
+
:example:
|
|
570
|
+
>>> #Advanced example
|
|
571
|
+
>>> creator.app_delete_method_call(AppDeleteMethodCallParams(
|
|
572
|
+
sender="SENDER_ADDRESS",
|
|
573
|
+
app_id=789,
|
|
574
|
+
method=some_abi_method_object,
|
|
575
|
+
args=[b'method_arg'],
|
|
576
|
+
account_references=["ACCOUNT1"],
|
|
577
|
+
app_references=[789],
|
|
578
|
+
asset_references=[123],
|
|
579
|
+
box_references=[],
|
|
580
|
+
lease="lease",
|
|
581
|
+
note=b"note",
|
|
582
|
+
rekey_to="REKEYTOADDRESS",
|
|
583
|
+
first_valid_round=1000,
|
|
584
|
+
validity_window=10,
|
|
585
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
586
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
587
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
588
|
+
))
|
|
589
|
+
"""
|
|
141
590
|
return self._transactions(lambda c: c.add_app_delete_method_call)
|
|
142
591
|
|
|
143
592
|
@property
|
|
144
593
|
def app_call_method_call(self) -> Callable[[AppCallMethodCallParams], BuiltTransactions]:
|
|
145
|
-
"""Create an application call with ABI method call transaction.
|
|
594
|
+
"""Create an application call with ABI method call transaction.
|
|
595
|
+
|
|
596
|
+
:example:
|
|
597
|
+
>>> #Basic example
|
|
598
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
599
|
+
>>> params = AppCallMethodCallParams(sender="SENDER_ADDRESS", app_id=789, method=some_abi_method_object)
|
|
600
|
+
>>> built_txns = creator.app_call_method_call(params)
|
|
601
|
+
:example: Advanced example
|
|
602
|
+
>>> creator.app_call_method_call(AppCallMethodCallParams(
|
|
603
|
+
sender="SENDER_ADDRESS",
|
|
604
|
+
app_id=789,
|
|
605
|
+
method=some_abi_method_object,
|
|
606
|
+
args=[b'method_arg'],
|
|
607
|
+
account_references=["ACCOUNT1"],
|
|
608
|
+
app_references=[789],
|
|
609
|
+
asset_references=[123],
|
|
610
|
+
box_references=[],
|
|
611
|
+
lease="lease",
|
|
612
|
+
note=b"note",
|
|
613
|
+
rekey_to="REKEYTOADDRESS",
|
|
614
|
+
first_valid_round=1000,
|
|
615
|
+
validity_window=10,
|
|
616
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
617
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
618
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
619
|
+
))
|
|
620
|
+
"""
|
|
146
621
|
return self._transactions(lambda c: c.add_app_call_method_call)
|
|
147
622
|
|
|
148
623
|
@property
|
|
149
624
|
def online_key_registration(self) -> Callable[[OnlineKeyRegistrationParams], Transaction]:
|
|
150
|
-
"""Create an online key registration transaction.
|
|
625
|
+
"""Create an online key registration transaction.
|
|
626
|
+
|
|
627
|
+
:example:
|
|
628
|
+
>>> #Basic example
|
|
629
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
630
|
+
>>> params = OnlineKeyRegistrationParams(
|
|
631
|
+
sender="SENDER_ADDRESS",
|
|
632
|
+
vote_key="VOTE_KEY",
|
|
633
|
+
selection_key="SELECTION_KEY",
|
|
634
|
+
vote_first=1000,
|
|
635
|
+
vote_last=2000,
|
|
636
|
+
vote_key_dilution=10,
|
|
637
|
+
state_proof_key=b"state_proof_key_bytes"
|
|
638
|
+
)
|
|
639
|
+
>>> txn = creator.online_key_registration(params)
|
|
640
|
+
|
|
641
|
+
:example:
|
|
642
|
+
>>> #Advanced example
|
|
643
|
+
>>> creator.online_key_registration(OnlineKeyRegistrationParams(
|
|
644
|
+
sender="SENDER_ADDRESS",
|
|
645
|
+
vote_key="VOTE_KEY",
|
|
646
|
+
selection_key="SELECTION_KEY",
|
|
647
|
+
vote_first=1000,
|
|
648
|
+
vote_last=2000,
|
|
649
|
+
vote_key_dilution=10,
|
|
650
|
+
state_proof_key=b"state_proof_key_bytes",
|
|
651
|
+
lease="lease",
|
|
652
|
+
note=b"note",
|
|
653
|
+
rekey_to="REKEYTOADDRESS",
|
|
654
|
+
first_valid_round=1000,
|
|
655
|
+
validity_window=10,
|
|
656
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
657
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
658
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
659
|
+
))
|
|
660
|
+
"""
|
|
151
661
|
return self._transaction(lambda c: c.add_online_key_registration)
|
|
152
662
|
|
|
153
663
|
@property
|
|
154
664
|
def offline_key_registration(self) -> Callable[[OfflineKeyRegistrationParams], Transaction]:
|
|
155
|
-
"""Create an offline key registration transaction.
|
|
665
|
+
"""Create an offline key registration transaction.
|
|
666
|
+
|
|
667
|
+
:example:
|
|
668
|
+
>>> #Basic example
|
|
669
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
670
|
+
>>> txn = creator.offline_key_registration(OfflineKeyRegistrationParams(sender="SENDER_ADDRESS",
|
|
671
|
+
prevent_account_from_ever_participating_again=True))
|
|
672
|
+
|
|
673
|
+
:example:
|
|
674
|
+
>>> #Advanced example
|
|
675
|
+
>>> creator.offline_key_registration(OfflineKeyRegistrationParams(
|
|
676
|
+
sender="SENDER_ADDRESS",
|
|
677
|
+
prevent_account_from_ever_participating_again=True,
|
|
678
|
+
lease="lease",
|
|
679
|
+
note=b"note",
|
|
680
|
+
rekey_to="REKEYTOADDRESS",
|
|
681
|
+
first_valid_round=1000,
|
|
682
|
+
validity_window=10,
|
|
683
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
684
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
685
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
686
|
+
))
|
|
687
|
+
"""
|
|
156
688
|
return self._transaction(lambda c: c.add_offline_key_registration)
|